-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdeployment.yaml
More file actions
108 lines (106 loc) · 3.59 KB
/
Copy pathdeployment.yaml
File metadata and controls
108 lines (106 loc) · 3.59 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "memos.fullname" . }}
labels:
{{- include "memos.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "memos.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/settings: {{ include (print $.Template.BasePath "/settings.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "memos.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "memos.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: memos-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existPersistClaim | default (include "memos.fullname" .) }}
{{- else }}
emptyDir: { }
{{- end }}
{{- if .Values.settings.enabled }}
- name: settings
configMap:
name: {{ include "memos.fullname" . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repo}}/{{ .Values.image.imageName }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 5230
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
volumeMounts:
- name: memos-data
mountPath: /var/opt/memos
{{- if .Values.settings.enabled }}
- name: settings
mountPath: /etc/secrets
readOnly: true
{{- end }}
# avoid * cannot parse 'Port' as int: strconv.ParseInt: parsing "tcp://10.233.40.219:5230": invalid syntax
env:
- name: MEMOS_PORT
value: "{{ .Values.service.port }}"
- name: MEMOS_LOG_LEVEL
value: {{ .Values.instance.logLevel | quote }}
- name: MEMOS_DRIVER
value: {{ .Values.database.driver | quote }}
{{- if .Values.database.connectionString }}
- name: MEMOS_DSN
value: {{ .Values.database.connectionString }}
{{- end }}
{{- if .Values.database.existingSecret }}
- name: MEMOS_DSN
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret.name }}
key: {{ .Values.database.existingSecret.key }}
{{- end }}
{{- if .Values.instance.url }}
- name: MEMOS_INSTANCE_URL
value: {{ .Values.instance.url }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end}}