-
Notifications
You must be signed in to change notification settings - Fork 2
/
deployment.yaml
137 lines (137 loc) · 4.65 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "directus.fullname" . }}
labels:
{{- include "directus.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "directus.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "directus.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "directus.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe: {{- omit .Values.livenessProbe "enabled" | toYaml | nindent 12 }}
readinessProbe: {{- omit .Values.readinessProbe "enabled" | toYaml | nindent 12 }}
volumeMounts:
- name: directus-data
mountPath: /directus
- name: extensions-config
mountPath: "/extensions-config"
readOnly: true
resources: {{- toYaml .Values.resources | nindent 12 }}
env:
- name: KEY
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: DIRECTUS_KEY
- name: SECRET
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: DIRECTUS_SECRET
- name: DB_DATABASE
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: DIRECTUS_DATABASE_NAME
- name: DB_USER
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: DIRECTUS_DATABASE_USER
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: DIRECTUS_DATABASE_PASSWORD
- name: ADMIN_EMAIL
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: ADMIN_EMAIL
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: directus-env-secrets
key: ADMIN_PASSWORD
- name: DIRECTUS_ENV
valueFrom:
configMapKeyRef:
name: directus-env-configmap
key: DIRECTUS_ENV
- name: DIRECTUS_INSTALL_TITLE
valueFrom:
configMapKeyRef:
name: directus-env-configmap
key: DIRECTUS_INSTALL_TITLE
- name: DIRECTUS_INSTALL_FORCE
valueFrom:
configMapKeyRef:
name: directus-env-configmap
key: DIRECTUS_INSTALL_FORCE
- name: DB_CLIENT
valueFrom:
configMapKeyRef:
name: directus-env-configmap
key: DIRECTUS_DATABASE_CLIENT
- name: DB_HOST
value: {{ include "directus.databaseService" . }}
- name: DB_PORT
valueFrom:
configMapKeyRef:
name: directus-env-configmap
key: DIRECTUS_DATABASE_PORT
volumes:
- name: directus-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "directus.fullname" . ) }}
{{- else }}
emptyDir: {}
{{ end }}
# - name: extensions-config
# configMap:
# name: directus-extensions-configmap
# items:
# - key: EXTENSIONS
# path: extensions.yaml
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}