mirror of
https://github.com/bitnami/charts.git
synced 2026-03-14 14:57:22 +08:00
69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
{{- if and .Values.rbac.create .Values.controller.rbac.create -}}
|
|
---
|
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: {{ include "common.names.fullname" . }}-controller
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
app.kubernetes.io/component: controller
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
rules:
|
|
- apiGroups:
|
|
- ''
|
|
resources:
|
|
- services
|
|
verbs:
|
|
- get
|
|
- list
|
|
- watch
|
|
- update
|
|
- apiGroups:
|
|
- ''
|
|
resources:
|
|
- services/status
|
|
verbs:
|
|
- update
|
|
- apiGroups:
|
|
- ''
|
|
resources:
|
|
- events
|
|
verbs:
|
|
- create
|
|
- patch
|
|
- apiGroups:
|
|
- policy
|
|
resourceNames:
|
|
- {{ include "common.names.fullname" . }}-controller
|
|
resources:
|
|
- podsecuritypolicies
|
|
verbs:
|
|
- use
|
|
---
|
|
## Role bindings
|
|
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: {{ include "common.names.fullname" . }}-controller
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
app.kubernetes.io/component: controller
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: {{ include "metallb.controllerServiceAccountName" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: {{ include "common.names.fullname" . }}-controller
|
|
{{- end -}}
|