deployment.yaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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: false
  31. containers:
  32. - name: {{ .Chart.Name }}
  33. {{ include "common.resources.limitation" . | nindent 10 }}
  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: {{ .Values.web_port }}
  43. - name: tcp
  44. containerPort: {{ .Values.tcp_port }}
  45. protocol: TCP
  46. - name: udp
  47. containerPort: {{ .Values.udp_port }}
  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" "TZ" "value" (printf "%s" .Values.timezone)) }}
  54. {{ $envList = mustAppend $envList (dict "name" "WEBUI_PORT" "value" (printf "%d" (.Values.web_port | int))) }}
  55. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  56. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  57. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  58. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  59. - name: extrappvolume-{{ $index }}
  60. hostPath:
  61. path: {{ $hostPathConfiguration.hostPath }}
  62. {{ end }}