Skip to content

Commit 84693fe

Browse files
committed
Move operator to custom serviceAccount rather than using the namespaces default one
1 parent 921f7a1 commit 84693fe

6 files changed

Lines changed: 24 additions & 3 deletions

File tree

‎operator/templates/manager/manager.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ spec:
1515
labels:
1616
control-plane: securecodebox-controller-manager
1717
spec:
18+
serviceAccountName: {{ .Values.serviceAccount.name }}
19+
# todo(@J12934): this should be configurable, unfortunatly it can't go into the containers security context... :(
20+
securityContext:
21+
fsGroup: 1001
1822
containers:
1923
- command:
2024
- /manager

‎operator/templates/rbac/auth_proxy_role_binding.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ roleRef:
88
name: proxy-role
99
subjects:
1010
- kind: ServiceAccount
11-
name: default
11+
name: {{ .Values.serviceAccount.name }}
1212
namespace: {{ .Release.Namespace }}
1313

‎operator/templates/rbac/leader_election_role_binding.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ roleRef:
88
name: leader-election-role
99
subjects:
1010
- kind: ServiceAccount
11-
name: default
11+
name: {{ .Values.serviceAccount.name }}
1212
namespace: {{ .Release.Namespace }}

‎operator/templates/rbac/role_binding.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ roleRef:
88
name: manager-role
99
subjects:
1010
- kind: ServiceAccount
11-
name: default
11+
name: {{ .Values.serviceAccount.name }}
1212
namespace: {{ .Release.Namespace }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{ .Values.serviceAccount.name }}
5+
annotations:
6+
{{ .Values.serviceAccount.annotations | toYaml | indent 4}}
7+
labels:
8+
{{ .Values.serviceAccount.labels | toYaml | indent 4 }}

‎operator/values.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ image:
1414
# image.pullPolicy -- Image pull policy
1515
pullPolicy: Always
1616

17+
18+
serviceAccount:
19+
# -- Name of the serviceAccount the operator uses to talk to the k8s api
20+
name: securecodebox-operator
21+
# -- Annotations of the serviceAccount the operator uses to talk to the k8s api
22+
annotations: {}
23+
# -- Labels of the serviceAccount the operator uses to talk to the k8s api
24+
labels: {}
25+
1726
securityContext:
1827
# securityContext.runAsNonRoot -- Enforces that the Operator image is run as a non root user
1928
runAsNonRoot: true

0 commit comments

Comments
 (0)