Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow extra mounts for docker-based talosctl cluster create #9639

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

smira
Copy link
Member

@smira smira commented Nov 5, 2024

Fixes #9607

Use docker CLI syntax, support any kind of mounts supported by docker CLI.

Also drop modules from talos container image, as it's useless to provide modules in container mode.

Fixes siderolabs#9607

Use docker CLI syntax, support any kind of mounts supported by docker
CLI.

Also drop modules from `talos` container image, as it's useless to
provide modules in container mode.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira smira added this to the v1.9 milestone Nov 5, 2024
@smira
Copy link
Member Author

smira commented Nov 5, 2024

/m

@talos-bot talos-bot merged commit 05c6209 into siderolabs:main Nov 5, 2024
50 checks passed
@PhilipSchmid
Copy link

@smira Thanks a lot for implementing this! Is there any chance there's a (nightly?/PR?) build of talosctl that I could test to see if it resolves the issues for all Talos-in-Docker Cilium users?

@smira
Copy link
Member Author

smira commented Nov 7, 2024

@smira Thanks a lot for implementing this! Is there any chance there's a (nightly?/PR?) build of talosctl that I could test to see if it resolves the issues for all Talos-in-Docker Cilium users?

we don't publish talosctl as artifacts, but you can either build it yourself, or pull it out of the ghcr.io/siderolabs/talosctl:latest container (if you're on Linux)

@PhilipSchmid
Copy link

Thanks! In the meanwhile I was able to build it locally using make talosctl-darwin-arm64. Now I just need to figure out the correct syntax.

./_out/talosctl-darwin-arm64 cluster create \
  --mount /lib/modules:/lib/modules \
  --controlplanes 1 \
  --workers 0 \
  --kubernetes-version 1.31.0 \
  --image ghcr.io/siderolabs/talos:v1.8.0 \
  --install-image ghcr.io/siderolabs/installer:v1.8.0 \
  --config-patch-control-plane @07-talos-local-cluster-patch.yaml \
  --config-patch-control-plane '[{"op": "remove", "path": "/cluster/apiServer/admissionControl"}]' \
  --docker-disable-ipv6 \
  --skip-k8s-node-readiness-check
invalid argument "/lib/modules:/lib/modules" for "--mount" flag: invalid field '/lib/modules:/lib/modules' must be a key=value pair

Something like --mount /lib/modules or --mount /lib/modules:/lib/modules didn't work so far.

@smira
Copy link
Member Author

smira commented Nov 7, 2024

The command accepts exactly same syntax as docker CLI, e.g. --mount source=/lib/modules,target=/lib/modules,type=bind,readonly (you were using -v syntax which is obsolete).

@PhilipSchmid
Copy link

Thanks, Andrey, that worked 🎉

$ ./_out/talosctl-darwin-arm64 cluster create \
  --mount source=/lib/modules,target=/lib/modules,type=bind,readonly \
  --controlplanes 1 \
  --workers 0 \
  --kubernetes-version 1.31.0 \
  --image ghcr.io/siderolabs/talos:v1.8.0 \
  --install-image ghcr.io/siderolabs/installer:v1.8.0 \
  --config-patch-control-plane @07-talos-local-cluster-patch.yaml \
  --config-patch-control-plane '[{"op": "remove", "path": "/cluster/apiServer/admissionControl"}]' \
  --docker-disable-ipv6 \
  --skip-k8s-node-readiness-check
...
$ k exec -it cilium-255mh -- /bin/bash
root@talos-default-controlplane-1:/home/cilium# mount | grep /lib/modules
/dev/vdb on /usr/lib/modules type erofs (ro,relatime,user_xattr,acl,cache_strategy=readaround)
root@talos-default-controlplane-1:/home/cilium# uname -r
6.10.4-linuxkit
root@talos-default-controlplane-1:/home/cilium# ls -la /lib/modules/
total 3680
drwxr-xr-x 3 root root     169 Oct  2 20:20 .
drwxr-xr-x 1 root root    4096 Nov  7 12:01 ..
drwxr-xr-x 2 root root     415 Oct  2 20:20 6.10.4-linuxkit
-rw-r--r-- 1 root root 1741336 Oct  2 16:39 fakeowner.ko
-rw-r--r-- 1 root root  356888 Oct  2 16:39 grpcfuse.ko
-rw-r--r-- 1 root root  267912 Oct  2 16:39 rosetta.ko
-rw-r--r-- 1 root root  690392 Oct  2 16:39 selfowner.ko
-rw-r--r-- 1 root root  684792 Oct  2 16:39 shiftfs.ko
root@talos-default-controlplane-1:/home/cilium# ls -la /lib/modules/6.10.4-linuxkit/modules.builtin
-rw-r--r-- 1 root root 20295 Oct  2 16:38 /lib/modules/6.10.4-linuxkit/modules.builtin

@smira smira mentioned this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backported
Development

Successfully merging this pull request may close these issues.

Support custom (Docker) bind mounts for Talos-in-Docker clusters
4 participants