Skip to content

Commit

Permalink
Fix ingress and secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
jbagot committed Oct 31, 2020
1 parent 9cb3fd5 commit a8b1f61
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 25 deletions.
1 change: 1 addition & 0 deletions helm/apf/templates/deployments/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
imagePullPolicy: {{ .Values.app.pullPolicy }}
command:
- invoke
- migrate
- uwsgi
- --port
- {{ .Values.app.container.port | quote }}
Expand Down
4 changes: 0 additions & 4 deletions helm/apf/templates/deployments/celery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ spec:
imagePullPolicy: {{ .Values.celery.pullPolicy }}
command:
- invoke
# - wait-for
# - redis-master:6379
# - wait-for
# - postgresql:5432
- celery-queues
envFrom:
- secretRef:
Expand Down
26 changes: 11 additions & 15 deletions helm/apf/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "apf.fullname" . -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
Expand All @@ -14,23 +10,23 @@ metadata:
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
cert-manager.io/cluster-issuer: {{ .Values.certificate.issuername | quote }}
spec:
backend:
serviceName: {{ $fullName }}
servicePort: {{ .Values.ingress.app.port }}
{{- if .Values.ingress.tls }}
tls:
secretName: {{ $fullName }}-cert
- secretName: {{ $fullName }}-cert
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ .serviceName }}
servicePort: {{ .servicePort }}
{{- end }}
{{- range .paths }}
- path: {{ .path }}
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ .servicePort }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions helm/apf/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ data:
# Postgres
POSTGRES_DB: {{ .Values.postgresql.postgresqlDatabase | b64enc | quote }}
POSTGRES_USER: {{ .Values.postgresql.postgresqlUsername | b64enc | quote }}
POSTGRES_HOST: {{ include "postgresql.fullname" . | b64enc | quote }}
POSTGRES_HOST: {{ printf "%s-postgresql" (include "apf.name" .) | b64enc | quote }}
POSTGRES_PORT: {{ .Values.postgresql.service.port | b64enc | quote }}
POSTGRES_PASSWORD: {{ required "postgres password is needed" .Values.postgresql.postgresqlPassword | b64enc | quote }}
# Celery
CELERY_BROKER_PROTOCOL: {{ .Values.celery.broker.protocol | b64enc | quote }}
CELERY_BROKER_HOST: {{ include "redis.fullname" . | b64enc | quote }}
CELERY_BROKER_HOST: {{ printf "%s-redis-master" (include "apf.name" .) | b64enc | quote }}
CELERY_BROKER_PORT: {{ .Values.redis.redisPort | b64enc | quote }}
CELERY_BROKER_DB: {{ .Values.redis.db | b64enc | quote }}
CELERY_REDIRECT_STDOUTS_LEVEL: {{ .Values.celery.stdouts_level | b64enc | quote }}
Expand Down
3 changes: 1 addition & 2 deletions helm/apf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ serviceAccount:
name: ""

ingress:
enabled: false
enabled: true
app:
port: 80
hosts:
- host: nemperfeina.cat
paths:
- path: /
serviceName: aaa
servicePort: 8000

certificate:
Expand Down
4 changes: 2 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def uwsgi(

command_args = [
"uwsgi",
"--chdir=..",
"--module=bff.config.wsgi:application",
"--chdir=.",
"--module=jobs.wsgi:application",
"--master",
listen,
f"--processes={workers}",
Expand Down

0 comments on commit a8b1f61

Please sign in to comment.