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

Easy way to update the container image name #109

Closed
bickfordb opened this issue Jun 13, 2018 · 13 comments
Closed

Easy way to update the container image name #109

bickfordb opened this issue Jun 13, 2018 · 13 comments
Assignees

Comments

@bickfordb
Copy link

bickfordb commented Jun 13, 2018

In order to reduce copy and paste in large applications, it would be nice to be able to patch multiple resources with one patch via some kind of selector other than name. For instance, in my Kubernetes application, I have separate web and job pods that share the same Docker image, most of the same pod values which I need to copy and paste into each. If one could write a patch that matched on a label or some other kind of selector, these shared values could be factored out.

@bickfordb
Copy link
Author

Maybe this could mostly be accomplished by allowing the name field to be a regular expression?

@Liujingfang1
Copy link
Contributor

The idea in #122 can help this. If kustomize provides to way to declare a user defined transformation and use that, this transformation can will be applied during kustomize build. To patch multiple objects with one patch, you only need to provide a proper transformer.

@itsnagaraj
Copy link

I love this idea/feature as well. I work on mono-repo project where we manage kubernetes spec for 30 microservice. We have templated everything in spec so that adding new service is a breeze. Templating logic is so complicated we have decided to move away from that approach and start evaluating tools like Kompose. Kompose doesn't fit for the project structure as the selector for deployment works by metadata->name and I will end up overlays for each service and lots of duplication

@nhoughto
Copy link

nhoughto commented Jul 2, 2018

Does seem to make sense to be able to target resources with something other than name, label perhaps.

The README relates kustomize to sed it's like sed, in that it emits editted text., which is a great comparison, and is how i want it to work, but unless i'm missing something I can't use arbitrary values to target things for overlays? Name, label, or even just type would be great. I'd like to be as generic as possible.

@Liujingfang1
Copy link
Contributor

Regardless of the patches or transformation. The original request is to ask an easy way to update the container image name wherever it is used.

@Liujingfang1 Liujingfang1 changed the title Add the ability to patch multiple resources with one patch Easy way to update the container image name Jul 10, 2018
@bickfordb
Copy link
Author

@Liujingfang1 actually, I was concerned about transforming/sharing multiple pod values, not just the container name.

@Liujingfang1
Copy link
Contributor

@bickfordb What pod values you need to update? Can you give an example?

@pwittrock pwittrock self-assigned this Jul 12, 2018
@pwittrock
Copy link
Contributor

I think there are 2 issues here:

  • Write patches that can match label / names
  • Support a simple way to update images without a patch

@Liujingfang1
Copy link
Contributor

Liujingfang1 commented Jul 24, 2018

I think there are 2 issues here:

Write patches that can match label / names

This can be solved by #122

Support a simple way to update images without a patch

This is supported by imageTags. See the imageTags demo

@bickfordb
Copy link
Author

@Liujingfang1 are you particularly opposed to allowing patches to match on a label based selector?

@yuya-takeyama
Copy link

This is supported by imageTags. See the imageTags demo

The link is dead:
https://github.com/kubernetes-sigs/kustomize/blob/master/examples/imageTags.md

@monopole
Copy link
Contributor

@bickfordb This issue was closed because of it's name and the introduction of set imageTag command.

The notion of applying patches guided by a label based selection could certainly be opened as a new issue.

As could the If you have time, please look at the conversation in #300 (less so the one in #169) and feel free to comment. It's closely related so some of what you mentioned above w/r (outside the scope of changing only the image tag).

@bickfordb
Copy link
Author

👍

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

No branches or pull requests

7 participants