Allow configuration of nodelabels in local_volume_provisioner (#6620)

pull/6759/head
Lukas Grossar 2020-09-17 11:44:58 +02:00 committed by GitHub
parent b6b26c710f
commit a870dd368e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,10 @@ local_path_provisioner_enabled: false
# Local volume provisioner deployment
local_volume_provisioner_enabled: false
# local_volume_provisioner_namespace: kube-system
# local_volume_provisioner_nodelabels:
# - kubernetes.io/hostname
# - topology.kubernetes.io/region
# - topology.kubernetes.io/zone
# local_volume_provisioner_storage_classes:
# local-storage:
# host_dir: /mnt/disks

View File

@ -1,5 +1,10 @@
---
local_volume_provisioner_namespace: "kube-system"
# List of node labels to be copied to the PVs created by the provisioner
local_volume_provisioner_nodelabels: []
# - kubernetes.io/hostname
# - topology.kubernetes.io/region
# - 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_storage_classes: |

View File

@ -16,6 +16,12 @@ metadata:
name: local-volume-provisioner
namespace: {{ local_volume_provisioner_namespace }}
data:
{% if local_volume_provisioner_nodelabels | length > 0 %}
nodeLabelsForPV: |
{% for nodelabel in local_volume_provisioner_nodelabels %}
- {{ nodelabel }}
{% endfor %}
{% endif %}
storageClassMap: |
{% for class_name, storage_class in local_volume_provisioner_storage_classes.items() %}
{{ class_name }}: