Skip to content

Commit 82d35f0

Browse files
authored
Remove pack8s and document how to use kubevirtci with podman (kubevirt#610)
* Remove pack8s source code Signed-off-by: Roman Mohr <[email protected]> * Detect CRI for running gocli itself Let the common script detect the working runtime client binary (docker or podman) and use it to pull and run gocli. Signed-off-by: Roman Mohr <[email protected]> * Lift sudo requirement for podman Expect podman socket to exist at `${HOME}/podman.sock`. Signed-off-by: Roman Mohr <[email protected]> * Add very minimal podman documentation Signed-off-by: Roman Mohr <[email protected]> * Reintroduce runtime selection variable Allow exlicit selection of the runtime via an env variable and improve the runtime detection for podman. Signed-off-by: Roman Mohr <[email protected]>
1 parent 357b09b commit 82d35f0

File tree

827 files changed

+47
-487983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

827 files changed

+47
-487983
lines changed

PODMAN.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Use kubevirtci with podman instead of docker
2+
3+
Install podman 3.1+, then run it in docker compatible mode:
4+
5+
```
6+
podman system service -t 0 unix:///${HOME}/podman.sock
7+
```
8+
9+
After this command, you can use kubevirtci with the typical `make cluster-*`
10+
commands.
11+
12+
This will use `fuse-overlayfs` as storage layer. If the performance is not
13+
satisfactory, consider running podman as root to use plain `overlayfs2`:
14+
15+
```
16+
sudo podman system service -t 0 unix:///${HOME}/podman.sock
17+
```

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ See [K8S.md](K8S.md)
1010

1111
See [KUBEVIRTCI_LOCAL_TESTING.md](KUBEVIRTCI_LOCAL_TESTING.md)
1212

13+
## Using podman instead of docker
14+
15+
See [PODMAN.md](PODMAN.md)
16+
1317
## Contributing
1418

1519
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute.

cluster-up/cluster/ephemeral-provider-common.sh

+26-9
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,34 @@ if [ -n "${KUBEVIRTCI_TAG}" ] && [ -n "${KUBEVIRTCI_GOCLI_CONTAINER}" ]; then
1515
fi
1616

1717
if [ "${KUBEVIRTCI_RUNTIME}" = "podman" ]; then
18-
_cli="pack8s"
18+
_cri_bin=podman
19+
_docker_socket="${HOME}/podman.sock"
20+
elif [ "${KUBEVIRTCI_RUNTIME}" = "docker" ]; then
21+
_cri_bin=docker
22+
_docker_socket="/var/run/docker.sock"
1923
else
20-
_cli_container="${KUBEVIRTCI_GOCLI_CONTAINER:-quay.io/kubevirtci/gocli:${KUBEVIRTCI_TAG}}"
21-
_cli="docker run --privileged --net=host --rm ${USE_TTY} -v /var/run/docker.sock:/var/run/docker.sock"
22-
# gocli will try to mount /lib/modules to make it accessible to dnsmasq in
23-
# in case it exists
24-
if [ -d /lib/modules ]; then
25-
_cli="${_cli} -v /lib/modules/:/lib/modules/"
26-
fi
27-
_cli="${_cli} ${_cli_container}"
24+
if curl --unix-socket /${HOME}/podman.sock http://d/v3.0.0/libpod/info > /dev/null 2>&1 ; then
25+
_cri_bin=podman
26+
_docker_socket="${HOME}/podman.sock"
27+
echo "selecting podman as container runtime"
28+
elif docker ps >/dev/null; then
29+
_cri_bin=docker
30+
_docker_socket="/var/run/docker.sock"
31+
echo "selecting docker as container runtime"
32+
else
33+
echo "no working container runtime found. Neither docker nor podman seems to work."
34+
exit 1
35+
fi
36+
fi
37+
38+
_cli_container="${KUBEVIRTCI_GOCLI_CONTAINER:-quay.io/kubevirtci/gocli:${KUBEVIRTCI_TAG}}"
39+
_cli="${_cri_bin} run --privileged --net=host --rm ${USE_TTY} -v ${_docker_socket}:/var/run/docker.sock"
40+
# gocli will try to mount /lib/modules to make it accessible to dnsmasq in
41+
# in case it exists
42+
if [ -d /lib/modules ]; then
43+
_cli="${_cli} -v /lib/modules/:/lib/modules/"
2844
fi
45+
_cli="${_cli} ${_cli_container}"
2946

3047
function _main_ip() {
3148
echo 127.0.0.1

pack8s/.gitignore

-7
This file was deleted.

pack8s/EXAMPLES.varlink

-7
This file was deleted.

pack8s/FAQ.md

-15
This file was deleted.

pack8s/LICENSE

-201
This file was deleted.

pack8s/Makefile

-35
This file was deleted.

0 commit comments

Comments
 (0)