-
-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd07011
commit 7c567ba
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ title: Advanced Guides | |
nav: | ||
- calico.md | ||
- cuda.md | ||
- podman.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Using Podman instead of Docker | ||
|
||
Podman has an [Docker API compatibility layer](https://podman.io/blogs/2020/06/29/podman-v2-announce.html#restful-api). k3d uses the Docker API and is compatible with Podman v4 and higher. | ||
|
||
!!! important "Podman support is experimental" | ||
k3d is not guaranteed to work with Podman. If you find a bug, do help by [filing an issue](https://github.com/rancher/k3d/issues/new?labels=bug&template=bug_report.md&title=%5BBUG%5D+Podman) | ||
|
||
## Using Podman | ||
|
||
Ensure the Podman system socket is available: | ||
|
||
```bash | ||
sudo systemctl enable --now podman.socket | ||
# or sudo podman system service --time=0 | ||
``` | ||
|
||
To point k3d at the right Docker socket, create a symbolic link: | ||
|
||
```bash | ||
ln -s /run/podman/podman.sock /var/run/docker.sock | ||
# or install your system podman-docker if available | ||
sudo k3d cluster create | ||
``` | ||
|
||
Alternatively, set DOCKER_HOST when running k3d: | ||
|
||
```bash | ||
export DOCKER_HOST=unix:///run/podman/podman.sock | ||
sudo --preserve-env=DOCKER_HOST k3d cluster create | ||
``` | ||
|
||
### Using rootless Podman | ||
|
||
Ensure the Podman user socket is available: | ||
|
||
```bash | ||
systemctl --user enable --now podman.socket | ||
# or podman system service --time=0 | ||
``` | ||
|
||
Set DOCKER_HOST when running k3d: | ||
|
||
```bash | ||
XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)} | ||
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock | ||
k3d cluster create | ||
``` | ||
|
||
## Creating local registries | ||
|
||
Because Podman does not have a default "bridge" network, you have to specify a network using the `--default-network` flag when creating a local registry: | ||
``` | ||
k3d registry create --default-network podman mycluster-registry | ||
``` | ||
|
||
To use this registry with a cluster, pass the `--registry-use` flag: | ||
|
||
``` | ||
k3d cluster create --registry-use mycluster-registry mycluster | ||
``` | ||
|
||
!!! note "Incompatibility with `--registry-create`" | ||
Because `--registry-create` assumes the default network to be "bridge", avoid `--registry-create` when using Podman. Instead, always create a registry before creating a cluster. |