Marko Oldenburg e4c7b319e2
All checks were successful
Build Helm Chart / helm-package (push) Successful in 7s
first commit
2025-03-04 07:05:50 +01:00

57 lines
1007 B
YAML

{{- if .Values.clustered }}
{{- $service_account := tpl .Values.templates.service_account . }}
{{- $role := tpl .Values.templates.k8s_role . }}
{{- $rolebinding := tpl .Values.templates.k8s_rolebinding . }}
{{- with $app := .Values.application.name }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $service_account }}
labels:
app: {{ $app }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $role }}
labels:
app: {{ $app }}
rules:
- apiGroups:
- ""
resources:
- endpoints
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $rolebinding }}
labels:
app: {{ $app }}
subjects:
- kind: ServiceAccount
name: {{ $service_account }}
roleRef:
kind: Role
name: {{ $role }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end }}