Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use local registry if possible with kind #3855

Closed
yashbhutwala opened this issue Mar 21, 2020 · 16 comments · Fixed by #5012
Closed

Use local registry if possible with kind #3855

yashbhutwala opened this issue Mar 21, 2020 · 16 comments · Fixed by #5012
Labels
area/build area/push help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/bug Something isn't working platform/kind priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@yashbhutwala
Copy link

yashbhutwala commented Mar 21, 2020

Expected behavior

  • if local registry is being used with kind cluster, images are pushed into the local registry.

Actual behavior

  • due to skaffold detecting kind name with kubernetes context, skaffold loads images into each of the nodes rather than pushing to local registry despite it being available.

Information

  • Skaffold version: v1.6.0
  • Operating system: Darwin bhutwala-mac 18.7.0 Darwin Kernel Version 18.7.0: Thu Jan 23 06:52:12 PST 2020; root:xnu-4903.278.25~1/RELEASE_X86_64 x86_64

Skaffold's heuristic to detect kind cluster
kind's docs on using local registry

@yashbhutwala
Copy link
Author

Current workaround is to edit the kubeconfig to rename kubernetes context to something other than:
kind-(.*) for kind >= v0.6.0 or
(.*)@kind for kind < v0.6.0

@balopat
Copy link
Contributor

balopat commented Mar 25, 2020

@yashbhutwala - if you set build.local.push:false in your skaffold.yaml that should always force push, can you confirm whether that works for you?

@yashbhutwala
Copy link
Author

yashbhutwala commented Apr 15, 2020

@balopat setting build.local.push to both false and true, skaffold still tries to load images into the nodes. I want to disable loading images.

@maximegaillard
Copy link

Same thing for me.

Loading images inside a kind cluster has poor performances, like really bad...using a local registry is way better. I think @yakovzaytsev wants to disable the load feature for this reason, and so do I.

Maybe create new settings like:

  • deploy.kind.localRegistry (true|false to disable loading images)
  • deploy.kind.clusterName (to force the kind cluster name & deactivate the feature if needed)

@tstromberg
Copy link
Contributor

This seems entirely reasonable. Anyone open to sending a PR in to fix this?

@asoni90
Copy link

asoni90 commented May 31, 2020

I am also facing the same issue while using local registry in KIND with skaffold in GitHub actions. Images are loaded into nodes but pods are not able to pull the images with image name - localhost:5000 registry url.

@nkubala nkubala added kind/bug Something isn't working help wanted We would love to have this done, but don't have the bandwidth, need help from contributors priority/p2 May take a couple of releases and removed kind/question User question labels Jul 13, 2020
@nkubala
Copy link
Contributor

nkubala commented Jul 13, 2020

sorry this one got a bit lost, but yes I agree this is entirely reasonable and we should fix this in skaffold. we're forcing a kind load but we should enable local registries, I think @maximegaillard's idea is probably the easiest way to support this. sig-cluster-lifecycle also has a proposal for communicating this back up: kubernetes/enhancements#1757. we could use this if/when it gets implemented.

we probably won't prioritize this in the next few months but PRs welcome 🙏

@blaggacao
Copy link

Same for k3d.

  • deploy.k3d.localRegistry

@betterclever
Copy link

@nkubala I am creating a PR for this.

@nkubala nkubala added this to the Icebox [P2+] milestone Sep 1, 2020
@MarlonGamez
Copy link
Contributor

@betterclever awesome :) Please keep us updated on that if you can!

@MarlonGamez MarlonGamez added priority/p3 agreed that this would be good to have, but no one is available at the moment. and removed priority/p2 May take a couple of releases labels Sep 22, 2020
@Multiply
Copy link
Contributor

We're also keen on seeing this added, as the current loading functionality is ultra slow.

@betterclever any progress so far, or would you want me to take a jab at it?

@betterclever
Copy link

@Multiply I haven't been able to pick this up yet. Please go ahead. 😀

@tejal29
Copy link
Member

tejal29 commented Oct 28, 2020

Another relevant issue #4955 but not completely related. When implementing #4955 it would be great to consider use of local registry.

@ghost
Copy link

ghost commented Oct 28, 2020

Current workaround is to edit the kubeconfig to rename kubernetes context to something other than:
kind-(.*) for kind >= v0.6.0 or
(.*)@kind for kind < v0.6.0

Is there another workaround as well?
I can't remove the k3d prefix from my k3d context.

@shaxbee
Copy link
Contributor

shaxbee commented Nov 9, 2020

We could also have heuristic checking if image name refers to localhost-like address to disable loading images for both k3d/kind.

@shaxbee
Copy link
Contributor

shaxbee commented Nov 9, 2020

@nkubala @tstromberg Raised PR for this with unit tests, tested locally, works like charm, run/dev is much faster now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build area/push help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/bug Something isn't working platform/kind priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

Successfully merging a pull request may close this issue.