Skip to content

Commit b0af546

Browse files
Merge pull request #398 from SgtCoDFish/leasens
Tweak roles to fix permission errors
2 parents 824884f + 44e8671 commit b0af546

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

deploy/charts/istio-csr/templates/role.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,3 @@ rules:
2626
verbs: ["get", "list", "watch"]
2727
resourceNames: [{{ . | quote }}]
2828
{{- end }}
29-
{{- if eq (toString .Values.app.tls.istiodCertificateEnable) "dynamic" }}
30-
- apiGroups:
31-
- "cert-manager.io"
32-
resources:
33-
- "certificates"
34-
verbs:
35-
- "get"
36-
- "create"
37-
- "update"
38-
- "delete"
39-
- "watch"
40-
- "list"
41-
{{- end }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if eq (toString .Values.app.tls.istiodCertificateEnable) "dynamic" }}
2+
kind: Role
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
labels:
6+
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
7+
name: {{ include "cert-manager-istio-csr.name" . }}-dynamic-istiod
8+
namespace: {{ .Values.app.istio.namespace }}
9+
rules:
10+
- apiGroups:
11+
- "cert-manager.io"
12+
resources:
13+
- "certificates"
14+
verbs:
15+
- "get"
16+
- "create"
17+
- "update"
18+
- "delete"
19+
- "watch"
20+
- "list"
21+
{{- end }}
22+

deploy/charts/istio-csr/templates/role_leases.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ rules:
1616
- "update"
1717
- "watch"
1818
- "list"
19-
19+
- apiGroups: [""]
20+
resources: ["events"]
21+
verbs: ["create"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
kind: RoleBinding
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
metadata:
4+
name: {{ include "cert-manager-istio-csr.name" . }}-dynamic-istiod
5+
namespace: {{ .Values.app.istio.namespace }}
6+
labels:
7+
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
8+
roleRef:
9+
apiGroup: rbac.authorization.k8s.io
10+
kind: Role
11+
name: {{ include "cert-manager-istio-csr.name" . }}-dynamic-istiod
12+
subjects:
13+
- kind: ServiceAccount
14+
name: {{ include "cert-manager-istio-csr.name" . }}
15+
namespace: {{ .Release.Namespace }}
16+

0 commit comments

Comments
 (0)