Skip to content

Commit b02a4e4

Browse files
authored
CORE-18638 Add permission for ingress controller to read IngressClass (#5268)
1 parent bd727f2 commit b02a4e4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

charts/corda-lib/templates/_nginx.tpl

+38
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
{{- printf "%s-nginx" . }}
33
{{- end }}
44

5+
{{- define "corda.nginxClusterUniqueName" -}}
6+
{{- $workerName := index . 1 }}
7+
{{- with ( index . 0 ) }}
8+
{{- printf "%s-%s" .Release.Namespace ( include "corda.nginxName" $workerName ) }}
9+
{{- end }}
10+
{{- end }}
11+
512
{{- define "corda.nginxComponent" -}}
613
{{ printf "%s-nginx" . }}
714
{{- end }}
@@ -56,6 +63,37 @@ data:
5663
allow-snippet-annotations: "false"
5764
---
5865
apiVersion: rbac.authorization.k8s.io/v1
66+
kind: ClusterRole
67+
metadata:
68+
labels:
69+
{{- include "corda.nginxLabels" ( list . $workerName ) | nindent 4 }}
70+
name: {{ include "corda.nginxClusterUniqueName" ( list . $workerName ) | quote }}
71+
rules:
72+
- apiGroups:
73+
- networking.k8s.io
74+
resources:
75+
- ingressclasses
76+
verbs:
77+
- get
78+
- list
79+
- watch
80+
---
81+
apiVersion: rbac.authorization.k8s.io/v1
82+
kind: ClusterRoleBinding
83+
metadata:
84+
labels:
85+
{{- include "corda.nginxLabels" ( list . $workerName ) | nindent 4 }}
86+
name: {{ include "corda.nginxClusterUniqueName" ( list . $workerName ) | quote }}
87+
roleRef:
88+
apiGroup: rbac.authorization.k8s.io
89+
kind: ClusterRole
90+
name: {{ include "corda.nginxClusterUniqueName" ( list . $workerName ) | quote }}
91+
subjects:
92+
- kind: ServiceAccount
93+
name: {{ include "corda.nginxName" $workerName | quote }}
94+
namespace: {{ .Release.Namespace | quote }}
95+
---
96+
apiVersion: rbac.authorization.k8s.io/v1
5997
kind: Role
6098
metadata:
6199
labels:

0 commit comments

Comments
 (0)