forked from grafana-community/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_serviceaccount.yaml
More file actions
33 lines (33 loc) · 1003 Bytes
/
_serviceaccount.yaml
File metadata and controls
33 lines (33 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{{- define "loki.serviceAccount" }}
{{- $target := .target }}
{{- $ctx := .ctx }}
{{- $component := .component }}
{{- $name := .name }}
{{- with $ctx }}
{{- if $component.serviceAccount.create -}}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $name | default (include "loki.serviceAccountName" (dict "ctx" $ctx "component" $component "target" $target)) }}
namespace: {{ include "loki.namespace" $ctx }}
labels:
{{- include "loki.labels" . | nindent 4 }}
{{- with $target }}
app.kubernetes.io/component: {{ . }}
{{- end }}
{{- with $component.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $component.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ $component.serviceAccount.automountServiceAccountToken }}
{{- with $component.serviceAccount.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}