You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.5 KiB

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "wiki.fullname" . }}
  5. labels:
  6. {{- include "wiki.labels" . | nindent 4 }}
  7. spec:
  8. replicas: {{ .Values.replicaCount }}
  9. selector:
  10. matchLabels:
  11. {{- include "wiki.selectorLabels" . | nindent 6 }}
  12. template:
  13. metadata:
  14. labels:
  15. {{- include "wiki.selectorLabels" . | nindent 8 }}
  16. spec:
  17. {{- with .Values.imagePullSecrets }}
  18. imagePullSecrets:
  19. {{- toYaml . | nindent 8 }}
  20. {{- end }}
  21. serviceAccountName: {{ include "wiki.serviceAccountName" . }}
  22. securityContext:
  23. {{- toYaml .Values.podSecurityContext | nindent 8 }}
  24. containers:
  25. - name: {{ .Chart.Name }}
  26. securityContext:
  27. {{- toYaml .Values.securityContext | nindent 12 }}
  28. image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
  29. imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
  30. env:
  31. - name: DB_TYPE
  32. value: postgres
  33. - name: DB_HOST
  34. value: {{ template "wiki.postgresql.host" . }}
  35. - name: DB_PORT
  36. value: "{{ default "5432" .Values.postgresql.postgresqlPort }}"
  37. - name: DB_NAME
  38. value: {{ default "wiki" .Values.postgresql.postgresqlDatabase }}
  39. - name: DB_USER
  40. value: {{ default "wiki" .Values.postgresql.postgresqlUser }}
  41. - name: DB_PASS
  42. valueFrom:
  43. secretKeyRef:
  44. {{- if .Values.postgresql.existingSecret }}
  45. name: {{ .Values.postgresql.existingSecret }}
  46. {{- else }}
  47. name: {{ template "wiki.postgresql.secret" . }}
  48. {{- end }}
  49. key: {{ template "wiki.postgresql.secretKey" . }}
  50. ports:
  51. - name: http
  52. containerPort: 3000
  53. protocol: TCP
  54. livenessProbe:
  55. httpGet:
  56. path: /healthz
  57. port: http
  58. readinessProbe:
  59. httpGet:
  60. path: /healthz
  61. port: http
  62. resources:
  63. {{- toYaml .Values.resources | nindent 12 }}
  64. {{- with .Values.nodeSelector }}
  65. nodeSelector:
  66. {{- toYaml . | nindent 8 }}
  67. {{- end }}
  68. {{- with .Values.affinity }}
  69. affinity:
  70. {{- toYaml . | nindent 8 }}
  71. {{- end }}
  72. {{- with .Values.tolerations }}
  73. tolerations:
  74. {{- toYaml . | nindent 8 }}
  75. {{- end }}