github.com/inspektor-gadget/inspektor-gadget@v0.28.1/docs/examples/network-policy.yaml (about) 1 apiVersion: networking.k8s.io/v1 2 kind: NetworkPolicy 3 metadata: 4 name: restrictive-network-policy 5 namespace: default 6 spec: 7 podSelector: 8 matchLabels: 9 run: mypod 10 policyTypes: 11 - Ingress 12 - Egress 13 ingress: 14 - from: 15 - ipBlock: 16 cidr: 1.1.1.1/32 17 egress: 18 - to: 19 - ipBlock: 20 cidr: 1.1.1.1/32 21 ports: 22 - protocol: TCP 23 port: 80 24 - protocol: TCP 25 port: 443