Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FEATURE] docker context support #601

Merged
merged 2 commits into from
Jul 13, 2021
Merged

Conversation

developer-guy
Copy link
Contributor

@developer-guy developer-guy commented May 11, 2021

Signed-off-by: Batuhan Apaydın batuhan.apaydin@trendyol.com

What

I realized that when we work with different Docker Daemons running on remote hosts by using the Docker Context feature, k3d couldn't get corresponding Docker Daemon information properly.

Why

I tried the same demo with the KinD tool, and because it is using docker with an exec call, it works well with different Docker Contexts. So k3d should also be working too.

This PR fixes #593.

Implications

This PR comes with a lot of updates within the vendor directory.

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
@iwilltry42 iwilltry42 marked this pull request as draft May 11, 2021 09:59
@iwilltry42 iwilltry42 changed the title WIP: enable docker context support [FEATURE] docker context support May 11, 2021
@iwilltry42 iwilltry42 self-requested a review May 11, 2021 09:59
@iwilltry42 iwilltry42 added enhancement New feature or request priority/medium runtime Issue with the container runtime (docker) scope/package pkg/ labels May 11, 2021
@iwilltry42 iwilltry42 marked this pull request as ready for review June 11, 2021 10:36
@iwilltry42 iwilltry42 added this to the v5.0.0 milestone Jun 11, 2021
@iwilltry42 iwilltry42 changed the base branch from main to main-v5 June 11, 2021 10:36
@iwilltry42
Copy link
Member

Hi @developer-guy , I really don't know why I didn't look into this again so far, sorry!
Can you please update the PR to use main-v5 as the base?

@iwilltry42 iwilltry42 force-pushed the main-v5 branch 2 times, most recently from 99490ca to 4132757 Compare July 9, 2021 08:48
@iwilltry42 iwilltry42 merged commit 79790d1 into k3d-io:main-v5 Jul 13, 2021
@iwilltry42
Copy link
Member

Fixed the conflicts and merged it manually. Thanks for your contribution @developer-guy !

@iwilltry42
Copy link
Member

iwilltry42 commented Jul 13, 2021

Unfortunately, this breaks when using a non-tcp docker context (e.g. SSH). 🤔
Can you create a follow-up PR for this, please?

UPDATE: came up with this PR #674, but couldn't test it with TLS secured docker endpoint. Can you give this a try please @developer-guy ?

@jawabuu
Copy link

jawabuu commented Jul 15, 2021

Hey @iwilltry42
Does this merge support HTTP docker hosts e.g.

DOCKER_HOST=localhost:2375

Currently k3d returns this

Failed Cluster Preparation: Failed Network Preparation: error during connect: Get "https://localhost:2375/v1.24/networks?filters=%7B%22name%22%3A%7B%22%5E%2F%3Fk3d-k3s-default%24%22%3Atrue%7D%7D": http: server gave HTTP response to HTTPS client

@iwilltry42
Copy link
Member

iwilltry42 commented Jul 16, 2021

Hi @jawabuu , I'm currently testing with #674 (follow-up PR for this), so results might differ slightly.
I created a docker-in-docker container locally and ran the docker daemon on a remote physical server.
Those options worked:

  • unix://
  • ssh://
  • tcp:// (which is implied, if you don't specify a protocol) <- this is what you have

The only thing I didn't test successfully yet is a TLS protected daemon process.

UPDATE 1: now also tested with TLS (via context) 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request priority/medium runtime Issue with the container runtime (docker) scope/package pkg/
Projects
None yet
3 participants