From a2ce911a18482f86efaa51718af4524972eb55c1 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Tue, 30 Jan 2024 17:32:52 -0500 Subject: [PATCH] fix(talos): do not render worker config when no workers Signed-off-by: Devin Buhl --- .../templates/kubernetes/talos/talconfig.yaml.j2 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 b/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 index 5fc240a1..5354cf09 100644 --- a/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 +++ b/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 @@ -13,7 +13,7 @@ clusterSvcNets: - "{{ cluster.service_network.split(',')[0] }}" additionalApiServerCertSans: &sans - "{{ cluster.endpoint_vip }}" - - 127.0.0.1 + - 127.0.0.1 # KubePrism {% for item in cluster.tls_sans %} - "{{ item }}" {% endfor %} @@ -31,11 +31,7 @@ nodes: installDiskSelector: serial: "{{ item.talos_disk_device }}" {% endif %} - {% if item.controller %} - controlPlane: true - {% else %} - controlPlane: false - {% endif %} + controlPlane: {{ (item.controller) | string | lower }} networkInterfaces: - interface: eth0 dhcp: false @@ -49,9 +45,6 @@ nodes: vip: ip: "{{ cluster.endpoint_vip }}" {% endif %} - {% if item.talos_node_config %} - {{ item.talos_node_config | indent(4, false) }} - {% endif %} {% endfor %} controlPlane: @@ -173,6 +166,7 @@ controlPlane: allowedKubernetesNamespaces: - system-upgrade +{% if cluster.nodes.inventory | selectattr('controller', 'equalto', False) | list | length %} worker: {% if cluster.nodes.talos.schematics.enabled %} schematic: @@ -188,3 +182,4 @@ worker: - *nameserverPatch - *ntpPatch - *sysctlPatch +{% endif %}