fix(template): Move leader role template to root folder

This commit is contained in:
2024-01-09 21:49:05 +01:00
parent 7efcf8e162
commit 4dc3d72485
2 changed files with 4 additions and 4 deletions
+33
View File
@@ -0,0 +1,33 @@
{{- define "template.leaderRole" -}}
{{- if .Values.leaderElection.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-role
namespace: {{ .Release.Namespace }}
rules:
- verbs:
- watch
resources:
- configmaps
apiGroups:
- ""
{{- end }}
{{- end }}
---
{{- define "template.leaderRoleBinding" -}}
{{- if .Values.leaderElection.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-role-binding
namespace: {{ .Release.Namespace }}
roleRef:
name: {{ include "template.fullname" . }}
apiGroup: rbac.authorization.k8s.io
kind: Role
subjects:
- kind: ServiceAccount
name: {{ include "template.serviceAccountName" . }}
{{- end }}
{{- end }}