-
Notifications
You must be signed in to change notification settings - Fork 716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubeadm reset breaks CNI for others #1822
Comments
how would we know what CNI plugin the user installed? |
@kubernetes/sig-cluster-lifecycle |
Right, it was actually What I meant is that it probably shouldn't delete any config files that it hasn't installed itself ? |
You should at least check if the file is in the packaging database. Don't remove files installed by RPM or APT. |
given minikube installs files in that directory and given minikube uses kubeadm, it would be the responsibility of minikube to workaround potential conflicts or do required backups.
kubeadm itself does not install any files in the directory, it's the CNI plugin that does that and the CNI plugins is the responsibility of the user or higher level tools. however node cleanup is the responsibility of if you wish to skip node cleanup you can use example output from reset:
so a question we can ask here is would it be OK for kubeadm to simply not remove after doing some quick tests, first using calico leaving it's configuration and then using weave. the answer is that it's not OK. the presence of multiple CNI configurations in that directory breaks followup |
CNI plugin files are not tracked in packaging databases, to my knowledge. so if the user has installed something custom in that directory kubeadm will clean that too. another problem is that we don't wish to execute package manager semantics from kubeadm. |
i have added this topic for the next kubeadm office hours agenda (this Wednesday). |
For minikube we will probably just do like CRI-O does, and document it as a quirk of For the default option, where we create and destroy a VM just for minikube, we don't call "reset". https://minikube.sigs.k8s.io/docs/reference/drivers/none/
In this case, the tracked file was installed by the
However,
Thanks for looking into this issue. |
possibly referring to?
it would have been fine if kubeadm didn't clean this directory at all, except that multiple CNI networks, can break
i figured that might be the case. as pointed out earlier:
it really feels kubeadm shouldn't get into the package manager support and abstraction.
it certainly a widely used command, especially in the baremetal case or in the case where users don't wish to re-create cloud provider or local VMs.
this is a workaround, but obviously not ideal. there is no way for kubeadm to know what files are owned by what application without package manager semantics, also, files in that directory may not be of package origin. |
Yes, although I'm not sure I agree with the suggested cri-o workaround of moving the dir ? So more likely it will be listed briefly under "paths that minikube delete will erase" or such
Indeed, the file created by minikube (k8s.conf) is not tracked by any package manager... There is also no guarantee that kubeadm itself (or cri-o) is installed from such a package. |
if cri-o is setup to use a different directory for it's CNI configuration, kubeadm will indeed not touch such a directory on i haven't experimented with that. @bart0sh @kad how are you handling this in your cri-o usage? |
I think this is a reasonable thing to do, not removing anything in that directory and printing a warning as we are doing with iptables rules. |
yet, i'm seeing a breakage if both Calico and Weave configs are present in subsequent cluster creations. added this as an agenda item for the office hours. |
Podman is definitely handled by a package manager. rpm -qf /etc/cni/net.d/87-podman-bridge.conflist |
@mheon FYI. Would CNI work if we installed the configuration in a location like /usr/share/cni/net.d? |
the CNI plugins that i tested on Ubuntu always install configuration in |
@rhatdan We manually define the CNI config directories, so we could add an additional one if we wanted to. However, |
/assign @yastij |
@afbjorklund we discussed today during the kubeadm office hours and we decided that we are going to go with that proposal from @ereslibre :
|
What keywords did you search in kubeadm issues before filing this one?
/etc/cni/net.d
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
kubeadm version (use
kubeadm version
):kubeadm version: &version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:34:01Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Environment:
kubectl version
):Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"
uname -a
): 4.18.0-80.7.1.el8_0.x86_64What happened?
When running
kubeadm reset
, it removed the entire/etc/cni/net.d
directory.This caused
podman
and any other tools using CNI networking to stop working...What you expected to happen?
It should only remove the files that it installed itself, not the entire global directory.
In this case, it should only have removed
/etc/cni/net.d/k8s.conf
and not the rest.How to reproduce it (as minimally and precisely as possible)?
sudo yum install podman
sudo minikube start --vm-driver=none
(callskubeadm init
)sudo minikube delete
(callskubeadm reset
)sudo podman run busybox
Anything else we need to know?
To restore previous functionality, one has to do:
sudo yum reinstall podman
.The code is in: https://github.com/kubernetes/kubernetes/blob/v1.16.0/cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go#L84
EDIT: Updated to make it clear that the commands used are coming from minikube
See kubernetes/minikube#5532 for the entire minikube context, running on CentOS 8.
The text was updated successfully, but these errors were encountered: