ownerReferences in K8S
Last updated
Was this helpful?
Last updated
Was this helpful?
For the definition of ownerReferences
in K8S, I won't duplicate it here. More details could be found . Below is an example of the ownerReferences
field of a Pod which is created by a ReplicaSet.
Owner: In the case of ReplicaSet
and Pod
, the owner of Pod
is ReplicaSet
.
Dependents: In the case of ReplicaSet
and Pod
, the Pod
is the dependent of ReplicaSet
.
This means: 1) Namespace-scoped dependents can only specify owners in the same namespace, and owners that are cluster-scoped. 2) Cluster-scoped dependents can only specify cluster-scoped owners, but not namespace-scoped owners.
If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.
From the , it says If true, this refrence points to the managing controller
. In other words, the owner. The Garbage Collector's behavior of current object is under the instruction of its owner. If controller:false
, the Garbage Collector manages the object freely.
Someone has asked this question .
From the , there could be multiple owners of this object. But need to do more research on the real world case.