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

Enhancement: Enable skaffold build to output kustomize edit set image instructions #2957

Closed
wstrange opened this issue Sep 27, 2019 · 8 comments

Comments

@wstrange
Copy link
Contributor

This is related to #1187.

I'm not sure how the Kustomize deployer fixes up docker image names before deployment.

The "kustomize" way of setting image names is documented here: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/image.md

If the build phase of skaffold could output a file that contains a series of kustomize edit set image transformations, this largely solves the problem of using skaffold in a CD pipeline where you want another tool (say argo) to manage the deployment.

The workflow would be . skaffold build, to build, tag and push the final images, and then hand the generated kustomize edit file to the CD deployer to fix up the image names before sending to the cluster.

Hope that makes sense.

@wstrange wstrange changed the title RFE: Enable skaffold build to output a file with kustomize edit set image instructions RFE: Enable skaffold build to output kustomize edit set image instructions Sep 28, 2019
@wstrange wstrange changed the title RFE: Enable skaffold build to output kustomize edit set image instructions RFE: Enable skaffold build to output kustomize edit set image instructions Sep 28, 2019
@wstrange wstrange changed the title RFE: Enable skaffold build to output kustomize edit set image instructions Enhancement: Enable skaffold build to output kustomize edit set image instructions Sep 28, 2019
@priyawadhwa priyawadhwa added kind/feature-request priority/p1 High impact feature/bug. labels Sep 30, 2019
@priyawadhwa
Copy link
Contributor

Hey @wstrange thanks for opening this issue!

cc @nkubala -- this seems related to skaffold render, do you know if we have any plans to add this feature?

@tejal29
Copy link
Contributor

tejal29 commented Oct 1, 2019

@wstrange We have a PR in progress. Please track #2943

@wstrange
Copy link
Contributor Author

wstrange commented Oct 2, 2019

@tejal29 Thanks. That PR looks like it is for kubectl. Does it also work with Kustomize?

@nkubala
Copy link
Contributor

nkubala commented Oct 3, 2019

@wstrange kustomize implementation in the works, it'll go out with the next release. will having rendered manifests solve this issue for you?

@wstrange
Copy link
Contributor Author

wstrange commented Oct 3, 2019

Rendered kustomize manifests definitely solves our most pressing issue for CD integration.

It would be really neat if skaffold could output kustomize edit commands that set the image names and tags. I think this is the canonical way of setting image/tags in kustomize deployments. I'm wondering if that file could be output in the build phase? So the CD process becomes something like:

# build, tag and push
skaffold build 
# This also outputs a kustomize.edit.sh file... containing commands like 
# kustomize edit set image busybox=alpine:3.6
# CD process runs:
# ./kustomize.edit.sh 
# Then deploys:
# kustomize build ./path | kubectl apply -f -

If the image output file was a simple csv or json mapping, the edit commands could also be derived from that.

@tstromberg
Copy link
Contributor

Thank you for the idea!

I'm closing this issue as it's been open a while, and it is not clear if it's still an open issue. No one has recently stated an interest in addressing this, but if you feel strongly about it, please feel free to add a comment.

@ngfgrant
Copy link

ngfgrant commented Oct 8, 2021

This is also an issue for our use case. Looking into how we could utilise hooks to achieve the edit set image. Do you think that might work?

@nkubala
Copy link
Contributor

nkubala commented Oct 28, 2021

@ngfgrant I don't see why not. try configuring a pre-deploy hook and post back here with an update!

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

No branches or pull requests

6 participants