Skip to content

Commit 342c8f9

Browse files
committed
adding in service-account.yaml.tpl to get away from using the default service account in favor of a service specific service account
Signed-off-by: Adam D. Cornett <adc@redhat.com>
1 parent 1338d18 commit 342c8f9

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

pkg/generate/ack/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var (
3535
"config/rbac/cluster-role-binding.yaml.tpl",
3636
"config/rbac/role-reader.yaml.tpl",
3737
"config/rbac/role-writer.yaml.tpl",
38+
"config/rbac/service-account.yaml.tpl",
3839
"config/rbac/kustomization.yaml.tpl",
3940
"config/crd/kustomization.yaml.tpl",
4041
"config/overlays/namespaced/kustomization.yaml.tpl",

templates/config/controller/deployment.yaml.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ spec:
6161
drop:
6262
- ALL
6363
terminationGracePeriodSeconds: 10
64+
serviceAccountName: ack-{{ .ServicePackageName }}-service-account
6465
hostIPC: false
6566
hostNetwork: false
6667
hostPID: false

templates/config/rbac/cluster-role-binding.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ roleRef:
88
name: ack-{{ .ServicePackageName }}-controller
99
subjects:
1010
- kind: ServiceAccount
11-
name: default
11+
name: ack-{{ .ServicePackageName }}-service-account
1212
namespace: ack-system

templates/config/rbac/kustomization.yaml.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ resources:
33
- cluster-role-controller.yaml
44
- role-reader.yaml
55
- role-writer.yaml
6+
- service-account.yaml
7+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: ack-{{ .ServicePackageName }}-service-account
6+
namespace: ack-system

0 commit comments

Comments
 (0)