deployment.yaml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.resources.limitation" . | nindent 10 }}
  35. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  36. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  37. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  38. - name: extrappvolume-{{ $index }}
  39. mountPath: {{ $hostPathConfiguration.mountPath }}
  40. {{ end }}
  41. ports:
  42. - name: web
  43. containerPort: 8384
  44. {{ if not .Values.hostNetwork }}
  45. hostPort: null
  46. {{ end }}
  47. - name: tcp
  48. containerPort: 22000
  49. protocol: TCP
  50. {{ if not .Values.hostNetwork }}
  51. hostPort: null
  52. {{ end }}
  53. - name: udp
  54. containerPort: 22000
  55. protocol: UDP
  56. {{ if not .Values.hostNetwork }}
  57. hostPort: null
  58. {{ end }}
  59. readinessProbe:
  60. httpGet:
  61. path: /rest/noauth/health
  62. port: 8384
  63. initialDelaySeconds: 10
  64. periodSeconds: 10
  65. timeoutSeconds: 5
  66. failureThreshold: 5
  67. successThreshold: 2
  68. livenessProbe:
  69. httpGet:
  70. path: /rest/noauth/health
  71. port: 8384
  72. initialDelaySeconds: 10
  73. periodSeconds: 10
  74. timeoutSeconds: 5
  75. failureThreshold: 5
  76. successThreshold: 1
  77. startupProbe:
  78. httpGet:
  79. path: /rest/noauth/health
  80. port: 8384
  81. initialDelaySeconds: 10
  82. periodSeconds: 5
  83. timeoutSeconds: 2
  84. failureThreshold: 60
  85. successThreshold: 1
  86. env:
  87. {{ $envList := (default list .Values.environmentVariables) }}
  88. {{ $envList = mustAppend $envList (dict "name" "PUID" "value" (printf "%d" (.Values.ownerUID | int))) }}
  89. {{ $envList = mustAppend $envList (dict "name" "PGID" "value" (printf "%d" (.Values.ownerGID | int))) }}
  90. {{ $envList = mustAppend $envList (dict "name" "STGUIADDRESS" "value" "0.0.0.0:8384") }}
  91. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  92. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  93. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  94. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  95. - name: extrappvolume-{{ $index }}
  96. hostPath:
  97. path: {{ $hostPathConfiguration.hostPath }}
  98. {{ end }}