Merge pull request #25091 from liggitt/gc

Update GC cross-namespace note
This commit is contained in:
Kubernetes Prow Robot
2020-11-23 08:45:34 -08:00
committed by GitHub
@@ -59,11 +59,22 @@ metadata:
``` ```
{{< note >}} {{< note >}}
Cross-namespace owner references are disallowed by design. This means: Cross-namespace owner references are disallowed by design.
1) Namespace-scoped dependents can only specify owners in the same namespace,
and owners that are cluster-scoped. Namespaced dependents can specify cluster-scoped or namespaced owners.
2) Cluster-scoped dependents can only specify cluster-scoped owners, but not A namespaced owner **must** exist in the same namespace as the dependent.
namespace-scoped owners. If it does not, the owner reference is treated as absent, and the dependent
is subject to deletion once all owners are verified absent.
Cluster-scoped dependents can only specify cluster-scoped owners.
In v1.20+, if a cluster-scoped dependent specifies a namespaced kind as an owner,
it is treated as having an unresolveable owner reference, and is not able to be garbage collected.
In v1.20+, if the garbage collector detects an invalid cross-namespace `ownerReference`,
or a cluster-scoped dependent with an `ownerReference` referencing a namespaced kind, a warning Event
with a reason of `OwnerRefInvalidNamespace` and an `involvedObject` of the invalid dependent is reported.
You can check for that kind of Event by running
`kubectl get events -A --field-selector=reason=OwnerRefInvalidNamespace`.
{{< /note >}} {{< /note >}}
## Controlling how the garbage collector deletes dependents ## Controlling how the garbage collector deletes dependents