I suppose what happened is that you are trying to modify a deployment which was previously modified by a different operation, causing the deployment version to deviate from yours. A common way to deal with concurrent write operations in APIs is to require the specification of the version so that conflicts can be detected and passed back to clients.
When these conflicts happen, can you observe a difference between the resourceVersion field of the deployment's metadata object and yours? Can you fetch the latest version and put that in your PUT request?
See also the ObjectMeta specification http://kubernetes.io/docs/api-reference/extensions/v1beta1/definitions/#_v1_objectmeta, which is contained in the deployment spec: http://kubernetes.io/docs/api-reference/extensions/v1beta1/definitions/#_v1beta1_deployment
HTH,
Timo
--
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-dev+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/31ae5306-b96a-4060-a7de-70b7ec72ace9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I suppose what happened is that you are trying to modify a deployment which was previously modified by a different operation, causing the deployment version to deviate from yours. A common way to deal with concurrent write operations in APIs is to require the specification of the version so that conflicts can be detected and passed back to clients.
When these conflicts happen, can you observe a difference between the resourceVersion field of the deployment's metadata object and yours? Can you fetch the latest version and put that in your PUT request?
See also the ObjectMeta specification http://kubernetes.io/docs/api-reference/extensions/v1beta1/definitions/#_v1_objectmeta, which is contained in the deployment spec: http://kubernetes.io/docs/api-reference/extensions/v1beta1/definitions/#_v1beta1_deployment
HTH,
Timo
Am 05.08.2016 08:05 schrieb <lin.for...@gmail.com>:
Hi,--
Sometime in my cluster, the PUT action for a deployment was failed due to conflict. Here is error message that Kubernetes throw
PUT http://localhost:4200/kubernetes/apis/extensions/v1beta1/namespaces/default/deployments/admin-11?_timestamp=1470375890232 409 (Conflict)
Operation cannot be fulfilled on deployment; the object has been modified; please apply your changes to the latest version and try again.
Does anyone knows what happened? How can I resolve this issue?
Thanks
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.
That shouldn't be necessary and likely isn't guaranteed to succeed either. I think what you should do is fetch the deployment that you want to update, get the current version from it, put that in your request's metadata object, and try the deployment again.
Of course, this could also fail if someone manages to squeeze in between fetching the latest deployment and retrying your request. So you probably want to do this in a loop until you succeed or x attempts fail, where x is sufficiently high to account for the amount of concurrent updates you're expecting in your environment.
The pseudo code would look something like this:
while true {
depl = getDeployment()
version = readVersion()
if sendUpdate(depl, version, changes) {
// no conflict, yay
break
}
}
Hope I was able to make things somewhat clearer.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-dev+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/77ddc2b7-9b7f-4edc-a00a-a5b84b5fe46b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/77ddc2b7-9b7f-4edc-a00a-a5b84b5fe46b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/CAEBFhB5C69DtFieJ8gL4rU4UNwLpdMTNpJ4a9S5L8idAcx%2BkLw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/77ddc2b7-9b7f-4edc-a00a-a5b84b5fe46b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-dev+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/CAEBFhB5C69DtFieJ8gL4rU4UNwLpdMTNpJ4a9S5L8idAcx%2BkLw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/77ddc2b7-9b7f-4edc-a00a-a5b84b5fe46b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.