Search code examples
kuberneteskubeconfig

where I can find kubeadm-config.yaml on my kubernetes cluster


There is a k8s single master node, I need to back it up and restore it I googled this topic and found a solution - https://elastisys.com/2018/12/10/backup-kubernetes-how-and-why/

Everything looked easy; so,I followed the instruction and got a copy of the certificates and a snapshot of the etcd database.

But at last, I am not able to find kubeadm-config.yaml on my master server.

Where to find this file?


Solution

  • During kubeadm init, kubeadm uploads the ClusterConfiguration object to your cluster in a ConfigMap called kubeadm-config in the kube-system namespace. You can get it from the ConfigMap and take a backup

    kubectl get cm kubeadm-config  -n kube-system -o yaml > kubeadm-config.yaml
    

    https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-config/