-
Notifications
You must be signed in to change notification settings - Fork 480
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
Well/known and recommended labels breaking existing deployments #2697
Comments
@rtroost2012 : Did you had Well known Kubernetes labels integrated with your workloads before 1.16.0 ? |
Our Kubernetes.yml looks something like this. We have not been using well known labels before 1.16.0
|
Looking at Could you please check what value has changed in selectors in Deployment ? |
Adding
To our configuration reverts back to the old behaviour and no immutability issues are encounterd. The kubernetes YAML after upgrading to 1.16 looks like this
Previous selector:
|
@rtroost2012 : So your issue seems to be happening on redeploying an already deployed application on K8s Cluster. I see now Deployment selector contains new As per Kubernetes Documentation, Deployment's selector field can not be changed once it's created
Is it possible in your case to delete previous Deployment and then run |
Deleting deployments, especially in production, is not something we were planning on doing straight away as it causes downtime. |
Sorry, I did not know about Deployment selector immutable behavior in Kubernetes. We don't have any redeployment scenario testing. I'll check with team on how to handle this scenario. |
We did consider adding it as an opt-in feature, but we finally decided to provide the disabling mechanism and a warning notice in the changelog. Not considering the immutability of already existing deployments was a mistake. We'll need to figure this out too when we finally remove the legacy labels. |
Describe the bug
Introduced in #1700
With a relatively standard JKube configuration, we run into immutability issues after upgrading from v1.15.0 to v1.16.0.
I have limited experience with Kubernetes, but my understanding is that label selectors cannot be changed for existing deployments.
The Deployment "spring-boot-admin" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"spring-boot-admin", "app.kubernetes.io/managed-by":"jkube", "app.kubernetes.io/name":"spring-boot-admin", "app.kubernetes.io/part-of":"[redacted]", "group":"[redacted]", "provider":"jkube"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
Eclipse JKube version
1.16.0
Component
Kubernetes Maven Plugin
Apache Maven version
3.8.5
Gradle version
None
Steps to reproduce
JKube Configuration
Expected behavior
Backward-compatibility with old labels or a more explicit warning in the changelog that this might be breaking
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3
Environment
Amazon
Eclipse JKube Logs
Sample Reproducer Project
Go to any quickstart project
Additional context
No response
The text was updated successfully, but these errors were encountered: