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

"Kind create cluster" fails to create any cluster, but "sudo kind create cluster" works #2094

Closed
giulio-giunta opened this issue Feb 26, 2021 · 2 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/external upstream bugs triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@giulio-giunta
Copy link

What happened:
I previously posted on issue #1458 and was instructed to run the following commands prior to "kind create cluster":
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd

That was already configured and the command "kind create cluster" still fails with the following output:
giulio  ThinkPad-T430  ~  $  sudo mkdir /sys/fs/cgroup/systemd
[sudo] password for giulio:
mkdir: cannot create directory ‘/sys/fs/cgroup/systemd’: File exists
giulio  ThinkPad-T430  ~  ERROR  $  sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
mount: /sys/fs/cgroup/systemd: cgroup already mounted on /sys/fs/cgroup/systemd.
giulio  ThinkPad-T430  ~  32  $  kind create cluster
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.19.1) 🖼
✓ Preparing nodes 📦
✗ Writing configuration 📜
ERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: failed to get file: command "docker exec --privileged kind-control-plane cat /kind/version" failed with error: exit status 1
Command Output: Error response from daemon: Container 1d30a2599e7d022d01575c5e2e25be6c3d3225dd2482974ca77b795d8ce170d1 is not running

However, if I run "sudo kind create cluster" the cluster is created:
giulio  ThinkPad-T430  ~  ERROR  $  sudo kind create cluster
[sudo] password for giulio:
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.19.1) 🖼
✓ Preparing nodes 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Not sure what to do next? 😅 Check out https://kind.sigs.k8s.io/docs/user/quick-start/

What you expected to happen:
I believe "kind create cluster" should work without sudo privileges.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:
I have a rootless installation of docker. In fact I can run other containers without sudo privileges, as shown below:
giulio  ThinkPad-T430  ~  $  docker run -it busybox sh
/ # ls
bin dev etc home proc root sys tmp usr var
/ #

Environment:

  • kind version: (use kind version): kind v0.9.0 go1.15.6 linux/amd64

  • Kubernetes version: (use kubectl version): GitVersion:"v1.20.0"

  • Docker version: (use docker info):
    giulio  ThinkPad-T430  ~  ERROR  $  docker version
    Client: Docker Engine - Community
    Version: 20.10.0
    API version: 1.41
    Go version: go1.13.15
    Git commit: 7287ab3
    Built: Tue Dec 8 18:54:00 2020
    OS/Arch: linux/amd64
    Context: default
    Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.0
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: eeddea2
Built: Tue Dec 8 18:58:04 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0

@giulio-giunta giulio-giunta added the kind/bug Categorizes issue or PR as related to a bug. label Feb 26, 2021
@BenTheElder
Copy link
Member

BenTheElder commented Feb 26, 2021

Kubernetes doesn't support rootless.
Kind will support it anyhow in the future, but the workarounds for this are not in place yet.
EDIT: they are expected to be enabled in the next release.

@BenTheElder
Copy link
Member

You can follow the upstream rootless mode in Kubernetes: kubernetes/enhancements#2033

You can follow support for it in KIND here: #1797
/triage duplicate
/kind external

@k8s-ci-robot k8s-ci-robot added triage/duplicate Indicates an issue is a duplicate of other open issue. kind/external upstream bugs labels Feb 26, 2021
@BenTheElder BenTheElder self-assigned this Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/external upstream bugs triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

3 participants