-
Notifications
You must be signed in to change notification settings - Fork 247
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
2.6-head | Can't add a port type clusterIP to a deployment created in the old UI #4280
Comments
@kinarashah the issue i mentioned today |
@brendarearden the issue with "service already exists" has been fixed. Please see first issue here #4159 and test notes in the comment section |
I was able to recreate this issue, and I did confirm that I saw PUT for the Deployment has both sets of ports on the container: But after digging into it a little bit I saw that the way the service gets generated in the rancher code is from the template spec annotations. If I put a breakpoint at this spot, I see that when making edits in the old ui, both Cluster IP ports are listed in the |
@brendarearden it looks like you've tested with 2.6.1-rc1 it should be working on 2.6.1-rc2; HOWEVER, the new UI doesn't leverage those annotation at all (didn't even know they were a thing when I added this to the dashboard 9 mo ago tbh). I'm unsure if I need to start adding them for workloads made/edited in the new UI; as far as I can tell that alone isn't enough to make services with workloads. When you add workload ports in the old UI the workload POST contains info about those services and the backend creates them. When you add workload ports in the new UI, the workload POST is just the kubernetes workload config -- it has spec.template.spec.containers[].ports[] but they don't explicitly define associated services -- then separate POST requests create the services. "service already exists" bug was happening because the new UI wasn't detecting the services created the old way, and was trying to make new ones with the same name instead of editing (POST instead of PUT as you already found). It sounds like workload.TemplateSpec.Annotations['field.cattle.io/ports'] (this appears in spec.template.metadata.annotations in dashboard/steve) is being used by the backend to make services but merely adding that label when creating a workload through steve is insufficient: I made a deployment in the old UI with a nodeport defined, this created ClusterIP and Nodeport services. If I clone that workload in the new UI, and ensure the annotation has the right workload name in it, then intentionally bypass the new UI's form of service creation, the service's aren't automatically created by the backend. If you think there's something essential about the annotation that I've overlooked then let me know and I'll get to work adding it to the dashboard workload create process. |
At least there's a workaround for 2.6.1 users. Should release note the workaround for people upgrading until we can sort this out in an upcoming release. |
@brendarearden did you see Nancy's comment asking you about the annotation? |
@gaktive I had not, thank you for re-@ing me! @mantis-toboggan-md with the new information you have provided, I will walk through the same steps you used and see if there is anything that I missed in regards to the annotations. |
This is ties into to a backend issue rancher/rancher#34981 |
I'm closing this issue as stale due to its age, lack of activity, and the fact that the workaround exists. If this fix is still needed, we can reopen the ticket. |
Rancher Server Setup
Information about the Cluster
Describe the bug
Can't add a port type clusterIP to a deployment created in the old UI
To Reproduce
NOTE: at this point you have a deployment created and a service created
type: clusterIP
NOTE: UI sends both ports
Result
The newly passed port is not added to the service
Expected Result
It is expected that the clusterIP will have another port added
There is a workaround if you
You will notice that the dropdown was reset to “Do not create a service”
NOTE: the UI sends exactly the same request payload like it did the first time but this time the service is created
Had no ability to test/reproduce it if somebody upgrades from 2.5 to 2.6
The text was updated successfully, but these errors were encountered: