deployment.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. ports:
  36. - name: web
  37. containerPort: 8384
  38. - name: tcp
  39. containerPort: 22000
  40. protocol: TCP
  41. - name: udp
  42. containerPort: 22000
  43. protocol: UDP
  44. env:
  45. {{ $envList := (default list .Values.environmentVariables) }}
  46. {{ $envList = mustAppend $envList (dict "name" "PUID" "value" (printf "%d" (.Values.ownerUID | int))) }}
  47. {{ $envList = mustAppend $envList (dict "name" "PGID" "value" (printf "%d" (.Values.ownerGID | int))) }}
  48. {{ $envList = mustAppend $envList (dict "name" "STGUIADDRESS" "value" "0.0.0.0:8384") }}
  49. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  50. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  51. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  52. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  53. - name: extrappvolume-{{ $index }}
  54. hostPath:
  55. path: {{ $hostPathConfiguration.hostPath }}
  56. {{ end }}