From c2272e38168f6e09e9ef19da4fb0ae8985f316cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Mon, 14 Mar 2022 17:25:30 +0900 Subject: [PATCH] Fixed RBAC issues on 1.23.0 <= --- deploy/freedns-webhook/templates/rbac.yaml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/deploy/freedns-webhook/templates/rbac.yaml b/deploy/freedns-webhook/templates/rbac.yaml index 5ba2e74..cf0650a 100644 --- a/deploy/freedns-webhook/templates/rbac.yaml +++ b/deploy/freedns-webhook/templates/rbac.yaml @@ -88,3 +88,42 @@ subjects: kind: ServiceAccount name: {{ .Values.certManager.serviceAccountName }} namespace: {{ .Values.certManager.namespace }} +--- +# Grant pod account permission to validate using our apiserver +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "freedns-webhook.fullname" . }}:flowcontrol + labels: + app: {{ include "freedns-webhook.name" . }} + chart: {{ include "freedns-webhook.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: + - apiGroups: + - "flowcontrol.apiserver.k8s.io" + resources: + - 'prioritylevelconfigurations' + - 'flowschemas' + verbs: + - 'list' + - 'watch' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "freedns-webhook.fullname" . }}:flowcontrol + labels: + app: {{ include "freedns-webhook.name" . }} + chart: {{ include "freedns-webhook.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "freedns-webhook.fullname" . }}:flowcontrol +subjects: + - apiGroup: "" + kind: ServiceAccount + name: {{ include "freedns-webhook.fullname" . }} + namespace: {{ .Release.Namespace }}