Skip to content

Commit b824b58

Browse files
authored
fixes and enhancements to chart (#370)
* updated cluster chart to allow for multiple instances Signed-off-by: Henry Li <[email protected]> * added cpfs scoped imagePullPrefix for dev testing Signed-off-by: Henry Li <[email protected]> * added generic label configuration to helm templates Signed-off-by: Henry Li <[email protected]> --------- Signed-off-by: Henry Li <[email protected]>
1 parent 445c881 commit b824b58

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

helm-cluster-scoped/templates/01-cluster-rbac.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kind: ClusterRole
22
apiVersion: rbac.authorization.k8s.io/v1
33
metadata:
4-
name: ibm-namespace-scope-operator
4+
name: ibm-namespace-scope-operator-{{ .Values.global.operatorNamespace }}
55
labels:
66
component-id: {{ .Chart.Name }}
77
rules:
@@ -29,7 +29,7 @@ rules:
2929
kind: ClusterRoleBinding
3030
apiVersion: rbac.authorization.k8s.io/v1
3131
metadata:
32-
name: ibm-namespace-scope-operator
32+
name: ibm-namespace-scope-operator-{{ .Values.global.operatorNamespace }}
3333
labels:
3434
component-id: {{ .Chart.Name }}
3535
subjects:
@@ -39,4 +39,4 @@ subjects:
3939
roleRef:
4040
apiGroup: rbac.authorization.k8s.io
4141
kind: ClusterRole
42-
name: ibm-namespace-scope-operator
42+
name: ibm-namespace-scope-operator-{{ .Values.global.operatorNamespace }}

helm-cluster-scoped/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ cpfs:
44
imageRegistryNamespaceOperator: cpopen
55
imageRegistryNamespaceOperand: cpopen/cpfs
66

7-
# operatorNamespace: ""
7+
global:
8+
operatorNamespace: operators

helm/templates/00-rbac.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{{- if .Values.global.instanceNamespace }}
77
{{- $namespaces = append $namespaces .Values.global.instanceNamespace }}
88
{{- end }}
9+
{{- $labels := .Values.cpfs.labels }}
910
{{- range $i := $namespaces }}
1011
kind: Role
1112
apiVersion: rbac.authorization.k8s.io/v1
@@ -14,6 +15,9 @@ metadata:
1415
namespace: {{ $i }}
1516
labels:
1617
component-id: {{ $chartName }}
18+
{{- with $labels }}
19+
{{- toYaml . | nindent 4 }}
20+
{{- end }}
1721
rules:
1822
- verbs:
1923
- create
@@ -94,6 +98,9 @@ metadata:
9498
namespace: {{ $i }}
9599
labels:
96100
component-id: {{ $chartName }}
101+
{{- with $labels }}
102+
{{- toYaml . | nindent 4 }}
103+
{{- end }}
97104
subjects:
98105
- kind: ServiceAccount
99106
name: ibm-namespace-scope-operator
@@ -112,5 +119,8 @@ metadata:
112119
app.kubernetes.io/managed-by: ibm-namespace-scope-operator
113120
app.kubernetes.io/name: ibm-namespace-scope-operator
114121
component-id: {{ .Chart.Name }}
122+
{{- with .Values.cpfs.labels }}
123+
{{- toYaml . | nindent 4 }}
124+
{{- end }}
115125
name: ibm-namespace-scope-operator
116126
namespace: {{ .Values.global.operatorNamespace }}

helm/templates/01-operator-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ metadata:
99
app.kubernetes.io/name: ibm-namespace-scope-operator
1010
productName: IBM_Cloud_Platform_Common_Services
1111
component-id: {{ .Chart.Name }}
12+
{{- with .Values.cpfs.labels }}
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
1215
spec:
1316
replicas: 1
1417
selector:
@@ -105,7 +108,7 @@ spec:
105108
type: RuntimeDefault
106109
imagePullPolicy: IfNotPresent
107110
terminationMessagePolicy: File
108-
image: {{ .Values.global.imagePullPrefix }}/{{ .Values.cpfs.imageRegistryNamespaceOperator }}/ibm-namespace-scope-operator:4.2.12
111+
image: {{ .Values.cpfs.imagePullPrefix | default .Values.global.imagePullPrefix }}/{{ .Values.cpfs.imageRegistryNamespaceOperator }}/ibm-namespace-scope-operator:4.2.12
109112
serviceAccount: ibm-namespace-scope-operator
110113
dnsPolicy: ClusterFirst
111114
strategy:

helm/templates/02-nss-cr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ metadata:
44
labels:
55
foundationservices.cloudpak.ibm.com: nss
66
component-id: {{ .Chart.Name }}
7+
{{- with .Values.cpfs.labels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
710
name: common-service
811
namespace: {{ .Values.global.operatorNamespace }}
912
spec:

helm/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ global:
88
cpfs:
99
imageRegistryNamespaceOperator: cpopen
1010
imageRegistryNamespaceOperand: cpopen/cpfs
11+
labels:

0 commit comments

Comments
 (0)