-
Notifications
You must be signed in to change notification settings - Fork 21
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
Managing labels on image building #303
Comments
Part of the buildpack specification is a way for individual buildpacks to set labels on an image. The spring-boot buildpack does this for the SCDF label you mentioned above. What I would suggest is that we add an env variable config setting on the spring-boot buildpack to turn this off. You can then set that env variable and it'll disable the label. That solves the specific and current need, and it's easy to implement. I'll leave this issue open as a feature request to implement this. Also worth noting is that per the buildpack spec, one buildpack can override the labels set by another buildpack. If two buildpacks set label "FOO" the last buildpack to run wins.
Based on that, I would think that the image-labels buildpack would be another option here. You could have the image-labels buildpack set the same label name as the spring-boot buildpack, Ex: If you want a simple flag like Hope that helps! |
Disabling labels by env variables seems like a straightforward approach. However, I'm still concerned about uncontrolled growth of labels size. Stopping Kubernetes nodes because of that is a real threat. By the way, I've tried using image-labels on |
I thought that Kubernetes applied mitigation for this a while back. Previously it would DoS your node. While it still cannot handle images with labels that large, I don't believe that it crashes like it used to. It just refused to run your image. Feel free to correct me on this, I haven't actually tried it for a while.
That doesn't sound right. Not according to the spec. It shouldn't be doing any kind of wildcard matching. If one label name matches another label name, then it should overwrite that label. Can you open an issue for that and include steps to reproduce? That buildpack stuffs all of the labels into one space-separated env variable so it might be something with the way the buildpack parses that out. I can take a look. |
We are still using an old version of Kubernetes, unfortunately. I can't find, how Kubernetes handles it now (they got rid of "docker shim" where this issue happened before), but people are still complaining about it:
Agree. Please check the command, maybe there is a mistake: |
The origin of this issue is #80
Label
org.springframework.boot.spring-configuration-metadata.json
was removed for all Spring Boot applications, except for Spring Cloud Data Flow applications. But Spring Cloud Data Flow UI (through Spring Cloud Data Flow Server) doesn't use it. Of course it might be used by other tools and motivation not to remove it completely, because of breaking changes, is understandable, however it's already done for the majority of all Spring Boot applications. On the other hand, getting rid of this particular label doesn't completely solve all potential problems with exceeding metadata size limits.IMHO, I would delete this label for Spring Cloud Data Flow applications as well.
But it's more important to have some reliable and flexible approach to manage labels creation. The simplest way is to specify exclusion of specific labels on build ("black list").
However, another long label may arise in the future. So it might be a solution of having "white list". The main idea is pretty simple - "If I need a label, I'll add it explicitly to the list and I don't care about other labels". The main advantage here - metadata size is more solid, but there are downsides too.
The text was updated successfully, but these errors were encountered: