deployment.yaml 2.6 KB

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