AKS k8s version 1.13.5 Calico pods in CrashLoopBackOff state
What happened: The Calico pods are in CrashLoopBackOff state after deploying an AKS cluster with Kubernetes version 1.13.5 in Azure region North Europe via Terraform.
The AKS cluster has RBAC with AAD integration enabled.
What you expected to happen: That the Calico pods are in running state.
How to reproduce it (as minimally and precisely as possible): Deploy an AKS cluster with Kubernetes version 1.13.5 in Azure region North Europe with Azure CNI plugin and Calico Network Policy plugin enabled. Also RBAC with AAD integration is enabled.
Anything else we need to know?: Here is the log output of one of the Calico pods. Seems to be an RBAC permission issue.
2019-04-29 06:37:05.718 [INFO][9] startup.go 256: Early log level set to info
2019-04-29 06:37:05.718 [INFO][9] startup.go 272: Using NODENAME environment for node name
2019-04-29 06:37:05.718 [INFO][9] startup.go 284: Determined node name: aks-agentpool-20563840-1
2019-04-29 06:37:05.720 [INFO][9] startup.go 316: Checking datastore connection
2019-04-29 06:37:05.744 [INFO][9] startup.go 340: Datastore connection verified
2019-04-29 06:37:05.744 [INFO][9] startup.go 95: Datastore is ready
2019-04-29 06:37:05.751 [INFO][9] customresource.go 100: Error getting resource Key=GlobalFelixConfig(name=CalicoVersion) Name="calicoversion" Resource="GlobalFelixConfigs" error=the server could not find the requested resource (get GlobalFelixConfigs.crd.projectcalico.org calicoversion)
Calico node failed to start
2019-04-29 06:37:05.769 [INFO][9] node.go 79: Error updating Node resource error=nodes "aks-agentpool-20563840-1" is forbidden: User "system:serviceaccount:kube-system:calico-node" cannot update resource "nodes/status" in API group "" at the cluster scope
2019-04-29 06:37:05.769 [ERROR][9] startup.go 164: Unable to set node resource configuration error=connection is unauthorized: nodes "aks-agentpool-20563840-1" is forbidden: User "system:serviceaccount:kube-system:calico-node" cannot update resource "nodes/status" in API group "" at the cluster scope
2019-04-29 06:37:05.769 [WARNING][9] startup.go 1042: Terminating
Environment:
- Kubernetes version (use
kubectl version): 1.13.5 - Size of cluster (how many worker nodes are in the cluster?) 3
- General description of workloads in the cluster (e.g. HTTP microservices, Java app, Ruby on Rails, machine learning, etc.) Fresh cluster after deployment. No workloads on it.
- Others:
@neumanndaniel This is a known issue because of this week's rollout. We're fixing the rollout now. Meanwhile, you can still try calico feature in Australia or Canada regions.
Thanks @feiskyer
The issue has been fixed now. @neumanndaniel Could you try to upgrade the cluster, or create a new one?
After upgrading, remember to do a cleanup first (this is required, see discussion on aks-engine here):
kubectl delete -f https://github.com/Azure/aks-engine/raw/master/docs/topics/calico-3.3.1-cleanup-after-upgrade.yaml
If there're other Pods (e.g. dashboard) in crashing state, delete the pod and let Kubernetes creating new ones could bring it back.
I had not to do any upgrade. I just restarted the agent nodes and the Calico pods are now up and running. I did not the cleanup yet.
@neumanndaniel OK, when you do the upgrade, remember the cleanup. or else, network policy would be broken.
I deployed a new cluster and it works.
@ams0 thanks for the information.
This happens with AKS deployed with k8s v 1.14 . I deployed a new cluster with v1.14 and seeing the same issue with calico pods.
@sNathan13 How did you deploy a v1.14 cluster? And could you share the logs of calico-node pod (note that there're two containers in that pod)
@feiskyer I created the cluster using cli. Here's the command I used,
az aks create --resource-group <RESOURCE_GP> --name <CLUSTER_NAME> --node-count 2 --generate-ssh-keys --vnet-subnet-id <SUBNET_ID> --dns-name-prefix <DNS_PREFIX> --aad-server-app-id <AAD_SERVER_ID> --aad-server-app-secret <ADD_SECRET> --aad-client-app-id <AAD_CLIENT_ID> --aad-tenant-id <TENANT_ID> --network-plugin azure --network-policy calico --kubernetes-version 1.14.0
And when I try to print the logs, I get an error, Error from server: Get https://aks-nodepool1-11422562-0:10250/containerLogs/kube-system/calico-node-fdhhs/calico-node: dial tcp 10.x.x.x:10250: i/o timeout
@sNathan13 Seems tunnelfront pod is not working as expected. Could you delete the pod, wait a while for new Pod running by controller, and try again with logs?
@feiskyer No luck. I deleted tunnelfront pod and waited for a new one to come up. It still gives me a timeout error, when I try to display logs of Calico pod.
@sNathan13 thanks for the information. Just confirmed there's a version issue of calico-node, the image version should be v3.5.0. We would fix it in AKS's next rollout.
Since Kubernetes v1.14 on AKS is still not production ready yet, and AKS doesn't allow users to change calico manifests, could you try with v1.12 or v1.13 instead?
@feiskyer AKS v1.13.5 works great. I just wanted to test 1.14 and report any issues that I encountered. Thanks for the response :)
@sNathan13 thanks. Let's close the issue since v1.13 is back to normal now.