Kubernetes workers constantly in and out of maintenance

Bug #1893220 reported by Hans van den Bogert
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
Fix Released
Medium
Kevin W Monroe

Bug Description

Since a full cluster restart I am experiencing the following behaviour, please see the asciinema since this says more than a 1000 words

https://asciinema.org/a/lglCBQvT1ngisNUcHaS8IX1Oe

juju debug-log does not seem to give any indication why this is happening, though added the last ~20k lines anyway.

Tags: seg sts
Revision history for this message
Hans van den Bogert (hbogert) wrote :
description: updated
Revision history for this message
George Kraft (cynerva) wrote :

In case we lose the asciinema, the symptom is that kubernetes-worker units are repeatedly bouncing leader-settings-changed hooks with status message "Joining snap cohort." appearing. kubernetes-worker charm revision 692, cloud is MAAS.

Revision history for this message
George Kraft (cynerva) wrote :

Can you provide debug-log for kubernetes-worker-86 as well? That's the leader unit and I think we'll need to see what it is doing.

> Since a full cluster restart

If I understand correctly, you rebooted the hosts?

Changed in charm-kubernetes-worker:
status: New → Incomplete
Revision history for this message
Hans van den Bogert (hbogert) wrote :

> If I understand correctly, you rebooted the hosts?

Yes, the physical nodes were rather harshly rebooted, only on Kubernetes level were the nodes drained.

Added logs for kubernetes-worker-86.

Revision history for this message
Hans van den Bogert (hbogert) wrote :

for archival purposes

George Kraft (cynerva)
Changed in charm-kubernetes-worker:
importance: Undecided → Medium
status: Incomplete → Triaged
Changed in charm-kubernetes-worker:
assignee: nobody → Cory Johns (johnsca)
status: Triaged → In Progress
milestone: none → 1.19+ck1
Revision history for this message
Cory Johns (johnsca) wrote :

This seems to be due to the interplay between the k8s-master treating the cohort update of all snaps as a single group[1] and both the k8s-master[2] and k8s-worker[3] using a workaround for the fact that the initial snap install is not deferred until a set of cohort keys is decided upon (which, in turn, stems from trying to minimize the already large impact the refactor to add cohort support had). This also touches on the cohort update delay discussed in the team daily on Aug. 21 and should perhaps be handled together.

Specifically, the k8s-master determines if new cohort keys need to be created based on whether a new rev of any of the master or worker snaps is available. This runs into trouble when the master asks if a refresh is available for a snap that it doesn't have installed (i.e., kubelet); since it's not installed, it won't see a refresh being available and won't generate a new cohort key, whereas the workers will see the available refresh due to the workaround and will cycle between themselves trying to get it installed. The k8s-master's decision to create a new cohort key should instead be driven by the current vs recorded revision for each snap and how long the current revision has been available vs the refresh timer config.

A workaround to recover from this state is to run the following:

juju run --unit kubernetes-master/leader -- 'leader-set cohort_keys=; hooks/leader-settings-changed'

Revision history for this message
Hans van den Bogert (hbogert) wrote :

#6 worked. Fun fact, my cluster idle wattage reduced from 150w to 100w.

Revision history for this message
Cory Johns (johnsca) wrote :
tags: added: seg
Changed in charm-kubernetes-worker:
assignee: Cory Johns (johnsca) → Kevin W Monroe (kwmonroe)
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :
tags: added: review-needed
Changed in charm-kubernetes-worker:
status: In Progress → Fix Committed
tags: removed: review-needed
affects: charm-kubernetes-worker → charm-kubernetes-master
Changed in charm-kubernetes-master:
milestone: 1.19+ck1 → none
milestone: none → 1.19+ck1
Revision history for this message
Cory Johns (johnsca) wrote :
tags: added: backport-needed
tags: removed: backport-needed
tags: added: sts
Changed in charm-kubernetes-master:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.