This command reverts any changes made by kubeadm init
or kubeadm join
.
Run this to revert any changes made to this host by ‘kubeadm init’ or ‘kubeadm join’
Run this to revert any changes made to this host by ‘kubeadm init’ or ‘kubeadm join’
The “reset” command executes the following phases:
preflight Run reset pre-flight checks
update-cluster-status Remove this node from the ClusterStatus object.
remove-etcd-member Remove a local etcd member.
cleanup-node Run cleanup node.
kubeadm reset [flags]
--cert-dir string The path to the directory where the certificates are stored. If specified, clean this directory. (default "/etc/kubernetes/pki")
--cri-socket string Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.
-f, --force Reset the node without prompting for confirmation.
-h, --help help for reset
--ignore-preflight-errors strings A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.
--kubeconfig string The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file. (default "/etc/kubernetes/admin.conf")
--skip-phases strings List of phases to be skipped
--rootfs string [EXPERIMENTAL] The path to the 'real' host root filesystem.
kubeadm reset
is responsible for cleaning up a node local file system from files that were created using
the kubeadm init
or kubeadm join
commands. For control-plane nodes reset
also removes the local stacked
etcd member of this node from the etcd cluster and also removes this node’s information from the kubeadm
ClusterStatus
object. ClusterStatus
is a kubeadm managed Kubernetes API object that holds a list of kube-apiserver endpoints.
kubeadm reset phase
can be used to execute the separate phases of the above workflow.
To skip a list of phases you can use the --skip-phases
flag, which works in a similar way to
the kubeadm join
and kubeadm init
phase runners.
kubeadm reset
will not delete any etcd data if external etcd is used. This means that if you run kubeadm init
again using the same etcd endpoints, you will see state from previous clusters.
To wipe etcd data it is recommended you use a client like etcdctl, such as:
etcdctl del "" --prefix
See the etcd documentation for more information.
Was this page helpful?
Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on Stack Overflow. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.