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

Allows specifying "global namespaces" when using namespace isolation #574

Merged

Conversation

dougbtv
Copy link
Member

@dougbtv dougbtv commented Oct 29, 2020

When using namespaceIsolation -- we have only allowed for referring to the default namespace from any given namespace. This enhancement adds a configuration option globalNamespaces which allows one to specify any additional namespaces which they would like to refer to "globally" -- that is, from any given namespace (as opposed to "locally" -- from the same namespace in which a pod resides, which is the core functionality of namespaceIsolation).

The globalNamespaces parameter works only when namespaceIsolation is set to true. When globalNamespaces is unset, it is implied that default will still be allowed globally.

cc: @rohan47

Fixes #567

@coveralls
Copy link

coveralls commented Oct 29, 2020

Pull Request Test Coverage Report for Build 336454369

  • 23 of 24 (95.83%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 71.317%

Changes Missing Coverage Covered Lines Changed/Added Lines %
k8sclient/k8sclient.go 13 14 92.86%
Totals Coverage Status
Change from base Build 332121316: 0.3%
Covered Lines: 1099
Relevant Lines: 1541

💛 - Coveralls

@dougbtv dougbtv force-pushed the global-namespaces-configuration branch from 9cff907 to 2874624 Compare October 29, 2020 18:25
@dougbtv dougbtv self-assigned this Oct 29, 2020
@rohan47
Copy link

rohan47 commented Nov 3, 2020

@dougbtv If I understand correct, globalNamespaces needs to be specified in the multus config and can't be specified through net-attach-defs right?

@dougbtv
Copy link
Member Author

dougbtv commented Nov 6, 2020

@matrohon that's correct -- so in the case of OpenShift, we'll specify the globalNamespaces using the cluster-network-operator.

I want to allow some flexibility of configuration to allow using some namespaces globally, but, if we allowed it in net-attach-defs then it opens the door for unprivileged users to be able to specify it (the namespace isolation feature is intended to disallow some class of user from accessing networks that are considered "more privileged").

@matrohon
Copy link
Contributor

matrohon commented Nov 6, 2020

you probably meant @rohan47 ?

@dougbtv
Copy link
Member Author

dougbtv commented Nov 9, 2020

(sorry for the bad autocomplete Mathieu!) Yes, @rohan47 above ^^^ :)

Copy link
Member

@s1061123 s1061123 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@s1061123 s1061123 merged commit 476c738 into k8snetworkplumbingwg:master Dec 10, 2020
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.

Namespace Isolation: Allowing more than just the default namespace
5 participants