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
kind: ConfigMap
metadata:
name: ceph-provisioners-bin-clients
name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin-clients" | quote }}
data:
provisioner-rbd-namespace-client-key-manager.sh: |
{{ 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
kind: ConfigMap
metadata:
name: ceph-provisioners-bin
name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin" | quote }}
data:
{{- if .Values.images.local_registry.active }}
image-repo-sync.sh: |

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ limitations under the License.
{{- $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" }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
@ -52,7 +52,7 @@ subjects:
apiVersion: batch/v1
kind: Job
metadata:
name: ceph-namespace-client-key-cleaner-{{ $randStringSuffix }}
name: {{ $serviceAccountName }}
annotations:
"helm.sh/hook": pre-delete
spec:
@ -88,6 +88,6 @@ spec:
volumes:
- name: ceph-provisioners-bin-clients
configMap:
name: ceph-provisioners-bin-clients
name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin-clients" | quote }}
defaultMode: 0555
{{- end }}

View File

@ -19,7 +19,7 @@ limitations under the License.
{{- $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" }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
@ -81,7 +81,7 @@ subjects:
apiVersion: batch/v1
kind: Job
metadata:
name: ceph-namespace-client-key-generator
name: {{ $serviceAccountName }}
spec:
template:
metadata:
@ -119,6 +119,6 @@ spec:
volumes:
- name: ceph-provisioners-bin-clients
configMap:
name: ceph-provisioners-bin-clients
name: {{ printf "%s-%s" $envAll.Release.Name "ceph-prov-bin-clients" | quote }}
defaultMode: 0555
{{- end }}

View File

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