deployment.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "common.names.fullname" . }}
  5. labels:
  6. app: {{ template "common.names.name" . }}
  7. chart: {{ template "common.names.chart" . }}
  8. release: {{ .Release.Name }}
  9. heritage: {{ .Release.Service }}
  10. annotations:
  11. rollme: {{ randAlphaNum 5 | quote }}
  12. spec:
  13. replicas: {{ (default 1 .Values.replicas) }}
  14. strategy:
  15. type: "Recreate"
  16. selector:
  17. matchLabels:
  18. app: {{ template "common.names.name" . }}
  19. release: {{ .Release.Name }}
  20. template:
  21. metadata:
  22. name: {{ template "common.names.fullname" . }}
  23. labels:
  24. app: {{ template "common.names.name" . }}
  25. release: {{ .Release.Name }}
  26. {{- include "common.labels.selectorLabels" . | nindent 8 }}
  27. annotations: {{ include "common.annotations" . | nindent 8 }}
  28. spec:
  29. hostNetwork: {{ .Values.hostNetwork }}
  30. hostname: {{ .Release.Name }}
  31. containers:
  32. - name: {{ .Chart.Name }}
  33. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  34. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  35. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  36. - name: extrappvolume-{{ $index }}
  37. mountPath: {{ $hostPathConfiguration.mountPath }}
  38. {{ end }}
  39. ports:
  40. - name: web
  41. containerPort: 8384
  42. - name: tcp
  43. containerPort: 22000
  44. protocol: TCP
  45. - name: udp
  46. containerPort: 22000
  47. protocol: UDP
  48. env:
  49. {{ $envList := (default list .Values.environmentVariables) }}
  50. {{ $envList = mustAppend $envList (dict "name" "PUID" "value" (printf "%d" (.Values.ownerUID | int))) }}
  51. {{ $envList = mustAppend $envList (dict "name" "PGID" "value" (printf "%d" (.Values.ownerGID | int))) }}
  52. {{ $envList = mustAppend $envList (dict "name" "STGUIADDRESS" "value" "0.0.0.0:8384") }}
  53. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  54. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  55. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  56. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  57. - name: extrappvolume-{{ $index }}
  58. hostPath:
  59. path: {{ $hostPathConfiguration.hostPath }}
  60. {{ end }}