feat(charts/dex): add optional initContainers to deployment. #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This adds the possibility to configure
initContainers
for the deployment.What this PR does / why we need it
Connecting to Postgres using TLS with a client certificate requires the private key to have permission mode 0600.
We need to store the TLS certificates/keys as a Kubernetes Secret and mount that to the deployment.
That is currently not possible when running the process as non-root since
securityContext.fsGroup
only modifies the group ownership and willchmod g+r
the mounted files, thus makinggithub.com/lib/pq
reject the key due to bad permissions.With the help of an
initContainer
we can copy the files from the secret to another volume andchown
/chmod
them.This is the method we used with the old
dex
helm chart from thestable
repository and it's been working well for a couple of years.Closes: #9
The suggestions in that issue was to either use a mutating webhook or build a custom image. Neither works in our use case
since the cluster is too restricted to allow mutating webhooks and building a custom image would not solve the issue since
the root cause is in a library used by Dex.
Special notes for your reviewer
Checklist
Chart.yaml
(see the contributing guide for details)Chart.yaml
(see the contributing guide for details)make docs