summaryrefslogtreecommitdiffstats
path: root/deploy/example-webhook/templates
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/example-webhook/templates')
-rw-r--r--deploy/example-webhook/templates/rbac.yaml26
1 files changed, 26 insertions, 0 deletions
diff --git a/deploy/example-webhook/templates/rbac.yaml b/deploy/example-webhook/templates/rbac.yaml
index 605fcf5..f952fd1 100644
--- a/deploy/example-webhook/templates/rbac.yaml
+++ b/deploy/example-webhook/templates/rbac.yaml
@@ -89,3 +89,29 @@ subjects:
kind: ServiceAccount
name: {{ .Values.certManager.serviceAccountName }}
namespace: {{ .Values.certManager.namespace }}
+---
+# Allow reading only the configured Hostinger token Secret.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: {{ include "example-webhook.fullname" . }}:hostinger-token
+ namespace: {{ .Values.certManager.namespace }}
+rules:
+ - apiGroups: [""]
+ resources: ["secrets"]
+ resourceNames: [{{ .Values.apiKeySecretName | quote }}]
+ verbs: ["get"]
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: {{ include "example-webhook.fullname" . }}:hostinger-token
+ namespace: {{ .Values.certManager.namespace }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: {{ include "example-webhook.fullname" . }}:hostinger-token
+subjects:
+ - kind: ServiceAccount
+ name: {{ include "example-webhook.fullname" . }}
+ namespace: {{ .Release.Namespace }}