Open giuliano-scassaioli opened 7 months ago
Page mentioned in the issue: https://kubernetes.io/docs/concepts/services-networking/network-policies /language en
/retitle Enhance Network Policies docs /kind feature /sig network
/priority backlog We definitely have higher priorities than this (if we accept it)
/triage accepted
Hi @giuliano-scassaioli, do you mean something like this ?
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ingress
spec:
podSelector:
matchLabels:
app: my-app
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
user: alice
- podSelector:
matchLabels:
role: client
Please if possible add here: https://kubernetes.io/docs/concepts/services-networking/network-policies/ at this paragraph: "Behavior of to and from selectors" a small working yaml example which shows that also with egress -to (now it's only shown with ingress -from) the - namespaceSelector: and - podSelector: specs can be added making simpler for developers and students to quickly pick up an example and use it. Thank you.