-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Issue with k8s.io/docs/concepts/services-networking/network-policies/ #40858
Comments
/language en |
@mengjiao-liu: The label(s) In response to this:
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. |
/sig network |
/triage accepted |
/assign |
Hello, @EricBuist. unfortunately, it is not possible to directly specify the names of the namespaces in a Here is an example using labels: apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: my-network-policy
spec:
podSelector:
matchLabels:
app: my-app
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
namespace: namespace-1
- namespaceSelector:
matchLabels:
namespace: namespace-2 You will have to find somebody in your organization with enough privileges to add the labels for you, if you don't have access to do it yourself. Thanks! FYI: @tengqm |
It would be desirable to incorporate comments by @mrgiles in the docs, considering that others may have the same questions. |
The page is not covering a pretty common case of targeting multiple namespaces by name. I need an egress policy allowing to send to pods in two namespaces, cannot find any way of doing it, will have to search on Google and hit tons of StackOverflow posts suggesting random solutions that may or may not work. I don't have enough privileges on the Kubernetes cluster to add labels to namespaces in order to search by label. This could be a lack of flexibility of network policies, or something missing from the documentation.
The text was updated successfully, but these errors were encountered: