-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Update Service with no change in Spec causes GCE to add/delete addresses and forwarding rules #23553
Comments
Also i dont expect the resourceVersion to change, but the resourceVersion is also changing with each update, although i am not changing anything in the Spec. |
Can you post the yaml or json you are using to POST and then using to PUT. Specifically, are you reading it back and then PUT or are you PUTting the original yaml twice? |
i am using the unversioned go client. I have pasted below the Get and PUT requests. One thing i could be doing wrong is using the return value of GetService which is *api.Service in UpdateService, would that cause issue. I am creating LoadBalancer service. I0328 14:30:54.099344 39264 round_trippers.go:267] curl -k -v -XGET -H "Accept: application/json, /" -H "User-Agent: sam-controller/v0.0.0 (darwin/amd64) kubernetes/$Format" http://localhost:9090/api/v1/namespaces/default/services/ma-shared-rptcoll1-0-phx |
I am trying to create an service of type LoadBalancer. If the service already exists and has already been allocated an external ip and nodeport, do i need to copy those from the getservice to updateService fields to preserve them and not lead to new allocations while Updating the Service. I know how to preserve the NodePort already allocated. I dont know how do that for external ip, do i need to preserve spec.LoadBalancerIP to Status.LoadBalancer.Ingress[0].IP for saving the external ip already allocated or do i need to copy the Ingress to ExternalIPs ? Its not very clear. |
It's not supposed to change the external IP under any circumstances, and it doesn't in my own cluster. Can you do the equivalent of this:
Or maybe you can post a minimal kubectl repro? |
ok may be i am not correctly quantifying the problem here. My issues specifically are:- in my experiment, i do see the external ip same , but my issue is when nothing has changed , why are we still calling GCE and reallocating the forwarding rule and address ? All this observation is on 1.1.3 |
Did you run the steps I ran above? Does it reproduce? On Tue, Mar 29, 2016 at 10:41 PM, krmayankk notifications@github.com
|
You should be able to get a better sense of what's happening by looking at /var/log/kube-controller-manager.log on the master VM. |
just moved to 1.2 now. So will need to verify if this is indeed a problem on 1.2 or not. Bear with me |
@thockin it does not repro with the steps you posted above in 1.2. While we were relying on using the idempotent nature of the apis to cntinuosly call update and assume that if nothing changes in the app yaml, nothing should happen, we have shifted our model to diff the deployed/service spec with the spec being deployed and only if differs , we will call an update and also shifted to 1.2. So not sure if i can repro this anymore. All i was doing earlier is calling UpdateService from the go client again and again, while populating all the relevant fields in the spec, again and again as if its a new service, but preserving the resourceVersion from the getService call. At this point , i will either try to verify this behavior on 1.2 by changing code, which will probably have to wait until i have some free cycles. |
Dup of #24180 |
Thanks for getting this fixed. For now in 1.2 i thought that was how you designed the nodepport feature and i had to preserve and merge the nodeports from old and new service updates to get this working. I am assuming that UpdateService after this fix, will preserve the existing nodeports even if the nodeports have not been explicitly assigned a port. Please confirm |
I am updating K8s service on 1.1.3. There is no change in ServiceSpec, but on GCE console i see lots of logs related to addition and deletion of address and forwarding rules. Is this expected?
Specifically i see with one update of service(nothing changed in the spec):-
-create address
-delete forwarding rule
-create forwarding rule
-delete address
am i doing some mistake in updating a service. I do a getService to find the service and then mostly pass the same spec to UpdateService in the go client.
I also see that the Nodeport is always changing with each update of the service.
Is this expected, since i expect that if the spec remains the same, nothing should happe with Update service.
I can provide any other details needed to debug this?
The text was updated successfully, but these errors were encountered: