GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15k stars 1.62k forks source link

Windows + minikube + skaffold + non-elevated shell = fail #3073

Open balopat opened 5 years ago

balopat commented 5 years ago

Expected behavior

When skaffold detects that minikube's docker daemon can't be resolved (as the warning shows as well) it should either:

Actual behavior

Skaffold fails to find the minikube docker daemon and hence creates a deployment inside minikube that relies on a non-existent image (as it is not pushed):

``` C:\Users\balintp\dev\proj\skaffold\examples\getting-started>skaffold dev time="2019-10-16T15:16:04-07:00" level=warning msg="Could not get minikube docker env, falling back to local docker daemon: getting minikube env: Running [minikube docker-env --shell none]: stdout , stderr: X The docker host is currently not running\n, err: exit st atus 69: exit status 69" Generating tags... - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:v0.40.0-58-gd4bd5978-dirty Tags generated in 413.9981ms Starting build... Found [minikube] context, using local docker daemon. Building [gcr.io/k8s-skaffold/skaffold-example]... Sending build context to Docker daemon 3.072kB Step 1/6 : FROM golang:1.12.9-alpine3.10 as builder ---> e0d646523991 Step 2/6 : COPY main.go . ---> Using cache ---> 2015d9353f14 Step 3/6 : RUN go build -o /app main.go ---> Using cache ---> 0597b5dcee83 Step 4/6 : FROM alpine:3.10 ---> 961769676411 Step 5/6 : CMD ["./app"] ---> Using cache ---> a42bf125a1f1 Step 6/6 : COPY --from=builder /app . ---> Using cache ---> 1cf52c839515 Successfully built 1cf52c839515 Successfully tagged gcr.io/k8s-skaffold/skaffold-example:v0.40.0-58-gd4bd5978-dirty Build complete in 840.0648ms Starting test... Test complete in 1.0005ms Starting deploy... kubectl client version: 1.14 pod/getting-started created Deploy complete in 2.2762852s Watching for changes... rpc error: code = Unknown desc = Error response from daemon: manifest for gcr.io/k8s-skaffold/skaffold-example:1cf52c83951577b49c247f19583544e0686629c14245777fd91502cf6488c2e0 not found Back-off pulling image "gcr.io/k8s-skaffold/skaffold-example:1cf52c83951577b49c247f19583544e0686629c14245777fd91502cf6488c2e0" rpc error: code = Unknown desc = Error response from daemon: manifest for gcr.io/k8s-skaffold/skaffold-example:1cf52c83951577b49c247f19583544e0686629c14245777fd91502cf6488c2e0 not found ```

Information

Steps to reproduce the behavior

Run Skaffold in a non-admin powershell window against a hyperv minikube instance (that needs admin rights):

  1. getting-started example
  2. skaffold dev
nkubala commented 4 years ago

I wonder if this is still an issue 🤔

dgageot commented 4 years ago

I'm going to close this one. Not sure this is still an issue. Since then, Skaffold now fails on a failed minikube docker-env

survivant commented 4 years ago

I have the same problem today

PS C:\windows\system32> minikube version minikube version: v1.12.3 commit: 2243b4b97c131e3244c5f014faedca0d846599f5-dirty

minikube start --vm-driver=hyperv

skaffold build -p dev creating runner: creating builder: getting docker client: getting minikube env: running [minikube docker-env --shell none]

works if I launch skaffold from a "Administrator Powershell"

briandealwis commented 4 years ago

@gsquared94 this seems a motivator to make our KubeContext into a proper struct and move the minikube docker-env into the minikube detection. That way if minikube docker-env fails, then we downgrade the a normal non-local cluster KubeContext. WDYT?