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
cluster-api-provider-kairos: webhook Service and Deployment select other providers' pods in a shared namespace #5815
The webhook Service and the manager Deployment select only control-plane: controller-manager. config/bootstrap/kustomization.yaml adds cluster.x-k8s.io/provider: bootstrap-kairos-io with includeSelectors: false, so the provider label is in neither selector and not on the pods.
A standalone install never sees this, because the provider has its namespace to itself. cluster-api-operator can install several providers into one namespace, and there the other managers carry control-plane: controller-manager too. The webhook EndpointSlice then lists their pods, and a mkairosconfig.kb.io call that lands on one of them fails with an x509 error, so MachineSets cannot create KairosConfigs. The Deployment selector matches those pods as well, and the Kubernetes docs warn that controllers with overlapping selectors can conflict.
The kubeadm and Talos bootstrap providers already put cluster.x-k8s.io/provider into the Service selector and the Deployment matchLabels. I propose the same here: the label on the pod template, in the Service selector and in matchLabels.
The matchLabels part breaks upgrades of existing installs. spec.selector is immutable, so the apply fails until the Deployment is deleted and recreated. The non-breaking option is the pod template and the Service selector only, which keeps the reason includeSelectors: false was chosen. That fixes the webhook and leaves the Deployment overlap. I can open a PR for either.
Activity