Open jaolwi opened 7 months ago
One area where I would like to see some improved secrets management is for providing custom environment variables to Invenio. Today, custom environment variables can be added via a ConfigMap invenio-config
:
But there's no way to add custom values via a Secret instead.
I see no reason to keep the ConfigMap, I think that it can be replaced by a secret altogether (replacing configMapRef
with secretRef
in the example above). But if we want to keep it, we should at least add a Secret too!
EDIT: Scratch that! There's already a mechanism for that!! Just implemented a bit differently…
I absolutely agree with you. To make the whole thing even more flexible for the user, you could also implement it in this way:
values.yaml
## @param invenio.envFrom Load environment variables from kubernetes secret or config map to each invenio pod (web. worker, worker-beat)
##
envFrom: []
# - secretRef:
# name: env-secret
# - configMapRef:
# name: config-map
web-deployment.yaml
command:...
envFrom:
{{- with .Values.invenio.envFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:...
This means that the user is completely free to decide what he wants to add to the pod as env vars and from where.
I think that sounds great. Are we also aiming to distinguish between the envs for web and worker containers? Because today, it seems like both containers get the same variables added to them. Not sure if it's a big problem, just that it feels like an uncommon pattern and tight coupling.
Yes, I think it makes sense to implement this for the individual pods and to separate it. However, I am not yet familiar enough with the software to be able to say which env vars are necessary in the web and which in the worker or whether both always need the same ones.
I think the best way to handle this is to leave it up to the user whether he enters the password as plaintext in the values.yaml or integrates it via an existing secret. Here bitnami also has good examples. This procedure could also be useful for all backend service connection strings like postgresql.
Example: