Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Error installing on Docker Desktop #39

Open
jldec opened this issue Jun 3, 2019 · 8 comments
Open

Error installing on Docker Desktop #39

jldec opened this issue Jun 3, 2019 · 8 comments
Assignees

Comments

@jldec
Copy link
Contributor

jldec commented Jun 3, 2019

There appear to be 2 problems with installing onto k8s in Docker Desktop

  1. The node name for recent Docker Desktop builds should be docker-desktop (see add check for docker-desktop node name #37)
  2. localhost:6443 endpoint for talking to k8s API from inside the invocation-image container does not appear to work.
$ duffle install myriff riff --credentials myk8s
Executing install action...
time="2019-05-31T17:15:53Z" level=fatal msg="Get https://localhost:6443/api/v1/nodes/minikube: dial tcp 127.0.0.1:6443: connect: connection refused"
Error: Install step failed: container exit code: 1
@scothis
Copy link
Contributor

scothis commented Jun 3, 2019

Is kubectl config current-context set to minikube instead of docker-desktop?

@jldec
Copy link
Contributor Author

jldec commented Jun 3, 2019

No, i think the error message above (running a build of the PR #37 branch) is coming from the first detection probe check which happens to be minikube here.

@sbawaska
Copy link
Contributor

sbawaska commented Jun 3, 2019

The problem here is that docker-for-desktop uses localhost as the server address. snippet from ~/.kube/config:

clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://localhost:6443
  name: docker-for-desktop-cluster

Since, duffle mounts this kube config inside a container when it runs the install command, our binary is unable to find a cluster at localhost.
minikube works because it assigns an IP address to the VM and uses that in kube config.

@sbawaska
Copy link
Contributor

sbawaska commented Jun 4, 2019

replacing localhost with host.docker.internal in ~/.kube/config fixes the issue, but that breaks kubectl on the host.

clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://host.docker.internal:6443
  name: docker-desktop

@jldec
Copy link
Contributor Author

jldec commented Jun 6, 2019

Adding @glyn because this looks like a generic duffle issue

How should duffle installers target the kubernetes running in docker-desktop if the k8s api-server endpoint in .kube/config doesn't resolve from inside the invocation image?

@glyn
Copy link
Contributor

glyn commented Jun 6, 2019

I'm not sure this is an issue with duffle per se, since duffle has no direct relationship to, or support for, k8s.

A solution would be to copy ~/.kube/config and modify it (to use host.docker.internal instead of localhost, as above) and then use the copy to create the duffle credential.

@jldec
Copy link
Contributor Author

jldec commented Jun 6, 2019

Per this duffle doc, kubeconfig credentials appear to be the canonical example for duffle. IMO k8s should be a first-class, batteries-included, no-additional-config-required, target for cnab bundles and tools like duffle.

I'd be very surprised if this problem of how to target the kubernetes running in docker-desktop from a duffle invocation image container has not been encountered (and a solution or workaround suggested).

@glyn
Copy link
Contributor

glyn commented Jun 6, 2019

Raised cnabio/duffle#762

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants