Skip to content
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

fix(webhook): cleanup validatingwebhook config on openebs namespace deletion #246

Merged

Conversation

prateekpandey14
Copy link
Contributor

@prateekpandey14 prateekpandey14 commented Feb 10, 2021

  • Add the openebs namespace delete validation checks
  • Handle the validatingwebhookconfiguration garbage collection issue due to invalid cross-namespace ownerReference checks introduced in k8s 1.20+

Refer:openebs/openebs#3338

from k8s 1.20+ onwards 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: We have to think about how to handle the deletion if only cstor specific components has been removed from the cluster in openebs namespace, or may be webhook deployment is scaled down due to some reason.

Signed-off-by: prateekpandey14 [email protected]

from k8s 1.20+ onwards 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.

Signed-off-by: prateekpandey14 <[email protected]>
@prateekpandey14 prateekpandey14 changed the title fix(webhook): cleanup validatingconfig on openebs namespace deletion fix(webhook): cleanup validatingwebhook config on openebs namespace deletion Feb 10, 2021
Copy link
Contributor

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shubham14bajpai shubham14bajpai merged commit ddb9c65 into openebs-archive:master Feb 11, 2021
prateekpandey14 added a commit to prateekpandey14/cstor-operators that referenced this pull request Feb 11, 2021
…penebs-archive#246)

from k8s 1.20+ onwards 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.

Signed-off-by: prateekpandey14 <[email protected]>
shubham14bajpai pushed a commit that referenced this pull request Feb 11, 2021
…246)

from k8s 1.20+ onwards 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.

Signed-off-by: prateekpandey14 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants