CuriousLearner / CuriousLearner/cka-lab-runner
kind: cluster creation fails at kubeadm init on cgroup v2 / old kind version
- Dominant language
- Go
- Stars
- 10
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
## Symptom
`cka-lab-runner up` (provider `kind`, k8s `v1.30.0`) creates the node container but fails during control-plane bootstrap:
```
✗ Starting control-plane 🕹️
ERROR: failed to create cluster: failed to init node with kubeadm: command "docker exec --privileged kubeadm init --ignore-preflight-errors=all --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1
Error: creating cluster: creating kind cluster: exit status 1
```
## Root cause
The installed `kind` is far too old for the host and the requested image:
```
kind v0.6.1 go1.13.4 linux/amd64 # released 2019
```
Environment:
- WSL2, kernel `6.6.87.2-microsoft-standard-WSL2`
- cgroup **v2** (`/sys/fs/cgroup` is `cgroup2fs`), Docker `29.4.1`, Cgroup Driver `cgroupfs`
- requested node image `kindest/node:v1.30.0`
kind v0.6.1 predates both cgroup v2 support and the v1.30 node images, so `kubeadm init` fails inside the node container.
## Fix / workaround
Upgrade kind to a recent release (>= v0.23.x for k8s 1.30, cgroup v2 aware):
```bash
go install sigs.k8s.io/kind@latest
# or download the binary from https://github.com/kubernetes-sigs/kind/releases
kind version
```
After upgrading, `up` should complete.
## Suggestion
The prerequisite check in #2 verifies a provider binary *exists*, but not that it is recent enough. A follow-up could warn on known-too-old provider versions (e.g. `kind < v0.20`) to catch this class of failure earlier.
Contributor guide
Research direction
Start with the prerequisite check described in issue #2 and inspect how it verifies the provider binary. Compare the installed kind version with the requested Kubernetes version and reproduce the cgroup v2 failure if needed. Done means an outdated kind installation is detected and a useful warning appears before cluster creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, kubernetes
- Domain
- devops, infrastructure, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100