Daniel means adding the webserver_config via your Dockerfile, so it is
always in any container from the start, e.g.

```
FROM apache/airflow:2.5.1

COPY webserver_config.py /opt/airflow
```

My "don't worry about reload, delete" was more of a general comment.
However you get your webserver_config into the container, don't spend time
trying to reload it in a running webserver, just delete the pod and let a
fresh one come up. You still need to get the webserver_config in the
container somehow (and not via `kubectl cp` or `kubectl exec`, but some way
that'll happen in new pods automatically). If you use `webserverConfig` in
the chart, or bake it into an image and you tag changes, the helm chart
will do the restart for you automatically.

I take it you are new to k8s, so let me say that `kubectl cp` and `kubectl
exec` should only be debugging aids. You really need things to be
durable/resilient to the unexpected happening. Your pods could be killed
because the node it's on comes under resource pressure, or the node itself
may die. Fresh pods should be ready to go by their config alone, with no
manual intervention needed. In this case, this means getting your
webserver_config into the image itself, or mounted into the container (via
a configmap or secret).

Hope that helps!

(p.s. I'm happy to chat on slack in #helm-chart-official about this stuff
as well)

Reply via email to