autok3s k3d

问题总结

  • 问题 1

使用 k3d provider 创建集群的时候,如果设置 memory,报错 Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

1
time="2023-05-25T02:54:20Z" level=info msg="[k3d] begin to create cluster mem-test..." time="2023-05-25T02:54:20Z" level=info msg="[k3d] 1 masters and 0 workers will be added" time="2023-05-25T02:54:20Z" level=info msg="Prep: Network" time="2023-05-25T02:54:20Z" level=info msg="Re-using existing network 'k3d-mem-test' (214d795bf9fdf46b0d003b78e6d3d0976586744d4fbc48063b82d5da17d1a0d7)" time="2023-05-25T02:54:20Z" level=info msg="Created image volume k3d-mem-test-images" time="2023-05-25T02:54:20Z" level=info msg="Starting new tools node..." time="2023-05-25T02:54:20Z" level=info msg="Starting Node 'k3d-mem-test-tools'" time="2023-05-25T02:54:21Z" level=info msg="Creating node 'k3d-mem-test-server-0'" time="2023-05-25T02:54:22Z" level=info msg="Creating LoadBalancer 'k3d-mem-test-serverlb'" time="2023-05-25T02:54:22Z" level=info msg="Using the k3d-tools node to gather environment information" time="2023-05-25T02:54:22Z" level=info msg="HostIP: using network gateway 172.31.0.1 address" time="2023-05-25T02:54:22Z" level=info msg="Starting cluster 'mem-test'" time="2023-05-25T02:54:22Z" level=info msg="Starting servers..." time="2023-05-25T02:54:22Z" level=info msg="Starting Node 'k3d-mem-test-server-0'" time="2023-05-25T02:54:23Z" level=error msg="[k3d] cluster mem-test run failed: Failed Cluster Start: Failed to start server k3d-mem-test-server-0: runtime failed to start node 'k3d-mem-test-server-0': docker failed to start container for node 'k3d-mem-test-server-0': Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting \"/root/.k3d/.k3d-mem-test-server-0/meminfo\" to rootfs at \"/proc/meminfo\": mount /root/.k3d/.k3d-mem-test-server-0/meminfo:/proc/meminfo (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type" time="2023-05-25T02:54:23Z" level=info msg="[k3d] executing rollback logic..." time="2023-05-25T02:54:23Z" level=info msg="[k3d] instances [] will be rollback" time="2023-05-25T02:54:23Z" level=info msg="[k3d] successfully executed rollback logic" Follow   Clear

问题处理:

挂载目录~/.k3dautok3s容器中

问题中的目录可能与你使用的autok3s版本相关,上面的例子是找别人发的问题,我自己使用的0.9.2版本对应的目录是~/.config

  • 问题 2

使用docker-compose启动的autok3s搭建使用k3d时没有获取到节点的状态
怀疑是因为docker-composek3d不在同一个网络,autok3s在创建时容器时直接使用的docker来创建的

问题处理:

原因如之前的猜想一样,当我自己创建了一个新的网桥,autok3s 与