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.

Exclude secondary IP from produce_certs (and node service restarts)

See original GitHub issue

Currently, MicroK8s is rebuilding the node certificates and restarting all the MicroK8s services on a node if any IP address changes. This conflicts with the operation of the PureLB Load Balancer when allocating local addresses.

When PureLB is installed and needs to assign an local IP address for load balancing use, it adds a secondary IP address to the ethernet adapter with a default route. This IP address change is triggering the daemon-apiserver-kicker to restart all the services. It then makes the running pods all go un-healthy so the pool IP allocation is removed and then reattempted on another node (or when this node comes back), and a never-ending cycle starts.

https://github.com/ubuntu/microk8s/blob/700359017d2c7f839638422e9d0ae876b4f7e632/microk8s-resources/wrappers/apiservice-kicker#L50-L68

Adding --advertise-address or --bind-address to args/kube-apiserver, while stopping the above process, seems to prevent a node join, I assume because the certificates do need to be rebuilt and the services restarted.

I propose that the fix is to adjust the get_ips() that produce_certs() uses to exclude any secondary IPs. This is how the function looks currently:

https://github.com/ubuntu/microk8s/blob/8d0b9e5d6cfdb61b855b0d1ad657b43c4db73583/microk8s-resources/actions/common/utils.sh#L330-L350

This is how the ip list looks on a node that PureLB’s lbnodeagent has allocated an ip address (10.3.50.193) based on a Load Balancer demand:

$ hostname -I
10.3.50.68 10.3.50.193 10.1.233.192
$ ip -o addr list
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft forever
2: eth0    inet 10.3.50.68/24 brd 10.3.50.255 scope global eth0\       valid_lft forever preferred_lft forever
2: eth0    inet 10.3.50.193/24 brd 10.3.50.255 scope global secondary eth0\       valid_lft forever preferred_lft forever
2: eth0    inet6 fe80::215:5dff:fe32:800/64 scope link \       valid_lft forever preferred_lft forever
6: vxlan.calico    inet 10.1.233.192/32 brd 10.1.233.192 scope global vxlan.calico\       valid_lft forever preferred_lft forever
6: vxlan.calico    inet6 fe80::641a:d3ff:fe93:5639/64 scope link \       valid_lft forever preferred_lft forever
7: calieeedeb80fed    inet6 fe80::ecee:eeff:feee:eeee/64 scope link \       valid_lft forever preferred_lft forever
16: kube-lb0    inet6 fe80::dc6c:83ff:fec8:c3df/64 scope link \       valid_lft forever preferred_lft forever

Are there any cases where the secondary ip addresses should be in the certificate?

hostname -I could return ipv6 addresses and PureLB can allocate ipv6 addresses, so my use of ip above includes both ipv4 and ipv6 instead of using -4.

Also, while I haven’t used it yet, PureLB can assign global virtual addresses to it’s kube-lb0 adapter, and those would need to be excluded from the reconfiguration as well.

cc: @adamdunstan as a PureLB developer.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
devZer0commented, Nov 23, 2022

recent activity because stale bots suck

0reactions
stale[bot]commented, Nov 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exclude secondary IP from produce_certs (and node service ...
This IP address change is triggering the daemon-apiserver-kicker to restart all the services. It then makes the running pods all go un-healthy ...
Read more >
Changing IP addresses and host names - IBM
If the host names or IP addresses of the primary or secondary GPFS cluster configuration server nodes must change, use the mmchcluster command...
Read more >
Node.js pm2 keeps restarting almost every second
js app on a Azure server. I use pm2 for process management. The issue is pm2 keeps restarting almost every seconds. staging@Server:/srv/apps ...
Read more >
VPC-native clusters | Google Kubernetes Engine (GKE)
Important: The node, Pod, and Services IP address ranges must all be unique. You cannot create a subnet whose primary and secondary IP...
Read more >
Changing the IP address of network adapters in cluster server
In this article. More information. This article describes how to change the IP addresses of the network adapters in the nodes of a...
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