_terraria.tpl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {{- define "terraria.workload" -}}
  2. workload:
  3. terraria:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.terrariaNetwork.hostNetwork }}
  9. containers:
  10. terraria:
  11. enabled: true
  12. primary: true
  13. imageSelector: {{ .Values.terrariaConfig.imageSelector }}
  14. tty: true
  15. stdin: true
  16. args:
  17. {{- include "terraria.configuration" $ | nindent 12 }}
  18. securityContext:
  19. runAsUser: 0
  20. runAsGroup: 0
  21. runAsNonRoot: false
  22. readOnlyRootFilesystem: false
  23. envList:
  24. {{ with .Values.terrariaConfig.additionalEnvs }}
  25. {{ range $env := . }}
  26. - name: {{ $env.name }}
  27. value: {{ $env.value }}
  28. {{ end }}
  29. {{ end }}
  30. probes:
  31. # Probes are disabled because it fills the logs with
  32. # "login attemps"
  33. liveness:
  34. enabled: {{ .Values.ci }}
  35. type: tcp
  36. port: "{{ .Values.terrariaNetwork.serverPort }}"
  37. readiness:
  38. enabled: {{ .Values.ci }}
  39. type: tcp
  40. port: "{{ .Values.terrariaNetwork.serverPort }}"
  41. startup:
  42. enabled: {{ .Values.ci }}
  43. type: tcp
  44. port: "{{ .Values.terrariaNetwork.serverPort }}"
  45. {{/* Service */}}
  46. service:
  47. terraria:
  48. enabled: true
  49. primary: true
  50. type: NodePort
  51. targetSelector: terraria
  52. ports:
  53. server:
  54. enabled: true
  55. primary: true
  56. port: {{ .Values.terrariaNetwork.serverPort }}
  57. nodePort: {{ .Values.terrariaNetwork.serverPort }}
  58. targetSelector: terraria
  59. {{/* Persistence */}}
  60. persistence:
  61. world:
  62. enabled: true
  63. type: {{ .Values.terrariaStorage.world.type }}
  64. datasetName: {{ .Values.terrariaStorage.world.datasetName | default "" }}
  65. hostPath: {{ .Values.terrariaStorage.world.hostPath | default "" }}
  66. targetSelector:
  67. terraria:
  68. terraria:
  69. mountPath: /root/.local/share/Terraria/Worlds
  70. plugins:
  71. enabled: true
  72. type: {{ .Values.terrariaStorage.plugins.type }}
  73. datasetName: {{ .Values.terrariaStorage.plugins.datasetName | default "" }}
  74. hostPath: {{ .Values.terrariaStorage.plugins.hostPath | default "" }}
  75. targetSelector:
  76. terraria:
  77. terraria:
  78. mountPath: /plugins
  79. {{- end -}}