Skip to content

Commit f5a4c48

Browse files
committed
remove dedicated options to define RBAC
This offered no real benefit over someone simply having their own rbac.yaml. Adding this as an option to the chart just means we have to continue to support it, and why would we then only support defining custom RBAC and not even other resources? At that point we would become a meta-meta Helm chart and that's just not worth it. On-behalf-of: @SAP [email protected]
1 parent 0b29fd9 commit f5a4c48

File tree

3 files changed

+4
-60
lines changed

3 files changed

+4
-60
lines changed

charts/api-syncagent/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ServiceAccount
33
metadata:
44
name: '{{ template "name" . }}'
55
labels:
6-
app.kubernetes.io/name: kcp-sync-agent
6+
app.kubernetes.io/name: kcp-api-syncagent
77
app.kubernetes.io/instance: '{{ template "agentname" . }}'
88

99
---
@@ -15,12 +15,12 @@ spec:
1515
replicas: {{ .Values.replicas | default 1 }}
1616
selector:
1717
matchLabels:
18-
app.kubernetes.io/name: kcp-sync-agent
18+
app.kubernetes.io/name: kcp-api-syncagent
1919
app.kubernetes.io/instance: '{{ template "agentname" . }}'
2020
template:
2121
metadata:
2222
labels:
23-
app.kubernetes.io/name: kcp-sync-agent
23+
app.kubernetes.io/name: kcp-api-syncagent
2424
app.kubernetes.io/instance: '{{ template "agentname" . }}'
2525
app.kubernetes.io/version: '{{ .Values.image.tag | default .Chart.AppVersion }}'
2626
spec:
Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{{- if .Values.rbac.create }}
2-
---
31
apiVersion: rbac.authorization.k8s.io/v1
42
kind: Role
53
metadata:
@@ -42,8 +40,7 @@ subjects:
4240
apiVersion: rbac.authorization.k8s.io/v1
4341
kind: ClusterRole
4442
metadata:
45-
name: '{{ template "name" . }}:{{ .Release.Namespace }}:services'
46-
namespace: kdp
43+
name: '{{ template "name" . }}:{{ .Release.Namespace }}'
4744
rules:
4845
- apiGroups:
4946
- ""
@@ -55,55 +52,12 @@ rules:
5552
- watch
5653
- create
5754
- update
58-
- apiGroups:
59-
- services.syncagent.kcp.io
60-
resources:
61-
- publishedresources
62-
verbs:
63-
- get
64-
- list
65-
- watch
66-
- apiGroups:
67-
- services.syncagent.kcp.io
68-
resources:
69-
- publishedresources/status
70-
verbs:
71-
- create
72-
- get
73-
- update
74-
- patch
75-
76-
---
77-
apiVersion: rbac.authorization.k8s.io/v1
78-
kind: ClusterRoleBinding
79-
metadata:
80-
name: '{{ template "name" . }}:{{ .Release.Namespace }}:services'
81-
namespace: kdp
82-
roleRef:
83-
apiGroup: rbac.authorization.k8s.io
84-
kind: ClusterRole
85-
name: '{{ template "name" . }}:{{ .Release.Namespace }}:services'
86-
subjects:
87-
- kind: ServiceAccount
88-
name: '{{ template "name" . }}'
89-
namespace: '{{ .Release.Namespace }}'
90-
{{- end }}
91-
92-
{{ if .Values.rbac.createClusterRole }}
93-
---
94-
apiVersion: rbac.authorization.k8s.io/v1
95-
kind: ClusterRole
96-
metadata:
97-
name: '{{ template "name" . }}:{{ .Release.Namespace }}'
98-
namespace: kdp
99-
rules: {{ .Values.rbac.rules | toYaml | nindent 2 }}
10055

10156
---
10257
apiVersion: rbac.authorization.k8s.io/v1
10358
kind: ClusterRoleBinding
10459
metadata:
10560
name: '{{ template "name" . }}:{{ .Release.Namespace }}'
106-
namespace: kdp
10761
roleRef:
10862
apiGroup: rbac.authorization.k8s.io
10963
kind: ClusterRole
@@ -112,4 +66,3 @@ subjects:
11266
- kind: ServiceAccount
11367
name: '{{ template "name" . }}'
11468
namespace: '{{ .Release.Namespace }}'
115-
{{ end }}

charts/api-syncagent/values.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ image:
2929

3030
replicas: 2
3131

32-
rbac:
33-
# When set to false, no RBAC will be created.
34-
create: true
35-
# When set to true, will create a ClusterRole named "<releasename>:<namespace>"
36-
# and assign it the configured rules; use this to provide additional permissions
37-
# for the Sync Agent.
38-
createClusterRole: false
39-
rules: []
40-
4132
resources:
4233
requests:
4334
cpu: 100m

0 commit comments

Comments
 (0)