From 0c1a0ab9660f5d2344945d4ed4ec47fd543fed08 Mon Sep 17 00:00:00 2001
From: Hugo Blom <bl0m1@users.noreply.github.com>
Date: Mon, 2 Mar 2020 12:30:43 +0100
Subject: [PATCH] implement max-volumes for cinder csi (#5666)

---
 .../csi_driver/cinder/templates/cinder-csi-cloud-config.j2     | 3 +++
 roles/kubespray-defaults/defaults/main.yaml                    | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2 b/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2
index d7db274a6..c595bb694 100644
--- a/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2
+++ b/roles/kubernetes-apps/csi_driver/cinder/templates/cinder-csi-cloud-config.j2
@@ -22,3 +22,6 @@ ca-file="{{ kube_config_dir }}/cinder-cacert.pem"
 {% if cinder_blockstorage_version is defined %}
 bs-version={{ cinder_blockstorage_version }}
 {% endif %}
+{% if node_volume_attach_limit is defined and node_volume_attach_limit != "" %}
+node-volume-attach-limit="{{ node_volume_attach_limit }}"
+{% endif %}
\ No newline at end of file
diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml
index 7bf7a5ea5..ab0768bf4 100644
--- a/roles/kubespray-defaults/defaults/main.yaml
+++ b/roles/kubespray-defaults/defaults/main.yaml
@@ -308,13 +308,14 @@ expand_persistent_volumes: false
 ## When OpenStack is used, Cinder version can be explicitly specified if autodetection fails (Fixed in 1.9: https://github.com/kubernetes/kubernetes/issues/50461)
 # openstack_blockstorage_version: "v1/v2/auto (default)"
 openstack_blockstorage_ignore_volume_az: "{{ volume_cross_zone_attachment | default('false') }}"
+# set max volumes per node (cinder-csi), default not set
+# node_volume_attach_limit: 25
 # Cinder CSI topology, when false volumes can be cross-mounted between availability zones
 # cinder_topology: false
 # Set Cinder topology zones (can be multiple zones, default not set)
 # cinder_topology_zones:
 #   - nova
 
-
 ## When OpenStack is used, if LBaaSv2 is available you can enable it with the following 2 variables.
 openstack_lbaas_enabled: false
 # openstack_lbaas_subnet_id: "Neutron subnet ID (not network ID) to create LBaaS VIP"
-- 
GitLab