From c005dc7c03a5fd9b3f6655ffb885242738c401eb Mon Sep 17 00:00:00 2001 From: Philip Haupt <“der.mad.mob@gmail.com”> Date: Thu, 15 May 2025 23:44:41 +0200 Subject: [PATCH] teamspeak --- teamspeak/kustomization.yaml | 6 ++ teamspeak/main.yaml | 130 +++++++++++++++++++++++++++++++ teamspeak/src/kustomization.yaml | 12 +++ teamspeak/src/values.yaml | 118 ++++++++++++++++++++++++++++ 4 files changed, 266 insertions(+) create mode 100644 teamspeak/kustomization.yaml create mode 100644 teamspeak/main.yaml create mode 100644 teamspeak/src/kustomization.yaml create mode 100644 teamspeak/src/values.yaml diff --git a/teamspeak/kustomization.yaml b/teamspeak/kustomization.yaml new file mode 100644 index 0000000..4ae436c --- /dev/null +++ b/teamspeak/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - main.yaml \ No newline at end of file diff --git a/teamspeak/main.yaml b/teamspeak/main.yaml new file mode 100644 index 0000000..634ae62 --- /dev/null +++ b/teamspeak/main.yaml @@ -0,0 +1,130 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/instance: teamspeak + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: teamspeak + app.kubernetes.io/version: 3.13.6 + helm.sh/chart: teamspeak-0.7.2 + name: teamspeak +spec: + ports: + - name: filetransfer + port: 30033 + protocol: TCP + targetPort: filetransfer + - name: serverquery + port: 10011 + protocol: TCP + targetPort: serverquery + - name: voice + port: 9987 + protocol: UDP + targetPort: voice + selector: + app.kubernetes.io/instance: teamspeak + app.kubernetes.io/name: teamspeak + type: ClusterIP +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app.kubernetes.io/instance: teamspeak + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: teamspeak + app.kubernetes.io/version: 3.13.6 + helm.sh/chart: teamspeak-0.7.2 + name: teamspeak-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: openebs-3-replicas +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/instance: teamspeak + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: teamspeak + app.kubernetes.io/version: 3.13.6 + helm.sh/chart: teamspeak-0.7.2 + name: teamspeak +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app.kubernetes.io/instance: teamspeak + app.kubernetes.io/name: teamspeak + strategy: + type: Recreate + template: + metadata: + labels: + app.kubernetes.io/instance: teamspeak + app.kubernetes.io/name: teamspeak + spec: + automountServiceAccountToken: true + containers: + - env: + - name: TS3SERVER_LICENSE + value: accept + - name: TS3SERVER_SERVERADMIN_PASSWORD + valueFrom: + secretKeyRef: + key: serveradmin_password + name: teamspeak + - name: TZ + value: UTC + image: teamspeak:3.13.7 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 10011 + timeoutSeconds: 1 + name: teamspeak + ports: + - containerPort: 30033 + name: filetransfer + protocol: TCP + - containerPort: 10011 + name: serverquery + protocol: TCP + - containerPort: 9987 + name: voice + protocol: UDP + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 10011 + timeoutSeconds: 1 + startupProbe: + failureThreshold: 30 + initialDelaySeconds: 0 + periodSeconds: 5 + tcpSocket: + port: 10011 + timeoutSeconds: 1 + volumeMounts: + - mountPath: /var/ts3server + name: data + dnsPolicy: ClusterFirst + enableServiceLinks: true + nodeSelector: + kubernetes.io/arch: amd64 + serviceAccountName: default + volumes: + - name: data + persistentVolumeClaim: + claimName: teamspeak-data diff --git a/teamspeak/src/kustomization.yaml b/teamspeak/src/kustomization.yaml new file mode 100644 index 0000000..0c54906 --- /dev/null +++ b/teamspeak/src/kustomization.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +helmCharts: + - name: teamspeak + repo: https://k8s-at-home.com/charts/ + version: 0.7.2 + releaseName: teamspeak + includeCRDs: true + namespace: teamspeak + valuesFile: values.yaml diff --git a/teamspeak/src/values.yaml b/teamspeak/src/values.yaml new file mode 100644 index 0000000..119d7b6 --- /dev/null +++ b/teamspeak/src/values.yaml @@ -0,0 +1,118 @@ +# +# IMPORTANT NOTE +# +# This chart inherits from our common library chart. You can check the default values/options here: +# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml +# + +image: + # -- image repository + repository: teamspeak + # -- image tag + tag: 3.13.7 + # -- image pull policy + pullPolicy: IfNotPresent + +# -- environment variables. See more environment variables in the [teamspeak image documentation](https://hub.docker.com/_/teamspeak). +# @default -- See below +env: + TZ: UTC + TS3SERVER_LICENSE: accept + # TS3SERVER_SERVERADMIN_PASSWORD: + # valueFrom: + # secretKeyRef: + # name: teamspeak + # key: serveradmin_password + + +# -- Configures service settings for the chart. +# @default -- See values.yaml +service: + main: + ports: + http: + enabled: false + primary: false + serverquery: + enabled: true + port: 10011 + filetransfer: + enabled: true + port: 30033 + voice: + enabled: true + primary: true + port: 9987 + protocol: UDP + +probes: + readiness: + custom: true + spec: + tcpSocket: + port: 10011 + liveness: + custom: true + spec: + tcpSocket: + port: 10011 + startup: + custom: true + spec: + tcpSocket: + port: 10011 + +# -- Configure persistence settings for the chart under this key. +# @default -- See values.yaml +persistence: + data: + enabled: true + mountPath: /var/ts3server + accessMode: ReadWriteOnce + storageClass: openebs-3-replicas + size: 1Gi + +metrics: + # -- Enable and configure ts3exporter sidecar and Prometheus serviceMonitor. + # @default -- See values.yaml + enabled: false + serviceMonitor: + interval: 1m + scrapeTimeout: 30s + labels: {} + # -- Enable and configure Prometheus Rules for the chart under this key. + # @default -- See values.yaml + prometheusRule: + enabled: false + labels: {} + # -- Configure additionial rules for the chart under this key. + # @default -- See prometheusrules.yaml + rules: [] + # - alert: TeamSpeakDown + # annotations: + # description: Teamspeak service is down. + # summary: Teamspeak is down. + # expr: | + # ts3_serverinfo_online == 0 + # for: 5m + # labels: + # severity: critical + exporter: + image: + # -- image repository + repository: quay.io/ricardbejarano/ts3exporter + # -- image tag + tag: 0.0.7 + # -- image pull policy + pullPolicy: IfNotPresent + env: + # -- metrics port + port: 9189 + # -- TeamSpeak query endpoint + remote: localhost:10011 + # -- Set to true to enable gathering of channel metrics + enableChannelMetrics: false + +# -- The TeamSpeak server binary is only available for x86_64. +nodeSelector: + kubernetes.io/arch: amd64