From 3e8e92b51a149b4a1d6544fcb7adf05eefc46507 Mon Sep 17 00:00:00 2001 From: orange-llajeanne <71634751+orange-llajeanne@users.noreply.github.com> Date: Fri, 2 Apr 2021 01:54:11 +0200 Subject: [PATCH] local provisioner 'useNodeNameOnly' option can be configured (#7421) (cherry picked from commit 7e75d48cc4e9b75f3c9c6393574ff2eac56b0b19) --- .../local_volume_provisioner/defaults/main.yml | 1 + .../templates/local-volume-provisioner-cm.yml.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml index fc4a958c1..e5df6dac8 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml @@ -7,6 +7,7 @@ local_volume_provisioner_nodelabels: [] # - topology.kubernetes.io/zone # Levarages Ansibles string to Python datatype casting. Otherwise the dict_key isn't substituted # see https://github.com/ansible/ansible/issues/17324 +local_volume_provisioner_use_node_name_only: false local_volume_provisioner_storage_classes: | { "{{ local_volume_provisioner_storage_class | default('local-storage') }}": { diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-cm.yml.j2 b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-cm.yml.j2 index 21807fe43..76625b6df 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-cm.yml.j2 +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-cm.yml.j2 @@ -21,6 +21,9 @@ data: {% for nodelabel in local_volume_provisioner_nodelabels %} - {{ nodelabel }} {% endfor %} +{% endif %} +{% if local_volume_provisioner_use_node_name_only %} + useNodeNameOnly: "true" {% endif %} storageClassMap: | {% for class_name, storage_class in local_volume_provisioner_storage_classes.items() %}