deployment.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.host_network }}
  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. readOnly: {{ $hostPathConfiguration.readOnly | default false }}
  47. {{ end }}
  48. ports:
  49. - name: web
  50. containerPort: {{ .Values.web_port }}
  51. readinessProbe:
  52. httpGet:
  53. path: /
  54. port: {{ .Values.web_port }}
  55. initialDelaySeconds: 10
  56. periodSeconds: 10
  57. timeoutSeconds: 5
  58. failureThreshold: 5
  59. successThreshold: 2
  60. livenessProbe:
  61. httpGet:
  62. path: /
  63. port: {{ .Values.web_port }}
  64. initialDelaySeconds: 10
  65. periodSeconds: 10
  66. timeoutSeconds: 5
  67. failureThreshold: 5
  68. successThreshold: 1
  69. startupProbe:
  70. httpGet:
  71. path: /
  72. port: {{ .Values.web_port }}
  73. initialDelaySeconds: 10
  74. periodSeconds: 5
  75. timeoutSeconds: 2
  76. failureThreshold: 60
  77. successThreshold: 1
  78. env:
  79. {{ $secretName := (include "common.names.fullname" .) }}
  80. {{ $envList := (default list .Values.environmentVariables) }}
  81. {{ $envList = mustAppend $envList (dict "name" "PHOTOPRISM_HTTP_PORT" "value" .Values.web_port) }}
  82. {{ $envList = mustAppend $envList (dict "name" "PHOTOPRISM_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
  83. {{ if .Values.public }}
  84. {{ $envList = mustAppend $envList (dict "name" "PHOTOPRISM_PUBLIC" "value" "true") }}
  85. {{ end }}
  86. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  87. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  88. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  89. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  90. - name: extrappvolume-{{ $index }}
  91. hostPath:
  92. path: {{ $hostPathConfiguration.hostPath }}
  93. {{ end }}