You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kubernetes_nodes: expose maxUnavailable so a pool without spare capacity can drain first #79
cozystack/cozystack#5153 adds maxUnavailable to the KubernetesNodes spec (packages/apps/kubernetes-nodes), and to each worker pool of a ComputePlane, which forwards it to the pool chart. Unset, it is 0: a rollout (instance type, image or version change) brings up each replacement worker before it drains an old one. A pool with no room for one extra VM, short of quota or capacity, then stalls with the new Machine Pending, and the documented way out is to set maxUnavailable: 1, which drains first.
cozystack_kubernetes_nodes cannot set it. internal/provider/kubernetes_nodes_schema.go has no attribute for it, and since an update replaces the whole spec, a value set outside Terraform is dropped on the next apply. A Terraform-managed pool that needs to drain first therefore has no way to express it.
What is needed:
a max_unavailable attribute on the cozystack_kubernetes_nodes resource and data source, Optional, Int64, between 0 and 2147483647 (the bounds the API schema enforces);
no provider-side default: left unset it must not be sent, so the chart keeps choosing 0, or 1 on a pool with gpus;
the field in the model and the expand/flatten pair.
The provider has no ComputePlane resource, so nothing is needed there yet; whoever adds one should carry the per-pool maxUnavailable too.
Activity
fix(kubernetes): bring up a replacement worker before draining the ol…