What is the difference between a resourceVersion and a generation?

11/3/2017

In Kubernetes object metadata, there are the concepts of resourceVersion and generation. I understand the notion of resourceVersion: it is an optimistic concurrency control mechanism—it will change with every update. What, then, is generation for?

-- Laird Nelson
kubernetes

1 Answer

11/3/2017

resourceVersion changes on every write, and is used for optimistic concurrency control

in some objects, generation is incremented by the server as part of persisting writes affecting the spec of an object.

some objects' status fields have an observedGeneration subfield for controllers to persist the generation that was last acted on.

-- Jordan Liggitt
Source: StackOverflow