adamant-kite-43734
08/01/2023, 8:28 AMwide-garage-9465
08/01/2023, 9:00 AMk3d cluster create
command as the command of the DinD container. Though you'll have to add something there that keeps the container running then.wide-garage-9465
08/01/2023, 9:01 AMthankful-insurance-4058
08/01/2023, 10:04 AMput thewas my first intention, but it seems to override default command for container, andcommand as the command of the DinD containerk3d cluster create
docker-entrypoint-initdb.d
is not started then (docker agent becomes inaccessible and container dies after few tries).thankful-insurance-4058
08/01/2023, 10:09 AMWhat's your use case for k3d DinD even?I need a local development environment for multi-layer api-gateway configurations (with kong). So intention is to start k8s cluster in container and have another container to apply helm charts against this cluster, with helm chart values being provided from mounted volume for this container. As I want it to be portable and reusable, the only requirement for host machine is working docker/docker-compose, without platform-specific k3d binaries, so I decided to go with k3d-dind, and so far it seems promising, just want to make setup less manual.
wide-garage-9465
08/01/2023, 10:20 AMwide-garage-9465
08/01/2023, 10:20 AMthankful-insurance-4058
08/01/2023, 10:21 AMwide-garage-9465
08/01/2023, 10:22 AMwide-garage-9465
08/01/2023, 10:24 AMthankful-insurance-4058
08/01/2023, 10:25 AMdocker ps
on host machine would show running agents/servers containers?wide-garage-9465
08/01/2023, 10:25 AMthankful-insurance-4058
08/01/2023, 10:26 AMwide-garage-9465
08/01/2023, 10:28 AMalias k3d='docker run -v docker.sock:docker.sock k3d:v5
(adjust socket paths and image, then as usual do k3d cluster create
and either you have the config mounted as well or pass it on via stdin.
I'm on my phone so I didn't test anything of thisthankful-insurance-4058
08/01/2023, 10:40 AMthankful-insurance-4058
08/01/2023, 12:42 PMdocker run -v /var/run/docker.sock:/var/run/docker.sock -v "$(pwd)/k3d:/k3d" <http://ghcr.io/k3d-io/k3d:5.5.1|ghcr.io/k3d-io/k3d:5.5.1> cluster create --config /k3d/k3d-cluster-config.yml
FATA[0000] error creating temp copy of configfile /k3d/k3d-cluster-config.yml for variable expansion: open /tmp/k3d-config-tmp-k3d-cluster-config.yml3060607825: no such file or directory
Error comes from here. I am pretty sure it is related to the fact that in scratch image there is no temp dir and powers to write to it. I made a workaround by mounting my volume to /tmp/
directory, as upon container creation it can be written, and it worked. I didn't find similarities under github issues. Should I open a PR?thankful-insurance-4058
08/02/2023, 9:55 AMwide-garage-9465
08/02/2023, 11:18 AMwide-garage-9465
08/02/2023, 11:19 AMscratch
image without a filesystem ๐
wide-garage-9465
08/02/2023, 11:20 AM/tmp
does not exist inside the k3d image, as it only contains the k3d binary and nothing else.wide-garage-9465
08/02/2023, 11:22 AMwide-garage-9465
08/02/2023, 11:26 AMthankful-insurance-4058
08/02/2023, 11:40 AMW0802 08:32:15.439695 8 sysinfo.go:203] Nodes topology is not available, providing CPU topology
E0802 08:32:15.441704 8 info.go:114] Failed to get system UUID: open /etc/machine-id: no such file or directory
W0802 08:32:15.442084 8 info.go:53] Couldn't collect info from any of the files in "/etc/machine-id,/var/lib/dbus/machine-id"
which I believe comes for similar reason. Mb there are more cases.thankful-insurance-4058
08/02/2023, 11:42 AMthankful-insurance-4058
08/02/2023, 11:43 AMwide-garage-9465
08/02/2023, 11:49 AM