Skip to content

Commit

Permalink
docs(podman): add usage for rootless mode on macOS (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunet committed Aug 3, 2023
1 parent a04aa84 commit 2b0bbc9
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions docs/usage/advanced/podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ podman machine start
```

Grab connection details
> note: root connection details must be used

```
podman system connection ls
Expand All @@ -126,9 +125,27 @@ Host localhost
IdentityFile /Users/myusername/.ssh/podman-machine-default
```

Export the docker environment variables referenced above and create the cluster
#### Rootless mode

Delegate the `cpuset` cgroup controller to the user's systemd slice, export the docker environment variables referenced above for the non-root connection, and create the cluster:

```bash
podman machine ssh bash -e <<EOF
printf '[Service]\nDelegate=cpuset\n' | sudo tee /etc/systemd/system/[email protected]/k3d.conf
sudo systemctl daemon-reload
sudo systemctl restart "user@\${UID}"
EOF

export DOCKER_HOST=ssh://core@localhost:53685
export DOCKER_SOCKET=/run/user/501/podman/podman.sock
k3d cluster create --k3s-arg '--kubelet-arg=feature-gates=KubeletInUserNamespace=true@server:*'
```

#### Rootful mode

Export the docker environment variables referenced above for the root connection and create the cluster:

```bash
export DOCKER_HOST=ssh://root@localhost:53685
export DOCKER_SOCK=/run/podman/podman.sock
k3d cluster create
Expand Down

0 comments on commit 2b0bbc9

Please sign in to comment.