-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
What would you like to be added
The node_labels inventory variables should support removal operations:
Allow null values to remove labels
node_labels:
remove_this: nullCurrently, kubespray only adds/updates labels. Removing them requires manual kubectl commands.
Proposed Change
--- a/roles/kubernetes/node-label/tasks/main.yml
+++ b/roles/kubernetes/node-label/tasks/main.yml
@@ -24,7 +24,7 @@
- name: Populate inventory node label
set_fact:
- inventory_node_labels: "{{ inventory_node_labels + ['%s=%s' | format(item.key, item.value)] }}"
+ inventory_node_labels: "{{ inventory_node_labels + [('%s-' | format(item.key)) if item.value is none else ('%s=%s' | format(item.key, item.value))] }}"
loop: "{{ node_labels | d({}) | dict2items }}"
when:
- node_labels is definedWhy is this needed
When managing node labels declaratively through inventory, there's no way to remove previously applied labels without manual intervention. This breaks the declarative model and requires out-of-band operations to clean up obsolete labels/taints.
Supporting removal syntax allows full lifecycle management of node labels through kubespray inventory.
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.