From 20b12751af046fb797f6e1f33cc90c7dcaa2522b Mon Sep 17 00:00:00 2001 From: Xavi Date: Thu, 4 Apr 2019 11:36:50 +0200 Subject: [PATCH] add Cinder allowVolumeExpansion option (#4415) --- .../openstack/templates/openstack-storage-class.yml.j2 | 1 + roles/kubernetes/master/defaults/main/main.yml | 1 + roles/kubespray-defaults/defaults/main.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/roles/kubernetes-apps/persistent_volumes/openstack/templates/openstack-storage-class.yml.j2 b/roles/kubernetes-apps/persistent_volumes/openstack/templates/openstack-storage-class.yml.j2 index 629c1f0a3..0551e1535 100644 --- a/roles/kubernetes-apps/persistent_volumes/openstack/templates/openstack-storage-class.yml.j2 +++ b/roles/kubernetes-apps/persistent_volumes/openstack/templates/openstack-storage-class.yml.j2 @@ -11,4 +11,5 @@ parameters: {% for key, value in (class.parameters | default({})).items() %} "{{ key }}": "{{ value }}" {% endfor %} +allowVolumeExpansion: {{ expand_persistent_volumes }} {% endfor %} diff --git a/roles/kubernetes/master/defaults/main/main.yml b/roles/kubernetes/master/defaults/main/main.yml index e2342217b..3fb9c5582 100644 --- a/roles/kubernetes/master/defaults/main/main.yml +++ b/roles/kubernetes/master/defaults/main/main.yml @@ -83,6 +83,7 @@ kube_apiserver_admission_control: - LimitRanger - ServiceAccount - DefaultStorageClass + - PersistentVolumeClaimResize - >- {%- if kube_version is version('v1.9', '<') -%} GenericAdmissionWebhook diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 22ec23557..532220288 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -277,6 +277,7 @@ persistent_volumes_enabled: false cephfs_provisioner_enabled: false ingress_nginx_enabled: false cert_manager_enabled: false +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)"