Path to Kubernetes cluster CA cert and ca cert private key

12/27/2018

export K8s cluster CA cert and CA private key

Team, I have a Kubernetes cluster running. I will be deleting and creating it again and again so I want to reuse the same CA cert all the time for which I need to save the CA cert and key to create secret as below

create secret keypair ca --cert ${CACRT} --key ${CAKEY} --name ${NAME}

Need path to the cert and key and also kops command to export them.

-- fma abd
kubernetes

1 Answer

12/27/2018

I'm not really sure what you are trying to accomplish with the create secret keypair ca... command, but you can get these right out of one of the Kubernetes masters (or master if you have one).

$ ssh user@kubernetesmaster

Then:

$ cat /etc/kubernetes/pki/ca.crt
...
$ cat /etc/kubernetes/pki/ca.key

Note that etcd usually uses a different CA. You can find it under:

/etc/kubernetes/pki/etcd
-- Rico
Source: StackOverflow