calico: Installing Calico 3.6 in Kubernetes results in error in calico-kube-controllers
I am trying to upgrade Calico in my k8s cluster from 3.3 to 3.6. To upgrade, I delete the previously created resources and create new ones. The pod calico-kube-controllers is stuck in ContainerCreating, so none of the calico-node pods start.
Expected Behavior
Calico pods described in the used manifest are created and start running.
Current Behavior
Calico-kube-controllers does not exit the ContainerCreating state.
kubectl describe pod shows this error:
Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "4a3c5993de2bb25bb59c33f55a1ea65f2584980c83c4704ebde6af5bec3e09b5" network for pod "calico-kube-controllers-5cbcccc885-nddnj": NetworkPlugin cni failed to set up pod "calico-kube-controllers-5cbcccc885-nddnj_kube-system" network: error getting ClusterInformation: connection is unauthorized: Unauthorized, failed to clean up sandbox container "4a3c5993de2bb25bb59c33f55a1ea65f2584980c83c4704ebde6af5bec3e09b5" network for pod "calico-kube-controllers-5cbcccc885-nddnj": NetworkPlugin cni failed to teardown pod "calico-kube-controllers-5cbcccc885-nddnj_kube-system" network: error getting ClusterInformation: connection is unauthorized: Unauthorized]
Possible Solution
I am able to upgrade all the way to 3.5, which is the last version without calico-kube-controllers, so I assume there is something going on with this new addition?
Steps to Reproduce (for bugs)
I do not have a fresh cluster to test this on, but how I got where I am is this:
- Create a cluster with kubeadm (I have been through about 3 major Kubernetes verison upgrades with the cluster)
- Install Calico 3.3 following https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/calico#installing-with-the-kubernetes-api-datastore50-nodes-or-less
- Delete the resources created in step 2. with
kubectl delete -f - Install Calico 3.6 following https://docs.projectcalico.org/v3.6/getting-started/kubernetes/installation/calico#installing-with-the-kubernetes-api-datastore50-nodes-or-less
Context
I’m trying to upgrade the Calico version in my cluster.
Your Environment
- Calico version 3.3, trying to get to 3.6
- Orchestrator version (e.g. kubernetes, mesos, rkt): Kubernetes, created via kubeadm
- Operating System and version: Centos 7
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 10
- Comments: 25 (6 by maintainers)
Fixed it by removing leftover files in
/var/lib/cni. I believe that’s a bug for users upgrading from earlier Calico versions.@caseydavenport I tried applying the new installation instead of deleting the old one and creating it, it took the pods a while but seems like they started up okay and I didn’t see any errors in their logs. Thanks! 😃
It looks like the same problem I currently have with upgrading from 3.1 to 3.7.
Was this actually fixed? I’m experiencing what I think is the same issue on a clean Kubernetes 1.15.0 cluster,
kubeadm reset&kubeadm initon Ubuntu 18.04 with Docker-CE 18.09.7 and Calico 3.8.(The same system worked fine with Kubernetes 1.14.1 & Calico 3.3.6.)
Following exactly the steps in https://docs.projectcalico.org/v3.8/getting-started/kubernetes/ leads me to a failure in step 5; the pods don’t come up.
(As you can see I’ve given it 9 minutes…)
Logs:
System logging is basically full of this, might provide a clue? Doesn’t make sense to me at all.
same problem here. Fresh install of ubuntu 20.04, kubeadm init and kubectl apply -f https://docs.projectcalico.org/v3.8/manifests/calico.yaml
Ah, you might try simply applying the new manifests rather than deleting and then creating. Deleting the old manifests will remove the CRD, thus deleting the IP pool.
I’d expect the v3.7 manifest to create an IP pool as well, but it will only do that after the init containers finish, so that might be what’s going on here.