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.

TaintManagerEviction - Pod gets new IP 1 to a few times a day to a few days appart - preceeded by Warning Unhealthy pod/calico-kube-controllers

See original GitHub issue

I’ve asked on stack overflow and no one can help. So treat this as a request to enhance the document. 25% chance there is a bug in microk8s.

Microk8s relaunches a pod and gives it a new IP address every 8-24hrs. The pod does not receive or send traffic at the time of being recreated or generate any logs before microk8s relaunches the pod. microk8s kubectl logs <podname> --follow does not show any logs post starting the experiment, it just stops in the middle of the night.

microk8s kubectl logs <podname> -p only shows normal operation before is relaunched by microk8s.

microk8s kubectl get pods reports an AGE for the pod as if it was not restarted.

The same docker image runs months on docker without any crashes.

I’ve searched through the inspect logs and do not understand these logs or where to focus. So I’m effectively blind. This blind man speculates that IP leases set up by microk8s expire and microk8s relaunched the pod so they use the new IP.

Just in case it’s related to the Ubuntu 18 PC, I reformated the drive, installed ubuntu 20, microk8s, and the problem persists.

Edit: Jan 5, 2021: microk8s kubectl get events mostly returns “no resources found in default namespace” but did report TaintManagerEviction, see jan 5 updates below

inspection-report-20210104_122244.tar.gz

BTW, microk8s is way cool and easy to setup.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:33 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ktsakalozoscommented, Jan 11, 2021

I do not think the snap.microk8s.daemon-apiserver-kicker is causing this. The snap.microk8s.daemon-apiserver-kicker [1] is keeping an eye of the interfaces you have on your machine and if there is a change is forces a restart of the apiserver (only the apiserver) so that k8s is available in all interfaces. If you do not need this behavior (eg you know the IP of your machine will not change or you want the apiserver on specific interfaces) you can bind the apiserver to a specific IP by adding the --advertise-address or --bind-address arguments in /var/snap/microk8s/current/args/kube-apiserver according to [2] and restart MicroK8s.

The behavior we have here causes all services to restart. It is as if there is a snap refresh happening but the latest/stable channel you are following has not changed for a while now. Could we see the out put of snap changes microk8s ?

Also you would better switch to channel 1.20/stable if this is a long lasting cluster. The following the latest/stable means that you will get upgraded to 1.21 when that comes out.

sudo snap refresh microk8s --channel=1.20/stable

I also see this snap-store snap installed. I do not think this would cause snap refreshes but if you do not need it you may want to remove it, just in case.

[1] https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/wrappers/apiservice-kicker [2] https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/

0reactions
johngrabnercommented, Jan 30, 2021

The solution to keeping microk8s stable beyond a day is

  • ubuntu UI “Software and Updates” tab 3 “Updates”, set to “never” … but dont forget to manual update
  • sudo snap set system refresh.timer=sun
  • disable wifi even if not used
  • systemctl stop snap.microk8s.daemon-apiservice-kicker

In my case, will continue to investigate when time permits what one of the above caused the frequent resets to my app and update this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TaintManagerEviction - Pod gets new IP 1 to a few times a day ...
and I see pod has new address. When I issue command microk8s kubectl logs <pod> I get logs for a normal start of...
Read more >
TaintManagerEviction - maybe cause of my pod get a new IP a ...
My setup is a ubuntu 18.04 host with very little installed excepted for docker, docker-compose, git, visual studio code and microk8s kubernetes.
Read more >
Updating clusters, worker nodes, and cluster components
Wait a few minutes, then confirm that the update is complete. Review the API server version on the IBM Cloud clusters dashboard or...
Read more >
Kubernetes Cluster on CentOS 7 with kubeadm 1.24 - calico ...
i solved the problem this way : by adding these IP range in no_proxy of these 2 files : 10.96.0.0/24 (kubernetes API); 192.168.0.0/16...
Read more >
Kubernetes Pod Evictions | Troubleshooting and Examples
The unexpected eviction of pods can be alarming. Here are some tips for troubleshooting this resource issue.
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