profile for Gajendra D Ambi on Stack Exchange, a network of free, community-driven Q&A sites

Tuesday, June 23, 2020

Add kubernetes cluster to gitlab


  1. Create a serviceaccount for namespace kube-system (let us say gitlab is the name of the serviceaccount)
  2. kubectl -n kube-system get sa gitlab -o yaml
  3. You will find the token from the step 2. Let us say the name of that token is gitlab-token-5g769 kubectl -n kube-system get secret gitlab-token-5g769 -o yaml
  4. Decode the base 64 ca.crt value and then convert it to ca.pem, you can use openssl command line or some online converter
  5. Decode the token too using base 64
  6. Now offer the ca and pem values to gitlab during adding of k8s.