knative-extensions / kn-plugin-quickstart

Kn plugin for installation of Knative cluster for developers to quickstart.
Apache License 2.0
24 stars 38 forks source link

kn quickstart kind - Error: creating cluster: docker not running #408

Closed giulianisanches closed 2 days ago

giulianisanches commented 1 year ago

Hello,

I'm trying to use the quickstart plugin to get knative running and learn more about this tool.

I have podman 4.4.4 installed. The podman machine is running and I'm able to create a kind cluster running kind create cluster:

~
❯ kind create cluster
enabling experimental podman provider
Creating cluster "kind" ...
 βœ“ Ensuring node image (kindest/node:v1.26.3) πŸ–Ό
 βœ“ 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

Have a nice day! πŸ‘‹

~
❯

But when I try to run the command kn quickstart kind, i get the following error:

~
❯ kn quickstart kind
Running Knative Quickstart using Kind
Error: creating cluster: docker not running
Usage:
  kn-quickstart kind [flags]

Flags:
  -h, --help                        help for kind
      --install-eventing            install Eventing on quickstart cluster
      --install-serving             install Serving on quickstart cluster
  -k, --kubernetes-version string   kubernetes version to use (1.x.y) or (kindest/node:v1.x.y)
  -n, --name string                 kind cluster name to be used by kn-quickstart (default "knative")

creating cluster: docker not running
Error: exit status 1

~
❯

This is the S.O. version for the podman machine:

~
❯ podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Fedora CoreOS 37.20230401.2.0
Tracker: https://github.com/coreos/fedora-coreos-tracker
Discuss: https://discussion.fedoraproject.org/tag/coreos

[core@localhost ~]$ uname -a
Linux localhost.localdomain 6.2.8-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Mar 22 19:11:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[core@localhost ~]$ exit
logout

~
❯
psschwei commented 1 year ago

Quickstart has a dependency on Docker right now as we run a few docker commands under the hood.

In theory (I haven't tested this, but it could work), an alias docker=podman may be able to get around that. Or if you'd be interested in submitting a fix to make quickstart more agnostic on docker/podman, a PR would be very welcome :smile:

giulianisanches commented 1 year ago

I will fork the repository and try to figure out what's going on and see if i'm able to open a PR for this ;)

psschwei commented 1 year ago

Awesome!

These are the main places where we'd need a docker alternative:

https://github.com/knative-sandbox/kn-plugin-quickstart/blob/6fbecd262ce1808d464c68136c80c5a4b3629331/pkg/kind/kind.go#L111

https://github.com/knative-sandbox/kn-plugin-quickstart/blob/6fbecd262ce1808d464c68136c80c5a4b3629331/pkg/kind/kind.go#L119

https://github.com/knative-sandbox/kn-plugin-quickstart/blob/6fbecd262ce1808d464c68136c80c5a4b3629331/pkg/kind/kind.go#L134

https://github.com/knative-sandbox/kn-plugin-quickstart/blob/6fbecd262ce1808d464c68136c80c5a4b3629331/pkg/kind/kind.go#L318

Maybe something as simple as a function to figure out whether docker/podman is running on the user's system, then setting a variable for it, and then using that variable in the various exec commands...

giulianisanches commented 1 year ago

Just to keep some history here, using alias is a little bit tricky, as we can see here.

Summarizing:

Anyway, playing around the kind.go code to create a fix in the plugin itself :)

mfreeman451 commented 9 months ago

Has anyone considered using ko-build here?

matzew commented 3 months ago

@giulianisanches I have installed the podman-docker package on my fedora, which creates a symbolic link to the podman binary.

I am however able to create a kind cluster with latest (I tried only local build) of the quickstart.

@psschwei my PR 525 helped w/ the creation of the registry - which is a bit different from docker VS podman perspective

chzar commented 2 weeks ago

I also ran into similar issues when deploying kind on podman in a fresh install MacOS sequoia. I created a PR that removes the docker-cli dependency altogether and replaces it with the Docker API Go Client which worked for me without a hitch.