apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs spec: replicas: {{ include "teamspeak-server.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.replicas) }} selector: matchLabels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs template: metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs spec: automountServiceAccountToken: false securityContext: {{- include "teamspeak-server.podSecurityContext" .Values.securityContext | nindent 8 }} containers: - name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs image: "teamspeaksystems/teamspeak6-server:{{ .Chart.AppVersion }}" imagePullPolicy: IfNotPresent ports: - name: voice-port containerPort: {{ .Values.server.voicePort }} protocol: UDP - name: file-transfer containerPort: {{ .Values.server.fileTransferPort }} protocol: TCP - name: web-query containerPort: 10080 protocol: TCP env: - name: TSSERVER_LICENSE_ACCEPTED value: "accept" - name: TSSERVER_DEFAULT_PORT value: {{ .Values.server.voicePort | quote }} - name: TSSERVER_FILE_TRANSFER_PORT value: {{ .Values.server.fileTransferPort | quote }} {{- range $value := .Values.env }} {{- if $value.value }} - name: {{ $value.name }} value: {{ tpl $value.value $ }} {{- else if $value.valueFrom }} {{- if $value.valueFrom.secretKeyRef }} - name: {{ $value.name }} valueFrom: secretKeyRef: name: {{ tpl $value.valueFrom.secretKeyRef.name $ }} key: {{ tpl $value.valueFrom.secretKeyRef.key $ }} {{- else if $value.valueFrom.configMapKeyRef }} - name: {{ $value.name }} valueFrom: configMapKeyRef: name: {{ tpl $value.valueFrom.configMapKeyRef.name $ }} key: {{ tpl $value.valueFrom.configMapKeyRef.key $ }} {{- end }} {{- end }} {{- end }} livenessProbe: {{- include "teamspeak-server.livenessProbe" .Values.livenessProbe | nindent 12 }} readinessProbe: {{- include "teamspeak-server.readinessProbe" .Values.readinessProbe | nindent 12 }} startupProbe: {{- include "teamspeak-server.startupProbe" .Values.startupProbe | nindent 12 }} resources: {{- include "teamspeak-server.effectiveResources" .Values.resources | nindent 12 }} securityContext: {{- include "teamspeak-server.containerSecurityContext" .Values.securityContext | nindent 12 }} volumeMounts: - name: "teamspeak-volume" mountPath: /var/tsserver/ restartPolicy: Always volumes: - name: "teamspeak-volume" persistentVolumeClaim: # Deliberate exception from the naming scheme: renaming the PVC # would detach existing data (see README, naming exceptions). claimName: {{ .Release.Name }}-teamspeak-volume-claim serviceName: {{ .Release.Name }}-{{ .Chart.Name }}-service