|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "discourse.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "discourse.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + {{- if not .Values.autoscaling.enabled }} |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + {{- end }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "discourse.selectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + {{- with .Values.podAnnotations }} |
| 17 | + annotations: |
| 18 | + {{- toYaml . | nindent 8 }} |
| 19 | + {{- end }} |
| 20 | + labels: |
| 21 | + {{- include "discourse.labels" . | nindent 8 }} |
| 22 | + {{- with .Values.podLabels }} |
| 23 | + {{- toYaml . | nindent 8 }} |
| 24 | + {{- end }} |
| 25 | + spec: |
| 26 | + {{- with .Values.imagePullSecrets }} |
| 27 | + imagePullSecrets: |
| 28 | + {{- toYaml . | nindent 8 }} |
| 29 | + {{- end }} |
| 30 | + serviceAccountName: {{ include "discourse.serviceAccountName" . }} |
| 31 | + {{- with .Values.podSecurityContext }} |
| 32 | + securityContext: |
| 33 | + {{- toYaml . | nindent 8 }} |
| 34 | + {{- end }} |
| 35 | + containers: |
| 36 | + - name: {{ .Chart.Name }} |
| 37 | + {{- with .Values.securityContext }} |
| 38 | + securityContext: |
| 39 | + {{- toYaml . | nindent 12 }} |
| 40 | + {{- end }} |
| 41 | + image: "{{ .Values.image.repository }}/{{ .Values.forum.name }}:{{ .Values.forum.version | default .Values.image.tag | default .Chart.AppVersion }}" |
| 42 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 43 | + ports: |
| 44 | + - name: http |
| 45 | + containerPort: 80 |
| 46 | + protocol: TCP |
| 47 | + - name: https |
| 48 | + containerPort: 443 |
| 49 | + protocol: TCP |
| 50 | + env: |
| 51 | + - name: DISCOURSE_HOSTNAME |
| 52 | + value: {{ .Values.env.DISCOURSE_HOSTNAME | quote }} |
| 53 | + - name: DISCOURSE_FORCE_HTTPS |
| 54 | + value: {{ .Values.env.DISCOURSE_FORCE_HTTPS | quote }} |
| 55 | + - name: RAILS_ENV |
| 56 | + value: {{ .Values.env.RAILS_ENV | quote }} |
| 57 | + - name: UNICORN_WORKERS |
| 58 | + value: {{ .Values.env.UNICORN_WORKERS | quote }} |
| 59 | + - name: UNICORN_SIDEKIQS |
| 60 | + value: {{ .Values.env.UNICORN_SIDEKIQS | quote }} |
| 61 | + - name: RUBY_GC_HEAP_GROWTH_MAX_SLOTS |
| 62 | + value: {{ .Values.env.RUBY_GC_HEAP_GROWTH_MAX_SLOTS | quote }} |
| 63 | + - name: RUBY_GC_HEAP_INIT_SLOTS |
| 64 | + value: {{ .Values.env.RUBY_GC_HEAP_INIT_SLOTS | quote }} |
| 65 | + - name: RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR |
| 66 | + value: {{ .Values.env.RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR | quote }} |
| 67 | + - name: LANG |
| 68 | + value: {{ .Values.env.LANG | quote }} |
| 69 | + - name: LC_ALL |
| 70 | + value: {{ .Values.env.LC_ALL | quote }} |
| 71 | + - name: LANGUAGE |
| 72 | + value: {{ .Values.env.LANGUAGE | quote }} |
| 73 | + - name: DISCOURSE_DB_SOCKET |
| 74 | + value: {{ .Values.env.DISCOURSE_DB_SOCKET | quote }} |
| 75 | + - name: LETSENCRYPT_DIR |
| 76 | + value: {{ .Values.env.LETSENCRYPT_DIR | quote }} |
| 77 | + {{- if .Values.smtp.address }} |
| 78 | + - name: DISCOURSE_SMTP_ADDRESS |
| 79 | + value: {{ .Values.smtp.address | quote }} |
| 80 | + - name: DISCOURSE_SMTP_PORT |
| 81 | + value: {{ .Values.smtp.port | quote }} |
| 82 | + {{- if .Values.smtp.username }} |
| 83 | + - name: DISCOURSE_SMTP_USER_NAME |
| 84 | + value: {{ .Values.smtp.username | quote }} |
| 85 | + {{- end }} |
| 86 | + {{- if .Values.smtp.password }} |
| 87 | + - name: DISCOURSE_SMTP_PASSWORD |
| 88 | + value: {{ .Values.smtp.password | quote }} |
| 89 | + {{- end }} |
| 90 | + {{- end }} |
| 91 | + {{- if .Values.developerEmails }} |
| 92 | + - name: DISCOURSE_DEVELOPER_EMAILS |
| 93 | + value: {{ .Values.developerEmails | quote }} |
| 94 | + {{- end }} |
| 95 | + {{- if .Values.letsencrypt.accountEmail }} |
| 96 | + - name: LETSENCRYPT_ACCOUNT_EMAIL |
| 97 | + value: {{ .Values.letsencrypt.accountEmail | quote }} |
| 98 | + {{- end }} |
| 99 | + volumeMounts: |
| 100 | + {{- if .Values.persistence.enabled }} |
| 101 | + - name: discourse-shared |
| 102 | + mountPath: /shared |
| 103 | + - name: discourse-logs |
| 104 | + mountPath: /var/log |
| 105 | + {{- end }} |
| 106 | + {{- with .Values.volumeMounts }} |
| 107 | + {{- toYaml . | nindent 12 }} |
| 108 | + {{- end }} |
| 109 | + {{- with .Values.livenessProbe }} |
| 110 | + livenessProbe: |
| 111 | + {{- toYaml . | nindent 12 }} |
| 112 | + {{- end }} |
| 113 | + {{- with .Values.readinessProbe }} |
| 114 | + readinessProbe: |
| 115 | + {{- toYaml . | nindent 12 }} |
| 116 | + {{- end }} |
| 117 | + {{- with .Values.resources }} |
| 118 | + resources: |
| 119 | + {{- toYaml . | nindent 12 }} |
| 120 | + {{- end }} |
| 121 | + volumes: |
| 122 | + {{- if .Values.persistence.enabled }} |
| 123 | + - name: discourse-shared |
| 124 | + persistentVolumeClaim: |
| 125 | + claimName: {{ include "discourse.fullname" . }}-shared |
| 126 | + - name: discourse-logs |
| 127 | + persistentVolumeClaim: |
| 128 | + claimName: {{ include "discourse.fullname" . }}-logs |
| 129 | + {{- end }} |
| 130 | + {{- with .Values.volumes }} |
| 131 | + {{- toYaml . | nindent 8 }} |
| 132 | + {{- end }} |
| 133 | + {{- with .Values.nodeSelector }} |
| 134 | + nodeSelector: |
| 135 | + {{- toYaml . | nindent 8 }} |
| 136 | + {{- end }} |
| 137 | + {{- with .Values.affinity }} |
| 138 | + affinity: |
| 139 | + {{- toYaml . | nindent 8 }} |
| 140 | + {{- end }} |
| 141 | + {{- with .Values.tolerations }} |
| 142 | + tolerations: |
| 143 | + {{- toYaml . | nindent 8 }} |
| 144 | + {{- end }} |
0 commit comments