diff --git a/cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go b/cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go index 7224cad7d8c..319da9cdd37 100644 --- a/cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go +++ b/cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go @@ -81,7 +81,7 @@ func runCleanupNode(c workflow.RunData) error { klog.Warningf("[reset] Failed to remove containers: %v\n", err) } - r.AddDirsToClean("/etc/cni/net.d", "/var/lib/dockershim", "/var/run/kubernetes", "/var/lib/cni") + r.AddDirsToClean("/var/lib/dockershim", "/var/run/kubernetes", "/var/lib/cni") // Remove contents from the config and pki directories klog.V(1).Infoln("[reset] Removing contents from the config and pki directories") diff --git a/cmd/kubeadm/app/cmd/reset.go b/cmd/kubeadm/app/cmd/reset.go index ccd0d5ebcc3..b49600af0d7 100644 --- a/cmd/kubeadm/app/cmd/reset.go +++ b/cmd/kubeadm/app/cmd/reset.go @@ -49,6 +49,10 @@ var ( The reset process does not clean your kubeconfig files and you must remove them manually. Please, check the contents of the $HOME/.kube/config file. `) + + cniCleanupInstructions = dedent.Dedent(` + The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d + `) ) // resetOptions defines all the options exposed via flags by kubeadm reset. @@ -179,6 +183,8 @@ func NewCmdReset(in io.Reader, out io.Writer, resetOptions *resetOptions) *cobra data := c.(*resetData) cleanDirs(data) + // output help text instructing user how to remove cni folders + fmt.Print(cniCleanupInstructions) // Output help text instructing user how to remove iptables rules fmt.Print(iptablesCleanupInstructions) return nil