@@ -40,39 +40,30 @@ metadata:
40
40
name : burrito-runner
41
41
namespace : {{ $tenant.namespace.name }}
42
42
---
43
- {{- range $serviceAccount := .serviceAccounts }}
44
- apiVersion : v1
45
- kind : ServiceAccount
46
- metadata :
47
- name : {{ $serviceAccount.name }}
48
- labels :
49
- {{- toYaml $serviceAccount.labels | nindent 4 }}
50
- annotations :
51
- {{- toYaml $serviceAccount.annotations | nindent 4 }}
52
- namespace : {{ $tenant.namespace.name }}
53
- ---
43
+ # Role binding for the default service account
54
44
apiVersion : rbac.authorization.k8s.io/v1
55
45
kind : RoleBinding
56
46
metadata :
57
- name : {{ $serviceAccount.name }}-burrito-runner
58
- labels :
59
- {{- toYaml $serviceAccount.labels | nindent 4 }}
47
+ name : burrito-runner
60
48
namespace : {{ $tenant.namespace.name }}
61
49
roleRef :
62
50
apiGroup : rbac.authorization.k8s.io
63
51
kind : ClusterRole
64
52
name : burrito-runner
65
53
subjects :
66
54
- kind : ServiceAccount
67
- name : {{ $serviceAccount.name }}
55
+ name : burrito-runner
68
56
namespace : {{ $tenant.namespace.name }}
69
57
---
58
+ # Role and RoleBinding for burrito-server to access this tenant's secrets (webhook secret)
70
59
apiVersion : rbac.authorization.k8s.io/v1
71
60
kind : Role
72
61
metadata :
73
62
name : secret-access
74
63
labels :
75
- app : burrito
64
+ {{- toYaml $metadataControllers.labels | nindent 4 }}
65
+ annotations :
66
+ {{- toYaml $metadataControllers.annotations | nindent 4 }}
76
67
namespace : {{ $tenant.namespace.name }}
77
68
rules :
78
69
- apiGroups : [""]
@@ -84,7 +75,9 @@ kind: RoleBinding
84
75
metadata :
85
76
name : burrito-server-secret-access
86
77
labels :
87
- app : burrito
78
+ {{- toYaml $metadataControllers.labels | nindent 4 }}
79
+ annotations :
80
+ {{- toYaml $metadataControllers.annotations | nindent 4 }}
88
81
namespace : {{ $tenant.namespace.name }}
89
82
roleRef :
90
83
apiGroup : rbac.authorization.k8s.io
@@ -95,6 +88,33 @@ subjects:
95
88
name : burrito-server
96
89
namespace : {{ $.Release.Namespace }}
97
90
---
91
+ {{- range $serviceAccount := .serviceAccounts }}
92
+ apiVersion : v1
93
+ kind : ServiceAccount
94
+ metadata :
95
+ name : {{ $serviceAccount.name }}
96
+ labels :
97
+ {{- toYaml $serviceAccount.labels | nindent 4 }}
98
+ annotations :
99
+ {{- toYaml $serviceAccount.annotations | nindent 4 }}
100
+ namespace : {{ $tenant.namespace.name }}
101
+ ---
102
+ apiVersion : rbac.authorization.k8s.io/v1
103
+ kind : RoleBinding
104
+ metadata :
105
+ name : {{ $serviceAccount.name }}-burrito-runner
106
+ labels :
107
+ {{- toYaml $serviceAccount.labels | nindent 4 }}
108
+ namespace : {{ $tenant.namespace.name }}
109
+ roleRef :
110
+ apiGroup : rbac.authorization.k8s.io
111
+ kind : ClusterRole
112
+ name : burrito-runner
113
+ subjects :
114
+ - kind : ServiceAccount
115
+ name : {{ $serviceAccount.name }}
116
+ namespace : {{ $tenant.namespace.name }}
117
+ ---
98
118
{{- range $additionalRoleBinding := $serviceAccount.additionalRoleBindings }}
99
119
apiVersion : rbac.authorization.k8s.io/v1
100
120
kind : RoleBinding
0 commit comments