From 07075add3ddada9b5a39117c5002add279d6d5e7 Mon Sep 17 00:00:00 2001 From: Wong Hoi Sing Edison Date: Fri, 9 Feb 2018 11:59:57 +0800 Subject: [PATCH] Add optional StorageClass name with cephfs_provisioner_storage_class --- inventory/sample/group_vars/k8s-cluster.yml | 1 + roles/kubernetes-apps/cephfs_provisioner/defaults/main.yml | 1 + .../cephfs_provisioner/templates/cephfs-provisioner-sc.yml.j2 | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/inventory/sample/group_vars/k8s-cluster.yml b/inventory/sample/group_vars/k8s-cluster.yml index f2782e1da..61c54b5d1 100644 --- a/inventory/sample/group_vars/k8s-cluster.yml +++ b/inventory/sample/group_vars/k8s-cluster.yml @@ -183,6 +183,7 @@ cephfs_provisioner_enabled: false # - 172.24.0.3:6789 # cephfs_provisioner_admin_id: admin # cephfs_provisioner_secret: secret +# cephfs_provisioner_storage_class: cephfs # Add Persistent Volumes Storage Class for corresponding cloud provider ( OpenStack is only supported now ) persistent_volumes_enabled: false diff --git a/roles/kubernetes-apps/cephfs_provisioner/defaults/main.yml b/roles/kubernetes-apps/cephfs_provisioner/defaults/main.yml index f83edd700..9a3bca1ef 100644 --- a/roles/kubernetes-apps/cephfs_provisioner/defaults/main.yml +++ b/roles/kubernetes-apps/cephfs_provisioner/defaults/main.yml @@ -7,3 +7,4 @@ cephfs_provisioner_cluster: ceph cephfs_provisioner_monitors: [] cephfs_provisioner_admin_id: admin cephfs_provisioner_secret: secret +cephfs_provisioner_storage_class: cephfs diff --git a/roles/kubernetes-apps/cephfs_provisioner/templates/cephfs-provisioner-sc.yml.j2 b/roles/kubernetes-apps/cephfs_provisioner/templates/cephfs-provisioner-sc.yml.j2 index f9e1bc7d3..6ada523cb 100644 --- a/roles/kubernetes-apps/cephfs_provisioner/templates/cephfs-provisioner-sc.yml.j2 +++ b/roles/kubernetes-apps/cephfs_provisioner/templates/cephfs-provisioner-sc.yml.j2 @@ -2,7 +2,7 @@ apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: - name: cephfs + name: {{ cephfs_provisioner_storage_class }} provisioner: ceph.com/cephfs parameters: cluster: {{ cephfs_provisioner_cluster }}