Skip to content

fix: container image push to local cluster#8007

Merged
aaron-prindle merged 1 commit intoGoogleContainerTools:mainfrom
selfsk:fix-image-loading-to-kind
Nov 7, 2022
Merged

fix: container image push to local cluster#8007
aaron-prindle merged 1 commit intoGoogleContainerTools:mainfrom
selfsk:fix-image-loading-to-kind

Conversation

@selfsk
Copy link
Copy Markdown
Contributor

@selfsk selfsk commented Oct 31, 2022

Starting with version 2.x, skaffold isn't pushing container images to kind cluster(s), as result - deployment fail due to lack of container image. Issue #7992

Verified changes on 3 examples:

Run skaffold --kube-context=kind-kind dev in each to validate container images being pushed with this fix.

Fixes: #7992

Description

It appeared that problem with skaffold not loading container images to kind cluster is due to the way how skaffold constructs the list of images that supposed to be pushed to cluster. Function imagesToLoad iterating through different lists, and those lists kind of depend on each other.

Result list check for docker images that being produced, but in case of kubectl and helm deployers list of produced artifact hasn't been passed to this function at all, as result skaffold is treating as there were no images to push.

Starting with version 2.x `skaffold` weren't pushing docker images to kind cluster(s), as result - deployment will fail due to lack of docker image.

Verified changes on 3 [`examples`](/examples):
 * [getting-started](/examples/getting-started)
 * [kustomize](/examples/kustomize)
 * [helm-deployment](/examples/helm-deployment)

Run `skaffold --kube-context=kind-kind dev` in each to validate docker images being pushed with this fix.
@google-cla
Copy link
Copy Markdown

google-cla bot commented Oct 31, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@selfsk selfsk changed the title fix: docker image push to kind cluster fix: container image push to kind cluster Oct 31, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 1, 2022

Codecov Report

Merging #8007 (de0da3f) into main (290280e) will decrease coverage by 3.77%.
The diff coverage is 54.09%.

@@            Coverage Diff             @@
##             main    #8007      +/-   ##
==========================================
- Coverage   70.48%   66.70%   -3.78%     
==========================================
  Files         515      596      +81     
  Lines       23150    28900    +5750     
==========================================
+ Hits        16317    19278    +2961     
- Misses       5776     8198    +2422     
- Partials     1057     1424     +367     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/test.go 44.44% <0.00%> (ø)
cmd/skaffold/app/exitcode.go 100.00% <ø> (+6.66%) ⬆️
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/render.go 35.48% <18.18%> (-5.90%) ⬇️
cmd/skaffold/app/cmd/lsp.go 28.12% <28.12%> (ø)
cmd/skaffold/app/cmd/run.go 64.28% <33.33%> (-9.63%) ⬇️
cmd/skaffold/app/cmd/fix.go 56.41% <37.50%> (-20.07%) ⬇️
... and 390 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@KoltesDigital
Copy link
Copy Markdown

I suggest renaming this PR to fix: container image push to *local* cluster, as I have the same issue with a local k3d cluster.

@selfsk selfsk changed the title fix: container image push to kind cluster fix: container image push to local cluster Nov 2, 2022
Copy link
Copy Markdown
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR here @selfsk!!

@arikkfir
Copy link
Copy Markdown

arikkfir commented Jan 8, 2023

FYI this still happens with Skaffold v2.0.4 (which I think should include #8007 iianm)
Only adding --load-images=true to the deploy command fixes it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images are not getting loaded on Kind Cluster

4 participants