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.
132 lines
5.5 KiB
132 lines
5.5 KiB
{{- if .Values.discourse.enabled }}
|
|
{{- $edemoUrl := .Values.edemocracia.hostname -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "edemocracia.fullname" . }}-discourse
|
|
labels:
|
|
{{- include "edemocracia.labels" . | nindent 4 }}
|
|
io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "edemocracia.selectorLabels" . | nindent 6 }}
|
|
io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "edemocracia.selectorLabels" . | nindent 8 }}
|
|
io.kompose.service: {{ include "edemocracia.fullname" . }}-discourse
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
initContainers:
|
|
- image: "{{ .Values.discourse.image.repository }}:{{ .Values.discourse.image.tag }}"
|
|
name: {{ include "edemocracia.fullname" . }}-discourse-cpimgs
|
|
command:
|
|
- "cp"
|
|
- "-au"
|
|
- "/var/www/discourse/public/images/."
|
|
- "/publicimgs/"
|
|
volumeMounts:
|
|
- mountPath: /publicimgs/
|
|
name: {{ include "edemocracia.fullname" . }}-discourse-img
|
|
containers:
|
|
- args:
|
|
- ./start-web.sh
|
|
env:
|
|
- name: ADMIN_EMAIL
|
|
value: {{ .Values.edemocracia.admin.email | quote }}
|
|
- name: ADMIN_PASSWORD
|
|
value: {{ .Values.edemocracia.admin.password | quote }}
|
|
- name: ADMIN_USERNAME
|
|
value: admin
|
|
- name: DISCOURSE_CONTACT_EMAIL
|
|
value: {{ .Values.edemocracia.admin.email | quote }}
|
|
- name: DISCOURSE_CONTACT_URL
|
|
value: {{ $edemoUrl }}
|
|
- name: DISCOURSE_DB_HOST
|
|
value: {{ (include "postgresql.fullname" .) }}
|
|
- name: DISCOURSE_DB_NAME
|
|
value: discourse
|
|
- name: DISCOURSE_DB_PASSWORD
|
|
value: {{ .Values.postgresql.postgresqlPassword | quote }}
|
|
- name: DISCOURSE_DB_PORT
|
|
value: "5432"
|
|
- name: DISCOURSE_DB_USERNAME
|
|
value: {{ .Values.postgresql.postgresqlUsername | quote}}
|
|
- name: DISCOURSE_DEVELOPER_EMAILS
|
|
- name: DISCOURSE_FORCE_HOSTNAME
|
|
value: {{ $edemoUrl }}\/expressao
|
|
- name: DISCOURSE_HOSTNAME
|
|
value: {{ $edemoUrl }}\/expressao
|
|
- name: DISCOURSE_NOTIFICATION_EMAIL
|
|
value: {{ .Values.edemocracia.admin.email }}
|
|
- name: DISCOURSE_REDIS_HOST
|
|
value: {{ (include "redis.fullname" .) }}-master
|
|
- name: DISCOURSE_REDIS_PORT
|
|
value: "6379"
|
|
- name: DISCOURSE_RELATIVE_URL_ROOT
|
|
value: /expressao
|
|
- name: DISCOURSE_SMTP_ADDRESS
|
|
value: {{ .Values.smtp.host | quote }}
|
|
- name: DISCOURSE_SMTP_PASSWORD
|
|
value: {{ .Values.smtp.password | quote }}
|
|
- name: DISCOURSE_SMTP_PORT
|
|
value: {{ .Values.smtp.port | quote }}
|
|
- name: DISCOURSE_SMTP_USER_NAME
|
|
value: {{ .Values.smtp.username | quote }}
|
|
- name: DISCOURSE_SSO_SECRET
|
|
value: {{ .Values.discourse.sso.secret | quote }}
|
|
- name: DISCOURSE_SSO_URL
|
|
value: "https://{{ $edemoUrl }}"
|
|
- name: RAILS_ENV
|
|
value: production
|
|
image: {{.Values.discourse.image.repository}}:{{ .Values.discourse.image.tag }}
|
|
imagePullPolicy: {{ .Values.discourse.image.pullPolicy }}
|
|
name: {{ include "edemocracia.fullname" . }}-discourse
|
|
ports:
|
|
- containerPort: 8080
|
|
resources:
|
|
{{- toYaml .Values.discourse.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- mountPath: /var/www/discourse/public/assets/
|
|
name: {{ include "edemocracia.fullname" . }}-discourse-assets
|
|
- mountPath: /var/www/discourse/public/javascripts/
|
|
name: {{ include "edemocracia.fullname" . }}-discourse-js
|
|
- mountPath: /var/www/discourse/public/images/
|
|
name: {{ include "edemocracia.fullname" . }}-discourse-img
|
|
- mountPath: /var/www/discourse/tmp/stylesheet-cache/
|
|
name: {{ include "edemocracia.fullname" . }}-discourse-cache
|
|
restartPolicy: Always
|
|
serviceAccountName: ""
|
|
volumes:
|
|
- name: {{ include "edemocracia.fullname" . }}-discourse-assets
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "edemocracia.fullname" . }}-discourse-assets
|
|
- name: {{ include "edemocracia.fullname" . }}-discourse-js
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "edemocracia.fullname" . }}-discourse-js
|
|
- name: {{ include "edemocracia.fullname" . }}-discourse-img
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "edemocracia.fullname" . }}-discourse-img
|
|
- name: {{ include "edemocracia.fullname" . }}-discourse-cache
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "edemocracia.fullname" . }}-discourse-cache
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|