Add support for extra objects and env vars
What does this MR do?
- Adds support for extra environment variables, specified as key value pairs rather than lists to support merging Helm value files and
--set
args. - Enables environment variables to be sourced from secrets or other resources.
- Adds support for extra K8s manifests to support ExternalSecrets or SealedSecrets.
Why was this MR needed?
The existing envVars key uses YAML lists, which make it difficult to set specific env vars using the helm --set
command. When using Helm in this manner, env vars must contain the index, and values cannot be merged unless the index for environment var is known ahead of time.
Example
Given the following values.yaml
file, using helm --set envVars[0].name=CACHE_SHARED
will overwrite the RUNNER_EXECUTOR envVar.
# gitlab-runner values.yaml
envVars:
- name: RUNNER_EXECUTOR
value: kubernetes
extraObjects
As for the extraObjects, this enables the creation of ExternalSecret or SealedSecrets that are deployed alongside the Chart to create the runner-token secret. ExternalSecret and SealedSecrets can safely be checked into the git repository as the secret is either encrypted or sourced from another location.
What's the best way to test this MR?
Uncomment the relevant code in the values.yaml
file.
What are the relevant issue numbers?
N/A