What happened?
kube-vip manifest generation fails due to invalid default kube_vip_cidr value
Summary
Default value kube_vip_cidr: 32 in roles/kubernetes/node/defaults/main.yml causes invalid YAML in generated kube-vip manifests, preventing kube-vip pods from starting.
Environment
- Kubespray: v2.26.0 (tag: v3.13.11)
- Kubernetes: v1.34.3
- kube-vip: 0.8.0
Bug
File: roles/kubernetes/node/defaults/main.yml (line 72)
Generated manifest (/etc/kubernetes/manifests/kube-vip.yml):
# Line 23 - INVALID YAML:
- name: vip_subnet value: "32"
Error:
couldn't parse as pod(yaml: line 23: mapping values are not allowed in this context)
Expected Output
- name: vip_subnet
value: "32"
Root Cause
The Jinja2 template renders the YAML incorrectly when kube_vip_cidr is set to a bare number instead of null/undefined.
Fix
Remove or set to null in roles/kubernetes/node/defaults/main.yml:
kube_vip_cidr: # unset, or
kube_vip_cidr: null
kube_vip_cidr is optional - kube-vip auto-detects subnet from interface when unset.
Workaround
Set explicitly in inventory:
Impact
- Breaks control plane HA completely
- kube-vip pods fail to start
- VIP not configured
- Affects all clusters using kube-vip with default settings
What did you expect to happen?
Expected Output
- name: vip_subnet
value: "32"
How can we reproduce it (as minimally and precisely as possible)?
run cluster.yml for HA cluster using kube_vip setup like this: https://docs.nvidia.com/networking/display/kubernetes2310/deployment/kubespray.html#customize-installation
OS
Ubuntu 24
Version of Ansible
ansible [core 2.17.14]
Version of Python
Python 3.13.11
Version of Kubespray (commit)
20ab917
Network plugin used
cilium
Full inventory with variables
n/a
Command used to invoke ansible
cluster.yml
Output of ansible run
n/a
Anything else we need to know
No response
What happened?
kube-vip manifest generation fails due to invalid default kube_vip_cidr value
Summary
Default value
kube_vip_cidr: 32inroles/kubernetes/node/defaults/main.ymlcauses invalid YAML in generated kube-vip manifests, preventing kube-vip pods from starting.Environment
Bug
File:
roles/kubernetes/node/defaults/main.yml(line 72)Generated manifest (
/etc/kubernetes/manifests/kube-vip.yml):Error:
Expected Output
Root Cause
The Jinja2 template renders the YAML incorrectly when
kube_vip_cidris set to a bare number instead of null/undefined.Fix
Remove or set to
nullinroles/kubernetes/node/defaults/main.yml:kube_vip_cidris optional - kube-vip auto-detects subnet from interface when unset.Workaround
Set explicitly in inventory:
Impact
What did you expect to happen?
Expected Output
How can we reproduce it (as minimally and precisely as possible)?
run cluster.yml for HA cluster using kube_vip setup like this: https://docs.nvidia.com/networking/display/kubernetes2310/deployment/kubespray.html#customize-installation
OS
Ubuntu 24
Version of Ansible
ansible [core 2.17.14]
Version of Python
Python 3.13.11
Version of Kubespray (commit)
20ab917
Network plugin used
cilium
Full inventory with variables
n/a
Command used to invoke ansible
cluster.yml
Output of ansible run
n/a
Anything else we need to know
No response