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

1

5

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?

Lunulate answered 4/4, 2020 at 3:10 Comment(0)
F
6

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/

Ferricyanide answered 4/4, 2020 at 3:23 Comment(5)
thanks, I got the kubeadm-config.yaml but when I restore my master I got no no InitConfiguration or ClusterConfiguration kind was found in the YAML fileLunulate
Initialize the master with backup sudo kubeadm init --ignore-preflight-errors=DirAvailable--var-lib-etcd \ --config /etc/kubeadm/kubeadm-config.yamlLunulate
share the yaml file in your questionFerricyanide
this is the Configmap data which need to be reformatted into the actual config file before using it for kubeadm initFerricyanide
make sure to upload the latest updates : kubeadm config upload from-fileLarondalarosa

© 2022 - 2024 — McMap. All rights reserved.