kind icon indicating copy to clipboard operation
kind copied to clipboard

extra_mounts: Support docker --mount parameter in addition to current --volume

Open an-dr-eas-k opened this issue 1 year ago • 3 comments

What would you like to be added: currently the configuration for the extra_mounts config structure is translated in the docker argument --volume with syntax --volume=host_path:container_path. I followed the guide here https://kind.sigs.k8s.io/docs/user/local-registry/ and wanted to terraform the process. I am now stuck at the point to dynamically mount my local config dir to the container directory with name /etc/containerd/certs.d/localhost:5001/. The colon in the directory name cannot be mapped with the --volume argument.

I suggest an additional extra_mounts structure that is translated to the --mount parameter of docker.

Why is this needed: Doing so would allow colons in directory names.

an-dr-eas-k avatar Jan 05 '24 09:01 an-dr-eas-k

xref: https://github.com/kubernetes-sigs/kind/issues/1966

This is probably happening in some future API revision, subject to bandwidth.

FWIW I recommend mounting the whole [..]certs.d/

BenTheElder avatar Jan 08 '24 18:01 BenTheElder

thanks, that helps!

an-dr-eas-k avatar Jan 09 '24 08:01 an-dr-eas-k

Notes to anyone looking at this:

  • We have provisional support for both podman and nerdctl, any design has to include these
  • We very much avoid breaking behavior changes where possible, it's likely that these flags have subtle behavior differences, so we'll have to consider that. On the other hand we probably don't want to make --volume any more a part of the API than it already is, as this is pretty leaky to docker/podman/... and wasn't the intent (originally we intended to provide the ability to bind mount test configurations)
  • There is more discussion in https://github.com/kubernetes-sigs/kind/issues/1966 and further issues linked from there

BenTheElder avatar Jun 21 '24 00:06 BenTheElder