Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export kubeconfig file from existing cluster?

Is there an easy way to export kubeconfig file from existing cluster so i can use it in CI/CD ?

like image 938
Raad Altaie Avatar asked May 15 '20 22:05

Raad Altaie


People also ask

How do I export from Kubeconfig?

Show activity on this post. and copy the file, which is the kubeconfig for your cluster. kubectl config view --minify , it will display all the info except for the client ca certificate and client key. The location of those keys depends on how the cluster is setup.


Video Answer


1 Answers

What kind of cluster is it? A managed(AKS,EKS or GKE etc) one, where is it deployed? Can you ssh in to master node, if yes, please

cat /etc/kubernetes/admin.conf or cat ~/.kube/config

and copy the file, which is the kubeconfig for your cluster.

Other ways to create the kubeconfig, Run the following command

kubectl config view --minify, it will display all the info except for the client ca certificate and client key. The location of those keys depends on how the cluster is setup.

like image 131
redzack Avatar answered Oct 12 '22 14:10

redzack