mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 08:37:56 +02:00
33 lines
754 B
YAML
33 lines
754 B
YAML
{{- 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 }} |