{{- if .Values.audiencias.enabled }} {{- $edemoUrl := .Values.edemocracia.hostname -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "edemocracia.fullname" . }}-audienciasweb labels: {{- include "edemocracia.labels" . | nindent 4 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb spec: selector: matchLabels: {{- include "edemocracia.selectorLabels" . | nindent 6 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb app.kubernetes.io/component: audiencias strategy: type: Recreate template: metadata: labels: {{- include "edemocracia.selectorLabels" . | nindent 8 }} io.kompose.service: {{ include "edemocracia.fullname" . }}-audienciasweb app.kubernetes.io/component: audiencias spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} containers: - name: {{ include "edemocracia.fullname" . }}-audienciasweb image: "{{ .Values.audiencias.image.repository }}:{{ .Values.audiencias.image.tag }}" imagePullPolicy: {{ .Values.audiencias.image.pullPolicy }} 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: ALLOWED_HOSTS value: audienciasweb, localhost, 127.0.0.1, "{{ $edemoUrl }}" - name: COMPRESS_OFFLINE value: "True" - name: DATABASE_ENGINE value: postgresql_psycopg2 - name: DATABASE_HOST value: {{ (include "postgresql.fullname" .) }} - name: DATABASE_NAME value: audiencias - name: DATABASE_PASSWORD value: {{ .Values.postgresql.postgresqlPassword | quote }} - name: DATABASE_PORT value: "5432" - name: DATABASE_USER value: {{ .Values.postgresql.postgresqlUsername | quote }} - name: DEBUG value: "False" - name: DEFAULT_FROM_EMAIL value: '"Portal e-Democracia[audiencias]" <{{ .Values.edemocracia.admin.email }}>' - name: DJANGO_SECRET_KEY value: {{ .Values.edemocracia.apikey | quote }} - name: EMAIL_HOST value: {{ .Values.smtp.host | quote }} - name: EMAIL_HOST_PASSWORD value: {{ .Values.smtp.password | quote }} - name: EMAIL_HOST_USER value: {{ .Values.smtp.username | quote }} - name: EMAIL_PORT value: {{ .Values.smtp.port | quote }} - name: EMAIL_USE_TLS value: {{ .Values.smtp.tls | quote}} - name: ENABLE_REMOTE_USER value: "True" - name: FORCE_SCRIPT_NAME value: /audiencias - name: GOOGLE_ANALYTICS_ID value: {{ .Values.edemocracia.googleAnalyticsId | quote }} - name: LOGIN_REDIRECT_URL value: / - name: LOGIN_URL value: / - name: LOGOUT_REDIRECT_URL value: / - name: NOTIFICATION_EMAIL_LIST value: "{{ .Values.edemocracia.admin.email }},{{ .Values.audiencias.notifEmailList }}" - name: OLARK_ID value: {{ .Values.edemocracia.olarkId | quote }} - name: RECAPTCHA_PRIVATE_KEY value: {{ .Values.edemocracia.recaptcha.privateKey | quote }} - name: RECAPTCHA_SITE_KEY value: {{ .Values.edemocracia.recaptcha.siteKey | quote }} - name: REDIS_SERVER value: {{ (include "redis.fullname" .) }}-master - name: SESSION_COOKIE_NAME value: audiencias_session - name: SITE_DOMAIN value: "{{ $edemoUrl }}" - name: SITE_NAME value: {{ .Values.edemocracia.siteName | quote }} - name: STATIC_URL value: /audiencias/static/ - name: URL_PREFIX value: audiencias - name: WEBSERVICE_URL value: {{ .Values.audiencias.webservice.url | quote }} - name: WORDS_BLACK_LIST value: {{ .Values.audiencias.wordsBlacklist | quote }} resources: {{- toYaml .Values.audiencias.resources | nindent 12 }} volumeMounts: - mountPath: /var/labhacker/audiencias/public/ name: {{ include "edemocracia.fullname" . }}-audiencias restartPolicy: Always serviceAccountName: "" volumes: - name: {{ include "edemocracia.fullname" . }}-audiencias persistentVolumeClaim: claimName: {{ include "edemocracia.fullname" . }}-audiencias {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: - {{ include "edemocracia.name" . }} - key: app.kubernetes.io/instance operator: In values: - {{ .Release.Name }} - key: app.kubernetes.io/component operator: In values: - edemocracia topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- end }}