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.7 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_SSL
  42. value: "{{ default "false" .Values.postgresql.ssl }}"
  43. - name: DB_SSL_CA
  44. value: "{{ default "" .Values.postgresql.ca }}"
  45. - name: DB_PASS
  46. valueFrom:
  47. secretKeyRef:
  48. {{- if .Values.postgresql.existingSecret }}
  49. name: {{ .Values.postgresql.existingSecret }}
  50. {{- else }}
  51. name: {{ template "wiki.postgresql.secret" . }}
  52. {{- end }}
  53. key: {{ template "wiki.postgresql.secretKey" . }}
  54. ports:
  55. - name: http
  56. containerPort: 3000
  57. protocol: TCP
  58. livenessProbe:
  59. {{- toYaml .Values.livenessProbe | nindent 12 }}
  60. readinessProbe:
  61. {{- toYaml .Values.readinessProbe | nindent 12 }}
  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 }}