Browse Source

[fix] etcd backup support for multiple releases

- Name the resoruces for etcd backup so that the chart
  can be deployed into multiple releases.

Change-Id: I8a9f82d556eb61d01bdb08ca4e17ed064ff47190
changes/56/642856/2
Scott Hussey 2 months ago
parent
commit
8f43897fe2
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      charts/etcd/templates/cron-job-etcd-backup.yaml

+ 7
- 7
charts/etcd/templates/cron-job-etcd-backup.yaml View File

@@ -21,7 +21,7 @@ limitations under the License.
21 21
 apiVersion: rbac.authorization.k8s.io/v1beta1
22 22
 kind: Role
23 23
 metadata:
24
-  name: {{ $serviceAccountName }}
24
+  name: {{ .Values.service.name }}-{{ $serviceAccountName }}
25 25
 rules:
26 26
   - apiGroups:
27 27
       - ""
@@ -36,26 +36,26 @@ kind: ServiceAccount
36 36
 metadata:
37 37
   labels:
38 38
     component: etcd-backup
39
-  name: {{ $serviceAccountName }}
39
+  name: {{ .Values.service.name }}-{{ $serviceAccountName }}
40 40
   namespace: {{ $envAll.Release.Namespace }}
41 41
 ---
42 42
 apiVersion: rbac.authorization.k8s.io/v1beta1
43 43
 kind: RoleBinding
44 44
 metadata:
45
-  name: {{ $serviceAccountName }}
45
+  name: {{ .Values.service.name }}-{{ $serviceAccountName }}
46 46
 roleRef:
47 47
   apiGroup: rbac.authorization.k8s.io
48 48
   kind: Role
49
-  name: {{ $serviceAccountName }}
49
+  name: {{ .Values.service.name }}-{{ $serviceAccountName }}
50 50
 subjects:
51 51
   - kind: ServiceAccount
52
-    name: {{ $serviceAccountName }}
52
+    name: {{ .Values.service.name }}-{{ $serviceAccountName }}
53 53
     namespace: {{ $envAll.Release.Namespace }}
54 54
 ---
55 55
 apiVersion: batch/v1beta1
56 56
 kind: CronJob
57 57
 metadata:
58
-  name: etcd-backup
58
+  name: {{ .Values.service.name }}-etcd-backup
59 59
 spec:
60 60
   schedule: {{ .Values.jobs.etcd_backup.cron | quote }}
61 61
   successfulJobsHistoryLimit: {{ .Values.jobs.etcd_backup.history.success }}
@@ -68,7 +68,7 @@ spec:
68 68
     spec:
69 69
       template:
70 70
         spec:
71
-          serviceAccountName: {{ $serviceAccountName }}
71
+          serviceAccountName: {{ .Values.service.name }}-{{ $serviceAccountName }}
72 72
           restartPolicy: OnFailure
73 73
           nodeSelector:
74 74
             {{ .Values.labels.anchor.node_selector_key }}: {{ .Values.labels.anchor.node_selector_value }}

Loading…
Cancel
Save