deployment.yaml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. {{- if hasKey .Values "global" }}
  32. {{- if hasKey .Values.global "ixChartContext" }}
  33. {{- if .Values.global.ixChartContext.addNvidiaRuntimeClass }}
  34. runtimeClassName: {{ .Values.global.ixChartContext.nvidiaRuntimeClassName }}
  35. {{- end }}
  36. {{- end }}
  37. {{- end }}
  38. containers:
  39. - name: {{ .Chart.Name }}
  40. {{ include "common.resources.limitation" . | nindent 10 }}
  41. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  42. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  43. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  44. - name: extrappvolume-{{ $index }}
  45. mountPath: {{ $hostPathConfiguration.mountPath }}
  46. {{ end }}
  47. ports:
  48. - name: web
  49. containerPort: 2342
  50. readinessProbe:
  51. httpGet:
  52. path: /
  53. port: 2342
  54. initialDelaySeconds: 10
  55. periodSeconds: 10
  56. timeoutSeconds: 5
  57. failureThreshold: 5
  58. successThreshold: 2
  59. livenessProbe:
  60. httpGet:
  61. path: /
  62. port: 2342
  63. initialDelaySeconds: 10
  64. periodSeconds: 10
  65. timeoutSeconds: 5
  66. failureThreshold: 5
  67. successThreshold: 1
  68. startupProbe:
  69. httpGet:
  70. path: /
  71. port: 2342
  72. initialDelaySeconds: 10
  73. periodSeconds: 5
  74. timeoutSeconds: 2
  75. failureThreshold: 60
  76. successThreshold: 1
  77. env:
  78. {{ $secretName := (include "common.names.fullname" .) }}
  79. {{ $envList := (default list .Values.environmentVariables) }}
  80. {{ $envList = mustAppend $envList (dict "name" "PHOTOPRISM_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
  81. {{ if .Values.public }}
  82. {{ $envList = mustAppend $envList (dict "name" "PHOTOPRISM_PUBLIC" "value" "true") }}
  83. {{ end }}
  84. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  85. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  86. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  87. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  88. - name: extrappvolume-{{ $index }}
  89. hostPath:
  90. path: {{ $hostPathConfiguration.hostPath }}
  91. {{ end }}