Skip to content

Commit

Permalink
feat(rbac): use real ServiceAccount instead of default
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau committed May 7, 2024
1 parent 22b3a28 commit 7b21533
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ spec:
labels:
control-plane: controller-manager
spec:
serviceAccountName: manager
automountServiceAccountToken: true
containers:
- command:
- /manager
Expand Down
1 change: 1 addition & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ resources:
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
- service_account.yaml
2 changes: 1 addition & 1 deletion config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ roleRef:
name: leader-election-role
subjects:
- kind: ServiceAccount
name: default
name: manager
namespace: system
2 changes: 1 addition & 1 deletion config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ roleRef:
name: manager-role
subjects:
- kind: ServiceAccount
name: default
name: manager
namespace: system
5 changes: 5 additions & 0 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: manager
namespace: system
2 changes: 2 additions & 0 deletions hack/charts/cluster-api-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: capi-operator-manager
automountServiceAccountToken: true
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
Expand Down

0 comments on commit 7b21533

Please sign in to comment.