apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "teamspeak.fullname" . }} labels: {{- include "teamspeak.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: {{- include "teamspeak.selectorLabels" . | nindent 6 }} template: metadata: annotations: configs-hash: {{ (toYaml .Values.configs) | adler32sum | quote }} {{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} labels: {{- include "teamspeak.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- 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 }} containers: - name: teamspeak-server image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: ts3-voice containerPort: {{ .Values.service.voice.port }} protocol: UDP - name: ts3-file containerPort: {{ .Values.service.file.port }} protocol: TCP - name: ts3-query containerPort: {{ .Values.service.query.port }} protocol: TCP livenessProbe: tcpSocket: port: {{ .Values.service.query.port }} initialDelaySeconds: 15 periodSeconds: 10 readinessProbe: tcpSocket: port: {{ .Values.service.query.port }} initialDelaySeconds: 15 periodSeconds: 10 resources: {{- toYaml .Values.resources | nindent 12 }} env: - name: TS3SERVER_LICENSE value: accept {{- if .Values.configs.allowlist }} - name: TS3SERVER_IP_ALLOWLIST value: /allowlist.txt {{- end }} {{- range .Values.extraEnv }} - name: {{ .name | quote }} value: {{ .value | quote }} {{- end }} volumeMounts: - name: data mountPath: /var/ts3server/ {{- if .Values.configs.allowlist }} - name: teamspeak-configs mountPath: /allowlist.txt subPath: allowlist.txt {{- end }} {{- if .Values.extraVolumeMounts }} {{ toYaml .Values.extraVolumeMounts | indent 10 }} {{- end }} {{- if .Values.image.pullSecret }} imagePullSecrets: - name: {{ .Values.image.pullSecret }} {{- end }} volumes: - name: teamspeak-configs configMap: name: teamspeak {{- if .Values.extraVolumeMounts }} {{ toYaml .Values.extraVolumes | indent 8 }} {{- end }} volumeClaimTemplates: - metadata: name: data {{- if .Values.persistentVolume.annotations }} annotations: {{ toYaml .Values.persistentVolume.annotations | indent 10 }} {{- end }} spec: accessModes: {{ toYaml .Values.persistentVolume.accessModes | indent 10 }} resources: requests: storage: "{{ .Values.persistentVolume.size }}" {{- if .Values.persistentVolume.storageClass }} {{- if (eq "-" .Values.persistentVolume.storageClass) }} storageClassName: "" {{- else }} storageClassName: "{{ .Values.persistentVolume.storageClass }}" {{- end }} {{- end }}