-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathstatefulset.yaml
131 lines (131 loc) · 4.29 KB
/
statefulset.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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "prosody.fullname" . }}
labels:
{{- include "prosody.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
serviceName: "prosody"
replicas: 1
selector:
matchLabels:
{{- include "prosody.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "prosody.selectorLabels" . | nindent 8 }}
{{- range $label, $value := mergeOverwrite .Values.global.podLabels .Values.podLabels }}
{{ $label }}: {{ $value }}
{{- end }}
si.jit.meet/secret-timestamp: {{ now | date "20060102T150405" }}
{{- with mergeOverwrite .Values.global.podAnnotations .Values.podAnnotations }}
annotations:
{{- range $annotation, $value := . }}
{{ $annotation }}: {{ $value }}
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "prosody.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ tpl (default .Chart.AppVersion .Values.image.tag ) . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "prosody.fullname" . }}
- secretRef:
name: {{ include "prosody.fullname" . }}
{{- range .Values.extraEnvFrom }}
- {{ tpl (toYaml . ) $ | indent 12 | trim }}
{{- end }}
{{- if .Values.extraEnvs }}
env:
{{- range .Values.extraEnvs }}
- {{ tpl (toYaml . ) $ | indent 12 | trim }}
{{- end }}
{{- end }}
ports:
- name: xmpp-c2s
containerPort: {{ index .Values.service.ports "xmpp-c2s" }}
protocol: TCP
- name: xmpp-s2s
containerPort: {{ index .Values.service.ports "xmpp-s2s" }}
protocol: TCP
- name: xmpp-component
containerPort: {{ index .Values.service.ports "xmpp-component" }}
protocol: TCP
- name: bosh-insecure
containerPort: {{ index .Values.service.ports "bosh-insecure" }}
protocol: TCP
- name: bosh-secure
containerPort: {{ index .Values.service.ports "bosh-secure" }}
protocol: TCP
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: prosody-data
mountPath: {{ .Values.dataDir }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 10 }}
{{- end }}
volumes:
- name: prosody-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: prosody-data
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.persistence.enabled .Values.extraVolumeClaimTemplates }}
volumeClaimTemplates:
- metadata:
name: prosody-data
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- with .Values.persistence.storageClassName }}
storageClassName: {{ . | quote }}
{{- end }}
{{- with .Values.extraVolumeClaimTemplates }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}