# yaml-language-server: $schema=./values.schema.json
image:
  repository: docker.io/drpsychick/arkserver
  tag: latest@sha256:90c3cde549cc191c7dc07c7810bdf30f82d75669dbdb7c475e43cf8771e2b1ef
securityContext:
  pod:
    fsGroup: 1001
  container:
    capabilities:
      add: ["AUDIT_WRITE", "CHOWN", "FOWNER", "DAC_OVERRIDE", "SETGID", "SETUID"]
    runAsUser: 1001
    runAsGroup: 1001
    runAsNonRoot: false
    readOnlyRootFilesystem: false
    allowPrivilegeEscalation: true
service:
  main:
    enabled: true
    ports:
      main:
        enabled: true
        port: 7777
        protocol: udp
      game:
        enabled: true
        port: 7778
        # This should always be main +1
        protocol: udp
  query:
    enabled: true
    ports:
      query:
        enabled: true
        protocol: udp
        port: 27015
  rcon:
    enabled: true
    ports:
      rcon:
        enabled: true
        protocol: tcp
        port: 27020
ark:
  mods: []

workload:
  main:
    podSpec:
      containers:
        main:
          env:
            ## Don't touch
            # arkmanager subtracts 1 from port by default
            am_arkNoPortDecrement: "true"
            am_arkGameIniFile: /arkconfig/Game.ini
            am_arkGameUserSettingsIniFile: /arkconfig/GameUserSettings.ini
            ARKSERVER_SHARED: "{{ $.Values.persistence.game.mountPath }}"
            am_ark_QueryPort: "{{ .Values.service.query.ports.query.port }}"
            am_ark_Port: "{{ .Values.service.main.ports.main.port }}"
            am_ark_RCONPort: "{{ .Values.service.rcon.ports.rcon.port }}"
            am_ark_GameModIds: '{{ join "," .Values.ark.mods }}'
            am_arkBackupPreUpdate: true

            ## Free RealEstate
            ARKCLUSTER: "true"
            am_arkopt_clusterid: "arkserver"
            am_arkStagingDir: "/ark/staging"
            am_arkAutoUpdateOnStart: true
            am_ark_SessionName: "arkserver"
            am_serverMap: "TheIsland"
            am_ark_MaxPlayers: "10"
            am_ark_ServerPassword: "password"
            am_ark_RCONEnabled: "True"
            am_ark_ServerAdminPassword: "123456789"
            am_arkflag_USECACHE: "true"

          probes:
            liveness:
              type: tcp
              port: "{{ .Values.service.rcon.ports.rcon.port }}"
              spec:
                initialDelaySeconds: 60
                periodSeconds: 28
            readiness:
              type: tcp
              port: "{{ .Values.service.rcon.ports.rcon.port }}"
              spec:
                initialDelaySeconds: 60
                periodSeconds: 26
                failureThreshold: 6
            startup:
              type: tcp
              port: "{{ .Values.service.rcon.ports.rcon.port }}"
              spec:
                initialDelaySeconds: 60
                periodSeconds: 25

persistence:
  game:
    enabled: true
    mountPath: /arkserver
  ark:
    enabled: true
    mountPath: /ark
  backup:
    enabled: true
    mountPath: /ark/backup
  staging:
    enabled: true
    mountPath: /ark/staging
  steamapps:
    enabled: true
    mountPath: /home/steam/.steam/steamapps
  cluster:
    enabled: true
    mountPath: /arkserver/ShooterGame/Saved/clusters
  save:
    enabled: true
    mountPath: /arkserver/ShooterGame/Saved
  shootergame:
    enabled: true
    mountPath: /arkserver/ShooterGame
  gameinis:
    enabled: true
    type: configmap
    objectName: gameinis
    mountPath: /arkconfig
  crontab:
    enabled: true
    type: emptyDir
    mountPath: /var/spool/cron/crontabs/
  crontabfile:
    enabled: true
    type: configmap
    objectName: gameinis
    mountPath: /ark/config/crontab
    subPath: crontab
    items:
      - key: "crontab"
        path: "crontab"
