From a25f9ed620e56aa24be7958cb6cba91443092a83 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 19 May 2024 22:50:14 +0200 Subject: [PATCH] Add team fortress 2 --- charts/team-fortress-2/.helmignore | 23 ++ charts/team-fortress-2/Chart.lock | 6 + charts/team-fortress-2/Chart.yaml | 18 ++ .../charts/softplayer-lib-workload-0.1.2.tgz | Bin 0 -> 4818 bytes charts/team-fortress-2/templates/install.yaml | 7 + charts/team-fortress-2/values.yaml | 233 ++++++++++++++++++ 6 files changed, 287 insertions(+) create mode 100644 charts/team-fortress-2/.helmignore create mode 100644 charts/team-fortress-2/Chart.lock create mode 100644 charts/team-fortress-2/Chart.yaml create mode 100644 charts/team-fortress-2/charts/softplayer-lib-workload-0.1.2.tgz create mode 100644 charts/team-fortress-2/templates/install.yaml create mode 100644 charts/team-fortress-2/values.yaml diff --git a/charts/team-fortress-2/.helmignore b/charts/team-fortress-2/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/team-fortress-2/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/team-fortress-2/Chart.lock b/charts/team-fortress-2/Chart.lock new file mode 100644 index 0000000..dd2b272 --- /dev/null +++ b/charts/team-fortress-2/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: softplayer-lib-workload + repository: oci://git.badhouseplants.net/softplayer + version: 0.1.2 +digest: sha256:309dcf8ff3e54beea96a5f3397b4b0c121089c579202681a02dc372d75b2bb74 +generated: "2024-05-19T20:39:53.311958+02:00" diff --git a/charts/team-fortress-2/Chart.yaml b/charts/team-fortress-2/Chart.yaml new file mode 100644 index 0000000..c1469b0 --- /dev/null +++ b/charts/team-fortress-2/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: team-fortress-2 +description: A Helm chart for running a Team Fortress 2 server +type: application +version: 0.1.0 +appVersion: "base" +maintainers: + - name: allanger + email: allanger@badhouseplants.net + url: https://badhouseplants.net +dependencies: + - name: softplayer-lib-workload + version: 0.1.2 + repository: oci://git.badhouseplants.net/softplayer +annotations: + allowed_workload_kinds: "Deployment" + # -- Skipping tests because it requires a very big volume + skip_tests: "true" \ No newline at end of file diff --git a/charts/team-fortress-2/charts/softplayer-lib-workload-0.1.2.tgz b/charts/team-fortress-2/charts/softplayer-lib-workload-0.1.2.tgz new file mode 100644 index 0000000000000000000000000000000000000000..48fcedad02e7565a2dc4456c16cec80dc8a905a2 GIT binary patch literal 4818 zcmV;@5-sf?iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH>ebKAIb_cQ;BEu))SZcKgJ?r7%CG z%_U_V(I2``?#mwBcT!M7K4Qv99F1VncLL0ON)j%=zk!g9DWXf@F^n-#oH85$@_iaJ z1_kMWFQ|n%b3`JJNQ5aHIcI?9h=e0RVThtBrvElZ!7NT0PC^uM=0%u001=wwqK>1! zuAoYXFB3e;`)K0-VSi}x|K;$af8_r|lm`dEML|G>%17Z1jT1~c z!OR`O1ceO078Mfnv1kI|D#?+5-vErP#0d|vJIdP^FP4dX9*=*=K6mBgM+e|hV$f2Q zC@Rc2Pez@Npvf~$pD~?w0*WU5tb5r}&t6H$HdOhH;!i1|IB-YsKc%ra0RQX!xdh=V z{^xj}gotC-xtrlI!IXJC+0hhe;Qzs3XzBlccW^#D^8X>q!$arP`RPl7q5${|OLH9J ziTo_Bde1rSJU%)P4`&eI35hVc>ba=t!ddYSr6C7TZ5)3QV7!k?iHMrNE-oZ`2y~l3mO)V0`bw2xLr|=V!Dais8LtMF5A6@oJy&OJ8k$TuT+cmNXlVH((j@l<#ATZTjI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ress-2/templates/install.yaml new file mode 100644 index 0000000..768af3c --- /dev/null +++ b/charts/team-fortress-2/templates/install.yaml @@ -0,0 +1,7 @@ +{{ include "lib.workload" . }} +{{ include "lib.service" . }} +{{ include "lib.config.env" . }} +{{ include "lib.config.files" . }} +{{ include "lib.pvc" . }} +{{ include "lib.traefik.ingress_route_udp" . }} +{{ include "lib.traefik.ingress_route_tcp" . }} \ No newline at end of file diff --git a/charts/team-fortress-2/values.yaml b/charts/team-fortress-2/values.yaml new file mode 100644 index 0000000..15acdd0 --- /dev/null +++ b/charts/team-fortress-2/values.yaml @@ -0,0 +1,233 @@ +--- +workload: + kind: Deployment + containers: + tf2: + image: + registry: docker.io + repository: cm2network/tf2 + tag: + pullPolicy: Always + ports: + - tf2 + - rcon + - tv + mounts: + storage: + data: + path: /home/steam/tf-dedicated/ + extraVolumes: + steam: + path: /Steam + envFrom: + - environment + - secrets + initContainers: + 0-prepare-config: + image: + registry: docker.io + repository: alpine + tag: latest + pullPolicy: Always + mounts: + storage: + data: + path: /tf-data + files: + server-cfg: + mode: 420 + path: /src/server.cfg + subPath: server.cfg + command: + - sh + args: + - -c + - mkdir -p /tf-data/tf/cfg && cp /src/server.cfg /tf-data/tf/cfg/server.cfg + +service: + type: ClusterIP + ports: + tf2: + port: 27015 + targetPort: 27015 + protocol: UDP + tv: + port: 27020 + targetPort: 27020 + protocol: TCP + rcon: + port: 27015 + targetPort: 27015 + protocol: TCP + +traefik: + udpRoutes: + tf2: + routes: + - services: + - name: "{{ .Release.Name }}" + port: 27015 + weight: 10 + nativeLB: false + + tcpRoutes: + rcon: + routes: + - match: HostSNI(`*`) + services: + - name: "{{ .Release.Name }}" + port: 27015 + nativeLB: true +storage: + data: + storageClassName: default + size: 45G + accessModes: + - ReadWriteOnce +env: + environment: + sensitive: false + data: + SRCDS_PORT: "27015" + SRCDS_TV_PORT: "27020" + SRCDS_IP: "0" + SRCDS_FPSMAX: "300" + SRCDS_TICKRATE: "66" + SRCDS_MAXPLAYERS: "14" + SRCDS_REGION: "3" + SRCDS_STARTMAP: "ctf_2fort" + SRCDS_HOSTNAME: "New TF Server" # -- first launch only + SRCDS_CFG: "server.cfg" + SRCDS_MAPCYCLE: "mapcycle_default.txt" # -- value can be overwritten by tf/cfg/server.cfg + SRCDS_SECURED: "1" # -- 0 to start the server as insecured + secrets: + sensitive: true + data: + SRCDS_TOKEN: "" # -- value is is required to be listed & reachable, retrieve token here (AppID 440): https://steamcommunity.com/dev/managegameservers +extraVolumes: + # -- Because by default the fs is read-only, we need to add an emtpy dir volume + steam: + emptyDir: {} +files: + server-cfg: + sensitive: true + data: + server.cfg: |- + // General Settings // + // Hostname for server. + hostname "Team Fortress 2 Server" + // Overrides the max players reported to prospective clients + sv_visiblemaxplayers 24 + // Maximum number of rounds to play before server changes maps + mp_maxrounds 5 + // Set to lock per-frame time elapse + host_framerate 0 + // Set the pause state of the server + setpause 0 + // Control where the client gets content from + // 0 = anywhere, 1 = anywhere listed in white list, 2 = steam official content only + sv_pure 0 + // Is the server pausable + sv_pausable 0 + // Type of server 0=internet 1=lan + sv_lan 0 + // Collect CPU usage stats + sv_stats 1 + // Server password + sv_password "qwertyu9" + // Execute Banned Users // + exec banned_user.cfg + exec banned_ip.cfg + writeid + writeip + // Contact & Region // + // Contact email for server sysop + sv_contact test@example.com + // The region of the world to report this server in. + // -1 is the world, 0 is USA east coast, 1 is USA west coast + // 2 south america, 3 europe, 4 asia, 5 australia, 6 middle east, 7 africa + sv_region -1 + // Rcon Settings // + // Password for rcon authentication (Remote CONtrol) + rcon_password "12345" + // Number of minutes to ban users who fail rcon authentication + sv_rcon_banpenalty 1440 + // Max number of times a user can fail rcon authentication before being banned + sv_rcon_maxfailures 5 + // Log Settings // + // Enables logging to file, console, and udp < on | off >. + log on + // Log server information to only one file. + sv_log_onefile 0 + // Log server information in the log file. + sv_logfile 1 + // Log server bans in the server logs. + sv_logbans 1 + // Echo log information to the console. + sv_logecho 1 + // Rate Settings // + // Frame rate limiter + fps_max 600 + // Min bandwidth rate allowed on server, 0 == unlimited + sv_minrate 0 + // Max bandwidth rate allowed on server, 0 == unlimited + sv_maxrate 20000 + // Minimum updates per second that the server will allow + sv_minupdaterate 66 + // Maximum updates per second that the server will allow + sv_maxupdaterate 66 + // Download Settings // + // Allow clients to upload customizations files + sv_allowupload 1 + // Allow clients to download files + sv_allowdownload 1 + // Maximum allowed file size for uploading in MB + net_maxfilesize 15 + // Team Balancing // + // Enable team balancing + mp_autoteambalance 1 + // Time after the teams become unbalanced to attempt to switch players. + mp_autoteambalance_delay 60 + // Time after the teams become unbalanced to print a balance warning + mp_autoteambalance_warning_delay 30 + // Teams are unbalanced when one team has this many more players than the other team. (0 disables check) + mp_teams_unbalance_limit 1 + // Round and Game Times // + // Enable timers to wait between rounds. WARNING: Setting this to 0 has been known to cause a bug with setup times lasting 5:20 (5 minutes 20 seconds) on some servers! + mp_enableroundwaittime 1 + // Time after round win until round restarts + mp_bonusroundtime 8 + // If non-zero, the current round will restart in the specified number of seconds + mp_restartround 0 + // Enable sudden death + mp_stalemate_enable 1 + // Timelimit (in seconds) of the stalemate round. + mp_stalemate_timelimit 300 + // Game time per map in minutes + mp_timelimit 35 + // Client CVars // + // Restricts spectator modes for dead players + mp_forcecamera 0 + // Toggles whether the server allows spectator mode or not + mp_allowspectators 1 + // Toggles footstep sounds + mp_footsteps 1 + // Toggles game cheats + sv_cheats 0 + // After this many seconds without a message from a client, the client is dropped + sv_timeout 900 + // Maximum time a player is allowed to be idle (in minutes), made this and sv_timeout equal same time? + mp_idlemaxtime 15 + // Deals with idle players 1=send to spectator 2=kick + mp_idledealmethod 2 + // Time (seconds) between decal sprays + decalfrequency 30 + // Communications // + // enable voice communications + sv_voiceenable 1 + // Players can hear all other players, no team restrictions 0=off 1=on + sv_alltalk 0 + // Amount of time players can chat after the game is over + mp_chattime 10 + // Enable party mode + tf_birthday 0