forked from Azure-Samples/secrets-store-csi-with-aks-akv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yaml
84 lines (84 loc) · 2.64 KB
/
deployment.yaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "sampleapp.fullname" . }}
labels:
app: {{ template "sampleapp.name" . }}
chart: {{ template "sampleapp.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "sampleapp.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "sampleapp.name" . }}
release: {{ .Release.Name }}
spec:
volumes:
- name: secrets-mount
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "azure-keyvault"
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
env:
- name: APPINSIGHTS_INSTRUMENTATIONKEY
value: {{ .Values.applicationInsights.InstrumentationKey }}
{{- $root := . }}
{{- range $ref, $values := .Values.secrets }}
{{- range $key, $value := $values }}
- name: {{ $ref | upper }}_{{ $key | upper }}
valueFrom:
secretKeyRef:
name: {{ template "sampleapp.fullname" $root }}-{{ $ref }}
key: {{ $key }}
{{- end }}
{{- end }}
volumeMounts:
# This mount is not used by the application but is required for the secretProviderClass
- mountPath: "mnt/secrets-store"
name: secrets-mount
readOnly: true
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.imagePullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}