add rbac to the helm chart, use temporary backend image

This commit is contained in:
Maarten de Waard 2022-09-29 17:26:47 +02:00
parent 1f95383ab0
commit 67fad68783
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA
7 changed files with 120 additions and 6 deletions

View file

@ -24,6 +24,7 @@ data:
HYDRA_ADMIN_URL: {{ .Values.backend.hydra.adminUrl }}
LOGIN_PANEL_URL: {{ .Values.backend.loginPanelUrl }}
DATABASE_URL: {{ .Values.backend.databaseUrl }}
LOAD_INCLUSTER_CONFIG: "true"
# {{- if .Values.backend.smtp.enabled }}
# DASHBOARD_BACKEND_SMTP_HOST: {{ .Values.backend.smtp.host | quote }}
# DASHBOARD_BACKEND_SMTP_PORT: {{ .Values.backend.smtp.port | quote }}

View file

@ -0,0 +1,45 @@
{{- if .Values.rbac.create -}}
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: ClusterRole
metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- 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:
- kustomize.toolkit.fluxcd.io
resources:
- kustomizations
verbs:
- list
- delete
- get
- patch
- create
- apiGroups:
- helm.toolkit.fluxcd.io
resources:
- helmreleases
verbs:
- list
- delete
- get
- patch
- create
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- list
- get
- patch
- delete
{{- end }}

View file

@ -0,0 +1,23 @@
{{- if .Values.rbac.create -}}
kind: ClusterRoleBinding
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: server
{{- 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 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "common.names.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View file

@ -0,0 +1,22 @@
{{- if and .Values.rbac.create .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "dashboard.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: server
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.serviceAccount.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.annotations "context" $) | nindent 4 }}
{{- end }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end }}