feat(chart): make dind container template configurable
In addition to the pre-populated values for the dind container template parse spec from Values.template.spec.containers["dind"] to enable users to add config
@nikola-jokic, can we get this merged? It's only a small helmchart change, but would make life much easier for us.
I also would like to specify additional args to each container. Would it be preferred to make args completely overridable, or rather have special values for each separate container like {dind|runner|init}ContainerExtraArgs, that are appended to the default args?
Just give me opinions and I'll add it.
Hey @norman-zon,
We decided not to allow customizations in the default template. The reason behind this decision is that customization should either work for all fields, or no fields. So at this time, we decided to proceed with the following:
- containerMode applies the default, out-of-box specification only
- If any customization is needed, we documented the expanded spec, so you can uncomment the spec that would be used if containerMode is applied, and customize it however you'd like
Hi @nikola-jokic, thanks for explaining the design decision.
First of all I overlooked the line
If any customization is required for dind or kubernetes mode, containerMode should remain empty, and configuration should be applied to the template
and thought it would not be possible to override the template completely.
Regarding the everything-or-nothing policy, this does not seem to be consistent, because you already allow setting certain customisations for the runner container.
Setting the template as a whole might be the straight-forward approach to customisation, but requires me to check the helmrelease for changed default templates on every update, to avoid breaking things, or missing important changes (like the recent change of the docker socket for example). Also, isn't partial templating the whole point of using helm?
I would suggest to switch to using extra... values to customise the default template like I've seen in many helmcharts and what seem to be canon in the helm world.
So we could end up with something like:
runnerPod:
extraVolumes: []
runnerContainer:
extraArgs: []
extraEnv: []
exraVolumeMounts: []
...
dindContainer:
extraArgs: []
...
...
I'd be happy to write a PR for that. What do you think?
Is there a way to specify a different image instead of being hardcoded?
docker:dind is coming from Dockerhub, for which we do not have the token for rate limiting purposes, but we do use the public ECR one.
However, given the current template, it is impossible to override the image from the values, so I need to unset containermode, and basically copy/paste the expected outcome as a configuration in the values