How does KubeConfig file is used?

1/22/2019

When we setup a kubernetes master using kubeadm init . At the end of the procedure we have to copy the /etc/kubernetes/admin.conf to $home/.kube/config .

When I opened the file , I found the below details .

  • certificate authority data
  • client certificate data
  • client key data

I am aware the file is used for authentication when we try to access cluster using kubectl .

What I am trying to understand is from where these details are generated ? .

-- Balakumar Ezhilmaran
kubeconfig
kubectl
kubernetes

1 Answer

1/22/2019

You have two options - Use the automatically generated certificates if you have installed k8s with kubeadm - Create your own certificates.

Once you have the certificates, you can follow these steps to manually configure them https://kubernetes.io/docs/setup/certificates/#configure-certificates-manually To create your own CA certificates, there are many google links and here is one for your reference. http://pages.cs.wisc.edu/~zmiller/ca-howto/ If you are new to this, I would suggest you start with "A Single-level CA"

-- Sushant Sonker
Source: StackOverflow