kind-action icon indicating copy to clipboard operation
kind-action copied to clipboard

It there a way to use this action on a rootless docker setup?

Open marcofranssen opened this issue 5 years ago • 1 comments

https://kind.sigs.k8s.io/docs/user/rootless/#creating-a-kind-cluster-with-rootless-docker

I have tried following in my workflow:

job:
  test:
    env: 
      DOCKER_HOST: unix://${XDG_RUNTIME_DIR}/docker.sock
    steps:
      - name: Create kind v1.19.7 cluster
        uses: helm/[email protected]
        with:
          node_image: kindest/node:v1.19.7

However that fails with

Run helm/[email protected]
  with:
    node_image: kindest/node:v1.19.7
  env:
    DOCKER_HOST: unix://${XDG_RUNTIME_DIR}/docker.sock
    pythonLocation: /home/runners/actions-runner/_work/_tool/Python/3.7.10/x64
    LD_LIBRARY_PATH: /home/runners/actions-runner/_work/_tool/Python/3.7.10/x64/lib
    CT_CONFIG_DIR: /home/runners/actions-runner/_work/_tool/ct/v3.3.1/x86_64/etc
    VIRTUAL_ENV: /home/runners/actions-runner/_work/_tool/ct/v3.3.1/x86_64/venv
Adding kind directory to PATH...
Adding kubectl directory to PATH...
kind v0.9.0 go1.15.2 linux/amd64
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-09T11:26:42Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
Creating kind cluster...
ERROR: failed to create cluster: failed to list clusters: command "docker ps -a --filter label=io.x-k8s.kind.cluster=chart-testing --format '{{.Names}}'" failed with error: exit status 1

Command Output: parse unix://${XDG_RUNTIME_DIR}/docker.sock: invalid character "{" in host name

I think this action needs to have a parameter to run as rootless so this can be handled within the shell script of this action.

marcofranssen avatar Mar 30 '21 10:03 marcofranssen

Another try is that we have updated our selfhosted runner.

What we did on the runner is adding the following.

# https://kind.sigs.k8s.io/docs/user/rootless/#host-requirements
echo GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=1" >> /etc/default/grub
update-grub

cat >/etc/systemd/system/[email protected]/delegate.conf <<-EOF
[Service]
Delegate=yes

EOF

systemctl daemon-reload

Unfortunately that still gives following error. My guess it is the --privileged parameter.

Run helm/[email protected]
Installing kind...
Adding kind directory to PATH...
Installing kubectl...
Adding kubectl directory to PATH...
kind v0.9.0 go1.15.2 linux/amd64
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-09T11:26:42Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
Creating kind cluster...
Creating cluster "chart-testing" ...
 • Ensuring node image (kindest/node:v1.17.17) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.17.17) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✗ 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 chart-testing-control-plane cat /kind/version" failed with error: exit status 1

marcofranssen avatar Mar 30 '21 13:03 marcofranssen

closing due inactivity, feel free to reopen or open a new one

cpanato avatar Apr 23 '24 09:04 cpanato