Gaetan DELBART
06/18/2020, 12:30 PMdagster-k8s helm
.
1. In all the deployments, you use an init container using image: postgres:9.6.16
But, in production envs, we use an external database, using postgres 11.6
so, I had to manually change that to image: postgres:11.6
. Could we use a variable for the tag of this image ?
2. We don't use celery at all in our productions envs, and in the Values.yaml
file it is possible to disable celery
####################################################################################################
# Celery
####################################################################################################
celery:
# The Celery workers can be deployed with a fixed image (no user code included)
image:
repository: ""
tag: ""
pullPolicy: Always
enabled: true <- I've change this to false
So I added an {{ if .Values.celery.enabled }}
in deployment-celery.yaml
& to deployment-celery-extras.yaml
to prevent deployment of celery from happening
3. Since we don't use celery, I had to change the configmap-instance.yaml
, specifically the run_launcher
part. In fact, the class class: CeleryK8sRunLauncher
is hardcoded, and cannot be change, so I had to change this manually to class: K8sRunLauncher
& tweek the config a bit to be able to run pipeline directly in k8s-job. Maybe we could have a section in the values.yaml
to let the user choose what he want to use ?
Finally, we use traefik as our cluster router. and I've added some template to the helm release, to add routes to the dagit ui. Would you be interested in a PR to implement traefik in your helm repository ?Fran Sanchez
06/18/2020, 1:18 PMnate
06/18/2020, 3:27 PMRobert Lancer
06/18/2020, 4:38 PMGaetan DELBART
06/24/2020, 12:39 PMvalues.yaml
=>
In order to use traefik, I had to add some values in the values.yaml
traefik:
enabled: true
domain: <http://my-domain.com|my-domain.com>
ui_auth: user-pwd
Then I had to add a IngressRoute ( custom ressource for traefik)
{{- if .Values.traefik.enabled -}}
apiVersion: <http://traefik.containo.us/v1alpha1|traefik.containo.us/v1alpha1>
kind: IngressRoute
metadata:
name: {{ template "dagster.fullname" . }}-dagit
spec:
entryPoints:
- web
routes:
- match: Host(`dagit.{{ .Values.traefik.domain }}`) && PathPrefix(`/`)
kind: Rule
priority: 1
middlewares:
- name: traefik-auth
services:
- name: {{ include "dagster.dagit.fullname" . }}
port: 80
{{end}}
And a middleware ( for basic auth)
{{- if .Values.traefik.enabled -}}
apiVersion: <http://traefik.containo.us/v1alpha1|traefik.containo.us/v1alpha1>
kind: Middleware
metadata:
name: traefik-auth
spec:
basicAuth:
secret: traefik-credentials
removeHeader: true
{{end}}
@Robert Lancer Not sure about that, since traefik 2.0 use "Ingress Route" which are Custom Ressource DefinitonAdrian
01/07/2021, 6:57 PMvalues.yml