ricoberger / vault-secrets-operator

Create Kubernetes secrets from Vault for a secure GitOps based workflow.
MIT License
633 stars 103 forks source link

Support initContainers #183

Closed ejsuncy closed 1 year ago

ejsuncy commented 1 year ago

This adds backwards-compatible support for injecting arbitrary initContainers as a template. Turning on .Values.includeInitContainers will cause the vault-secrets-operator.initContainers template to be injected into the deployment template spec. I included sample usage in the comment where the vault-secrets-operator.initContainers template is defined. Using that sample and turning on .Values.includeInitContainers injects the initContainers as follows:

image
ejsuncy commented 1 year ago

This may conflict with the open PR #86 if that ever gets merged, though it is several years old. This approach supports the functionality proposed in that PR as well, but in a more flexible way (that other PR doesn't support additional initContainers)

ejsuncy commented 1 year ago

In a previous PR #108 I added support for sidecar containers. In my deployment I added a fluent bit sidecar container that forwards VSO logs to splunk, and the need has come up to be able to pre-process a configmap, which I can do in an initContainer for the pod.

ejsuncy commented 1 year ago

@ricoberger what do you think about this? If it looks good, do you have a regular release cadence I can expect to see these changes in? Thx!

ricoberger commented 1 year ago

Hi @ejsuncy and thanks for your contribution 🙂. Can you bump the version in the Chart.yaml file please, then it will automatically create a new release for the Helm chart when the PR is merged.

ejsuncy commented 1 year ago

@ricoberger since it's a minor, backwards-compatible change, I'm assuming the new version should be a minor one (2.0.1 -> 2.1.0)?

ricoberger commented 1 year ago

@ricoberger since it's a minor, backwards-compatible change, I'm assuming the new version should be a minor one (2.0.1 -> 2.1.0)?

Yes, thank you 🙂. The new Helm chart version should be available now.