Disable swap if found

Bug #1842092 reported by Andrea Ieri
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
Triaged
Wishlist
Unassigned
Kubernetes Worker Charm
Triaged
Wishlist
Unassigned

Bug Description

Considering that swap is not supported (https://github.com/kubernetes/kubernetes/issues/53533), the charm should manage swap files / partitions and disable them if found. failSwapOn could then be set to true to defend against possible future changes to swap.

Andrea Ieri (aieri)
tags: added: canonical-bootstack
Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

Indeed k8s has a checker that raises an exception whenever swap is available. However, as raised on a discussion on k8s channel, there are other issues one should consider, main one being: https://bugzilla.kernel.org/show_bug.cgi?id=110501

Which causes kswapd to take 100% of one core if swap is disabled and there is intensive use of memory.

George Kraft (cynerva)
Changed in charm-kubernetes-master:
importance: Undecided → Wishlist
Changed in charm-kubernetes-worker:
importance: Undecided → Wishlist
Changed in charm-kubernetes-master:
status: New → Triaged
Changed in charm-kubernetes-worker:
status: New → Triaged
Revision history for this message
Chris Sanders (chris.sanders) wrote :

The swap warning default is worth another review. Currently you can override it with the kubelet-extra-config setting, but it seems reasonable that the error should default to on and require you to disable it if you want to accept the risk. I would like to see the breadth of impact this change would have for various cloud providers before we made a change to the default setting.

I'm not sure that managing swap partitions is in scope of a kubernetes-worker charm. That seems like it's part of the provisioning and machine configuration. Do you have any bugs or reason why swap isn't being managed by the deployment tooling?

I suspect the reason for trying to get the k8s charms to handle this is driven by difficulty in getting swap configured as part of a public cloud deployment. I would like to better understand why the provisioning isn't handling this and make sure we're fixing it in the right place. For example, when you say the charm should manage swap partitions if found. It seems unreasonable for the charm to remove a swap partition and grow a root partition.

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.