colima icon indicating copy to clipboard operation
colima copied to clipboard

Support patching base containerd config

Open jmcshane opened this issue 2 years ago • 4 comments

I am working with colima to develop local development workflows in golang. One of the challenges here is that the VM that colima spins up from https://github.com/abiosoft/alpine-lima has the base containerd config file present on the host at startup time. This means the generated lima.yaml configfile has the containerd settings turned off and does not do the default overrides present in https://github.com/lima-vm/lima/blob/master/pkg/cidata/cidata.TEMPLATE.d/boot/40-install-containerd.sh.

I'd love to have a workflow that looks like the kind cluster patches that allows me to configure the containerd plugin settings: https://kind.sigs.k8s.io/docs/user/local-registry/#create-a-cluster-and-registry. I can definitely help contribute here if pointed in the right direction, but wanted to get some input from the maintainers before proceeding.

I am also using an M1 Mac, and I'm developing workflows on top of colima. Would love to help testing in certain areas of need!

jmcshane avatar Mar 09 '22 19:03 jmcshane

The lima-provided containerd actually requires systemd as can be seen here. However, systemd is missing on Alpine.

If you mainly need to configure the underlying containerd, that can be easily supported by following a similar pattern to Docker config as specified in the readme.

On first startup, Colima generates Docker daemon.json file at $HOME/.colima/docker/daemon.json. Simply modify the daemon.json file accordingly and restart Colima.

Will that suffice or there are additional requirements?

Thanks.

abiosoft avatar Mar 09 '22 20:03 abiosoft

Thanks for the response, the motivation for avoiding the lima-provided settings makes sense.

I think restarting colima would be an acceptable workflow after editing the containerd config.toml file.

jmcshane avatar Mar 09 '22 21:03 jmcshane

ok, im looking into the code here for the docker daemon and i do wonder if we need some default settings in the containerd config.toml for it to start up successfully. looks like the default settings for containerd (with a missing config.toml file) do not match the current /etc/containerd/config.toml (for example, default uses the rancher pause container instead of gcr.k8s.io)

jmcshane avatar Mar 09 '22 21:03 jmcshane

ok, im looking into the code here for the docker daemon and i do wonder if we need some default settings in the containerd config.toml for it to start up successfully. looks like the default settings for containerd (with a missing config.toml file) do not match the current /etc/containerd/config.toml (for example, default uses the rancher pause container instead of gcr.k8s.io)

considering the amount of config in case of containerd unlike docker, I would be prefer to rely on the default one generated by containerd rather than roll one ourselves.

abiosoft avatar Mar 10 '22 04:03 abiosoft