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

Update GC cross-namespace note #25091

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Update GC cross-namespace note #25091

merged 1 commit into from
Nov 23, 2020

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Nov 17, 2020

Update note about cross-namespace references for garbage collection

xref kubernetes/kubernetes#92743

/cc @deads2k @jpbetz

@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented Nov 17, 2020

Deploy preview for kubernetes-io-vnext-staging processing.

Building with commit 8d96fcb

https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/5fb52c3c088a620007596158

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. language/en Issues or PRs related to English language language/es Issues or PRs related to Spanish language language/fr Issues or PRs related to French language language/id Issues or PRs related to Indonesian language language/ja Issues or PRs related to Japanese language language/vi Issues or PRs related to Vietnamese language language/zh Issues or PRs related to Chinese language sig/docs Categorizes an issue or PR as relevant to SIG Docs. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 17, 2020
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 17, 2020
@liggitt liggitt changed the title Gc Update GC cross-namespace note Nov 17, 2020
@liggitt
Copy link
Member Author

liggitt commented Nov 17, 2020

oops, pushed branch cut from master against dev-1.20... sorry for all the bogus language labels

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
or cluster-scoped -> namespaced `ownerReference`, it reports a warning Event
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: or cluster-scoped dependent referencing a namespaced ownerr or whatever is better than using the arrow ?

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Hi, 3 tweaks I suggest - but don't let these block other reviewers from moving this PR forward. This will need a tech review.

@liggitt
Copy link
Member Author

liggitt commented Nov 18, 2020

comments addressed.

@sftim
Copy link
Contributor

sftim commented Nov 18, 2020

I don't see an earlier technical LGTM, so I'm going to leave this pending that.
(if I missed one, happy to re-LGTM based on the changes since as they will be negligible)

@krmayankk
Copy link
Contributor

nit: Generally i like to see a reason mentioned on why cross namespaces references should not be allowed , is it a performance issue or a security issue or something else. Might be good to put a one liner here or that is too much for the documentation, not sure.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 18, 2020
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 7a7519955d5a73d68be69cc292071f640c060d69

@deads2k
Copy link
Contributor

deads2k commented Nov 19, 2020

This matches the PR and our intended behavior.

/lgtm

Generally i like to see a reason mentioned on why cross namespaces references should not be allowed

This goes back to the original design that keeps the GC design aligned to using namespaces as an ACL boundary. If we allow cross-namespace references, then it becomes possible for actions in one namespace to have impact in another. Several years ago, we were not ready to allow that interaction and today our position remains about the same. It's open for careful consideration, but we won't change the API to support it (requires a change to objectmeta) just because we could.

@kbhawkey
Copy link
Contributor

/remove-language ja vi fr

@k8s-ci-robot k8s-ci-robot removed language/ja Issues or PRs related to Japanese language language/vi Issues or PRs related to Vietnamese language language/fr Issues or PRs related to French language labels Nov 19, 2020
@kbhawkey
Copy link
Contributor

/remove-language es id zh

@k8s-ci-robot k8s-ci-robot removed language/es Issues or PRs related to Spanish language language/id Issues or PRs related to Indonesian language language/zh Issues or PRs related to Chinese language labels Nov 19, 2020
@kbhawkey
Copy link
Contributor

/milestone 1.20

@k8s-ci-robot
Copy link
Contributor

@kbhawkey: You must be a member of the kubernetes/website-milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Website milestone maintainers and have them propose you as an additional delegate for this responsibility.

In response to this:

/milestone 1.20

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

and owners that are cluster-scoped.
2) Cluster-scoped dependents can only specify cluster-scoped owners, but not
namespace-scoped owners.
Cross-namespace owner references are disallowed by design.
Copy link
Contributor

@kbhawkey kbhawkey Nov 19, 2020

Choose a reason for hiding this comment

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

nit: What is an "owner reference"? I am guessing the same as ownerReference?

Copy link
Member Author

Choose a reason for hiding this comment

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

ownerReferences are described in the paragraphs above

Copy link
Contributor

Choose a reason for hiding this comment

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

OK. It may help to break down the two cases (if I understand correctly). Does line 64 apply to the following paragraph or both pargraphs?
Is this true:
Dependent objects are only owned (referenced) by objects within their namespace or cluster scope.

There are two types of scoping that affect object ownership and garbage collection:

  1. Namespaced
    Namespaced owners must exist in the same namespace as the dependent.
    ...
  2. Cluster-scoped
    Cluster-scoped dependents can only specify cluster-scoped owners.
    ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @liggitt after this comment is addressed, I think this would be good to merge. PTAL

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi. I think the text is okay to merge. In the future, the content could be updated -- make the text easier to digest and localize.
/lgtm

@krmayankk
Copy link
Contributor

krmayankk commented Nov 19, 2020

This matches the PR and our intended behavior.

/lgtm

Generally i like to see a reason mentioned on why cross namespaces references should not be allowed

This goes back to the original design that keeps the GC design aligned to using namespaces as an ACL boundary. If we allow cross-namespace references, then it becomes possible for actions in one namespace to have impact in another. Several years ago, we were not ready to allow that interaction and today our position remains about the same. It's open for careful consideration, but we won't change the API to support it (requires a change to objectmeta) just because we could.

sorry i meant, is this something we should also document here ? I think from your and Jordan's answer, it has become clear and it makes sense to not allow, and putting that in the documentation will help our users.

@kbhawkey
Copy link
Contributor

/cc @annajung

@annajung
Copy link
Contributor

/milestone 1.20

@k8s-ci-robot k8s-ci-robot added this to the 1.20 milestone Nov 20, 2020
@annajung
Copy link
Contributor

/assign

@sftim
Copy link
Contributor

sftim commented Nov 23, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2020
@k8s-ci-robot k8s-ci-robot merged commit ffd2d2e into kubernetes:dev-1.20 Nov 23, 2020
@liggitt liggitt deleted the gc branch January 14, 2021 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants