deployment.yaml 3.2 KB

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