question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

calicp-kube-controllers can't get API Server: context deadline exceeded

See original GitHub issue

I have the problem after having installed microk8s on my Ubuntu 21.10 server:

sudo snap install microk8s --channel=1.23 --classic

Checked the pods and saw that one crushed:

$ microk8s.kubectl get pods -n kube-system
calico-node-c7h46                          1/1     Running            1 (7m38s ago)   10m
calico-kube-controllers-5ddf994775-gp8cv   0/1     CrashLoopBackOff   7 (34s ago)     10m

In logs , I see that something is wrong with the API Server:

$ microk8s.kubectl logs calico-kube-controllers-5ddf994775-gp8cv  -n kube-system
2022-04-22 13:26:15.311 [INFO][1] main.go 88: Loaded configuration from environment config=&config.Config{LogLevel:"info", WorkloadEndpointWorkers:1, ProfileWorkers:1, PolicyWorkers:1, NodeWorkers:1, Kubeconfig:"", DatastoreType:"kubernetes"}
W0422 13:26:15.312587       1 client_config.go:543] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
2022-04-22 13:26:15.313 [INFO][1] main.go 109: Ensuring Calico datastore is initialized
2022-04-22 13:26:25.313 [ERROR][1] client.go 261: Error getting cluster information config ClusterInformation="default" error=Get "https://10.152.183.1:443/apis/crd.projectcalico.org/v1/clusterinformations/default": context deadline exceeded
2022-04-22 13:26:25.313 [FATAL][1] main.go 114: Failed to initialize Calico datastore error=Get "https://10.152.183.1:443/apis/crd.projectcalico.org/v1/clusterinformations/default": context deadline exceeded

Result of microk8s.inspect

inspection-report-20220422_132011.tar.gz

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:43 (12 by maintainers)

github_iconTop GitHub Comments

7reactions
ktsakalozoscommented, Apr 27, 2022

Hi could you please try this.

  1. Edit /etc/modules and add in there a new line: br_netfilter . This will load br_netfilter at boot time.
  2. sudo microk8s stop to stop MicroK8s services
  3. Edit /var/snap/microk8s/current/args/kube-proxy and remove the --proxy-mode completely.
  4. sudo modprobe br_netfilter to load the br_netfilter if not already loaded.
  5. sudo microk8s start to start MicroK8s services
4reactions
AlexsJonescommented, Apr 25, 2022

Hey folks, we’ll take a look at this right away. Thank you all for raising this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

kube-controllers failing to query API: Context deadline exceeded
So, this error message can be caused by a number of different root causes. It is effectively saying that it took more than...
Read more >
Calico 3.17.1 kube-controllers fail to reach apiserver at startup
The kube-controllers of calico 3.17.1 fail to reach the apiserver for quite ... context deadline exceeded 2021-01-07 13:30:09.885 [ERROR][1] main.go 207: ...
Read more >
calico-kube-controllers Failed to initialize Calico data store" error
when calico-kube-controller starts on the worker node. ... context deadline exceeded 2021-07-26 15:24:31.357 [FATAL][1] main.go 118: Failed ...
Read more >
After an install, I only have the postgres-0 pod!
Installer hangs while trying to connect to the local microk8s registry. calico-kube-controllers in the kube-system namespace throwing this error ...
Read more >
Configuring the Calico Kubernetes controllers - Tigera
The different controllers monitor the Kubernetes API and perform actions based on cluster state. Operator; Manifest. If you have installed Calico using the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found