configmap:
  gameinis:
    enabled: true
    data:
      Engine.ini: |
        # Engine.ini
      Game.ini: |
        [/Script/ShooterGame.ShooterGameMode]
        bDisableStructurePlacementCollision=True
        ## index:
        ## 0: Health,
        ## 1: Stamina,
        ## 2: Torpidity,
        ## 3: Oxygen,
        ## 4: Food,
        ## 5: Water,
        ## 6: Temperature,
        ## 7: Weight,
        ## 8: MeleeDamageMultiplier,
        ## 9: SpeedMultiplier,
        ## 10: TemperatureFortitude,
        ## 11: CraftingSpeedMultiplier
        # PerLevelStatsMultiplier_Player[0]=2.0
        # PerLevelStatsMultiplier_Player[4]=2.0
        # PerLevelStatsMultiplier_Player[5]=2.0
        # PerLevelStatsMultiplier_Player[7]=2.0
        # PerLevelStatsMultiplier_DinoTamed[7]=2.0
        # PerLevelStatsMultiplier_DinoWild[7]=1
        ## https://board.nitrado.net/support-de-german-only/support-gameserver/ark-survival-evolved/103586/butgeschwindigkeit-wachstumsgeschwindigkeit/?s=6270aee8447cd08b702a7315fe1e47efe64afb1b#post681499
        ## https://survivetheark.com/index.php?/forums/topic/200763-help-with-breedingimprinting-settings/
        # MatingIntervalMultiplier=0.1
        # BabyMatureSpeedMultiplier=25.0
        # EggHatchSpeedMultiplier=15.0
        # BabyCuddleIntervalMultiplier=0.1
      GameUserSettings.ini: |
        [/Script/ShooterGame.ShooterGameUserSettings]
        Version=5
        [ServerSettings]
        AllowFlyerCarryPvE=True
        AllowThirdPersonPlayer=True
        AlwaysNotifyPlayerLeft=False
        AutoSavePeriodMinutes=15.000000
        ClampResourceHarvestDamage=False
        DifficultyOffset=1.000000
        OverrideOfficialDifficulty=5.000000
        DisableStructureDecayPvE=False
        DontAlwaysNotifyPlayerJoined=False
        EnablePvPGamma=False
        GlobalVoiceChat=False
        KickIdlePlayersPeriod=2400.000000
        NoTributeDownloads=False
        ProximityChat=False
        ProximityVoiceChat=False
        PvEStructureDecayDestructionPeriod=0.000000
        ServerCrosshair=True
        ServerForceNoHUD=False
        ServerHardcore=False
        ServerPassword=password
        ServerPVE=True
        ShowMapPlayerLocation=True
        TamedDinoDamageMultiplier=1.000000
        TamedDinoResistanceMultiplier=1.000000
        StructurePreventResourceRadiusMultiplier=1.000000
        RaidDinoCharacterFoodDrainMultiplier=1.000000
        PvEDinoDecayPeriodMultiplier=1.000000
        PerPlatformMaxStructuresMultiplier=1.000000
        ListenServerTetherDistanceMultiplier=1.000000
        MaxTamedDinos=5000.000000
        RCONServerGameLogBuffer=600.000000
        AllowHitMarkers=True
        TamingSpeedMultiplier=3.000000
        AllowCaveBuildingPvE=True
        AllowAnyoneBabyImprintCuddle=True
        ShowFloatingDamageText=True
        NonPermanentDiseases=True
        HarvestAmountMultiplier=1.900000
        PreventDownloadSurvivors=False
        PreventDownloadItems=False
        PreventDownloadDinos=False
        PreventUploadSurvivors=False
        PreventUploadItems=False
        PreventUploadDinos=False
        TribeLogDestroyedEnemyStructures=True
        TheMaxStructuresInRange=10500.000000
        XPMultiplier=1
        ActiveMods=

        [SessionSettings]
        SessionName=ArkServer

        [/Script/Engine.GameSession]

        [MessageOfTheDay]
        Message=Welcome on ARK
        Duration=5

        [/Game/PrimalEarth/CoreBlueprints/TestGameMode.TestGameMode_C]
        bServerGameLogEnabled=True
      crontab:
        10 */8 * * * arkmanager saveworld && arkmanager backup
