Batch-3 major PR for teamspeak-server (issue #32): - Rename service and StatefulSet to the repo naming scheme ({{ .Release.Name }}-{{ .Chart.Name }}-service / -sfs); the PVC keeps its historical name (documented naming exception, data preservation). - NodePorts configurable via server.voicePort / server.fileTransferPort (defaults 30987/30033, satisfactory pattern); ports are also passed to the server via TSSERVER_DEFAULT_PORT / TSSERVER_FILE_TRANSFER_PORT. - Hardened, values-configurable security contexts (securityContext.pod/container): non-root uid/gid 9987, readOnlyRootFilesystem, all capabilities dropped. - Probes values-configurable (defaults unchanged). - Additive env value rendered through tpl (value/secretKeyRef/ configMapKeyRef forms). - Chart 3.1.2 -> 4.0.0 (+up6.0.0.beta12.1).
83 lines
3.3 KiB
YAML
83 lines
3.3 KiB
YAML
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:
|
|
{{- toYaml .Values.securityContext.pod | 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:
|
|
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
|
readinessProbe:
|
|
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
|
startupProbe:
|
|
{{- toYaml .Values.startupProbe | nindent 12 }}
|
|
resources:
|
|
{{- include "teamspeak-server.resources" .Values.resources | nindent 12 }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext.container | 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
|