skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

"invalid skaffold config" error with multi-node minikube cluster

Open fengye87 opened this issue 4 years ago • 14 comments
trafficstars

  1. create a multi-node minikube cluster using minikube start --nodes 2
  2. run skaffold dev

Expected behavior

It should work as expected

Actual behavior

It failed with following message:

invalid skaffold config: getting minikube env: running [/usr/local/bin/minikube docker-env --shell none -p minikube]
 - stdout: "\n\n"
 - stderr: "X Exiting due to ENV_MULTINODE_CONFLICT: The docker-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/\n"
 - cause: exit status 81

Information

  • Skaffold version: v1.20.0
  • Operating system: CentOS 7
  • Installed via: skaffold.dev

Steps to reproduce the behavior

  1. a clonable repository with the sample skaffold project
  2. minikube start --nodes 2
  3. skaffold dev

fengye87 avatar Mar 05 '21 05:03 fengye87

The cause of this problem is that minikube docker-env is not supported with multi-node clusters. So we may need a way (a flag maybe?) to let skaffold treat multi-node minikube clusters as non-minikube clusters, and rely on a Docker registry for the build-push-deploy process just like on canonical k8s clusters.

fengye87 avatar Mar 05 '21 06:03 fengye87

And --detect-minikube=false doesn't work if the cluster is named minikube. We have some rework to do with Minikube's support for containerd too (#5143), and here's another item to add to the list.

As a workaround you should be able to run:

skaffold config set -k minikube local-cluster false

briandealwis avatar Mar 06 '21 17:03 briandealwis

@briandealwis The workaround you mentioned didn't seem to solve the problem. I still got the same error.

fengye87 avatar Mar 09 '21 02:03 fengye87

hey @fengye87, unfortunately I don't think we have a workaround for this right now, however, we are actively working on support for minikube's new minikube image load command which should allow us to no longer rely on minikube docker-env and therefore help us support multi-node minikube

cc @tstromberg @medyagh

MarlonGamez avatar Mar 17 '21 22:03 MarlonGamez

Also for more context, this isn't even happening in the build phase, but rather when we parse the skaffold config. It looks like we try to run validations against the user's docker daemon in minikube at the beginning of a skaffold session

MarlonGamez avatar Mar 18 '21 20:03 MarlonGamez

Interesting to note, this applies even if you use the kaniko builder, which shouldn't require access to the minikube docker daemon. I will close #5702 as a duplicate, but there is more information there, as well as the local patch I used to work around the problem.

aasmall avatar Apr 19 '21 23:04 aasmall

You get the same bug when using other container runtimes, since the docker daemon is not running in the cluster for those. Even if you are using a custom build script (without docker), it will still try to call minikube docker-env and fail while doing so.

afbjorklund avatar Aug 04 '21 08:08 afbjorklund

We would love get some community contributions arounds this!

tejal29 avatar Mar 22 '22 20:03 tejal29

try doing:: local: push: false

it helped me

rmane-vibrent avatar Mar 24 '22 11:03 rmane-vibrent

Still not working --detect-minikube=false dont resolve this issue

invalid skaffold config: getting minikube env: running [/usr/local/bin/minikube docker-env --shell none -p api-server --user=skaffold]
 - stdout: "false exit code 81\n"
 - stderr: "X Exiting due to ENV_MULTINODE_CONFLICT: The docker-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/\n"
 - cause: exit status 81

gawsoftpl avatar Jul 26 '22 01:07 gawsoftpl

This is working with KIND cluster BTW

Jonatthu avatar Jul 28 '22 01:07 Jonatthu

@rmane-vibrent I've tried local: push with both true and false, but none of them worked.

yuhang-lin avatar Dec 08 '22 23:12 yuhang-lin

I move from minikube to kind.

gawsoftpl avatar Dec 09 '22 11:12 gawsoftpl

If you rename context from "minikube" to for example "test" and tell skaffold to use SKAFFOLD_KUBE_CONTEXT=test it works....

Woytek-Polnik avatar Jun 09 '23 14:06 Woytek-Polnik