Ceph provisioners: Make configmap and job names configurable

This is to make sure configmap and job names will not get conflict
if we are trying to activate any nameapce for two diffrent
ceph cluster's client keys

Change-Id: I8360f642a6d25f2af0d7aaea686adefef838821a
This commit is contained in:
Chinasubbareddy M 2018-09-04 12:44:35 -05:00
parent d119744c6e
commit 7c4e2ef8bc
10 changed files with 15 additions and 14 deletions

View File

@ -20,7 +20,7 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: ceph-provisioners-bin-clients name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin-clients" | quote }}
data: data:
provisioner-rbd-namespace-client-key-manager.sh: | provisioner-rbd-namespace-client-key-manager.sh: |
{{ tuple "bin/provisioner/rbd/_namespace-client-key-manager.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/provisioner/rbd/_namespace-client-key-manager.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}

View File

@ -20,7 +20,7 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: ceph-provisioners-bin name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin" | quote }}
data: data:
{{- if .Values.images.local_registry.active }} {{- if .Values.images.local_registry.active }}
image-repo-sync.sh: | image-repo-sync.sh: |

View File

@ -52,5 +52,5 @@ data:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.manifests.configmap_etc }} {{- if .Values.manifests.configmap_etc }}
{{- list "ceph-etc" . | include "ceph.configmap.etc" }} {{- list .Values.storageclass.rbd.ceph_configmap_name . | include "ceph.configmap.etc" }}
{{- end }} {{- end }}

View File

@ -173,6 +173,6 @@ spec:
volumes: volumes:
- name: ceph-provisioners-bin - name: ceph-provisioners-bin
configMap: configMap:
name: ceph-provisioners-bin name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin" | quote }}
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -163,6 +163,6 @@ spec:
volumes: volumes:
- name: ceph-provisioners-bin - name: ceph-provisioners-bin
configMap: configMap:
name: ceph-provisioners-bin name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin" | quote }}
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -58,11 +58,11 @@ spec:
volumes: volumes:
- name: ceph-provisioners-bin - name: ceph-provisioners-bin
configMap: configMap:
name: ceph-provisioners-bin name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin" | quote }}
defaultMode: 0555 defaultMode: 0555
- name: ceph-etc - name: ceph-etc
configMap: configMap:
name: ceph-etc name: {{ .Values.storageclass.rbd.ceph_configmap_name }}
defaultMode: 0444 defaultMode: 0444
- name: ceph-client-admin-keyring - name: ceph-client-admin-keyring
secret: secret:

View File

@ -119,6 +119,6 @@ spec:
volumes: volumes:
- name: ceph-provisioners-bin - name: ceph-provisioners-bin
configMap: configMap:
name: ceph-provisioners-bin name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin" | quote }}
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -19,7 +19,7 @@ limitations under the License.
{{- $randStringSuffix := randAlphaNum 5 | lower }} {{- $randStringSuffix := randAlphaNum 5 | lower }}
{{- $serviceAccountName := print "ceph-namespace-client-key-cleaner-" $randStringSuffix }} {{- $serviceAccountName := print $envAll.Release.Name "-ceph-ns-key-cleaner" }}
{{ tuple $envAll "namespace_client_key_cleaner" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "namespace_client_key_cleaner" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
@ -52,7 +52,7 @@ subjects:
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
name: ceph-namespace-client-key-cleaner-{{ $randStringSuffix }} name: {{ $serviceAccountName }}
annotations: annotations:
"helm.sh/hook": pre-delete "helm.sh/hook": pre-delete
spec: spec:
@ -88,6 +88,6 @@ spec:
volumes: volumes:
- name: ceph-provisioners-bin-clients - name: ceph-provisioners-bin-clients
configMap: configMap:
name: ceph-provisioners-bin-clients name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin-clients" | quote }}
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -19,7 +19,7 @@ limitations under the License.
{{- $randStringSuffix := randAlphaNum 5 | lower }} {{- $randStringSuffix := randAlphaNum 5 | lower }}
{{- $serviceAccountName := "ceph-namespace-client-key-generator" }} {{- $serviceAccountName := print $envAll.Release.Name "-ceph-ns-key-generator" }}
{{ tuple $envAll "namespace_client_key_generator" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "namespace_client_key_generator" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
@ -81,7 +81,7 @@ subjects:
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
name: ceph-namespace-client-key-generator name: {{ $serviceAccountName }}
spec: spec:
template: template:
metadata: metadata:
@ -119,6 +119,6 @@ spec:
volumes: volumes:
- name: ceph-provisioners-bin-clients - name: ceph-provisioners-bin-clients
configMap: configMap:
name: ceph-provisioners-bin-clients name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin-clients" | quote }}
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -176,6 +176,7 @@ storageclass:
monitors: null monitors: null
pool: rbd pool: rbd
admin_id: admin admin_id: admin
ceph_configmap_name: ceph-etc
admin_secret_name: pvc-ceph-conf-combined-storageclass admin_secret_name: pvc-ceph-conf-combined-storageclass
admin_secret_namespace: ceph admin_secret_namespace: ceph
user_id: admin user_id: admin