actions-runner-controller icon indicating copy to clipboard operation
actions-runner-controller copied to clipboard

feat(chart): make dind container template configurable

Open norman-zon opened this issue 1 year ago • 5 comments

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

norman-zon avatar Jan 10 '24 12:01 norman-zon

@nikola-jokic, can we get this merged? It's only a small helmchart change, but would make life much easier for us.

norman-zon avatar Mar 27 '24 08:03 norman-zon

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.

norman-zon avatar Apr 17 '24 12:04 norman-zon

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:

  1. containerMode applies the default, out-of-box specification only
  2. 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

nikola-jokic avatar Apr 18 '24 12:04 nikola-jokic

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?

norman-zon avatar Apr 18 '24 14:04 norman-zon

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

AmitBenAmi avatar May 15 '24 19:05 AmitBenAmi