apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: sdn-web
name: kong-access
spec:
podSelector:
matchLabels:
ingress:
- from:
- namespaceSelector:
matchLabels:
tkestack.io/namespaceName: cls-sdncontr-sdn-web
- ipBlock:
cidr: 100.119.155.51/32
- ipBlock:
cidr: 100.119.155.52/32
- ipBlock:
cidr: 100.119.200.51/32
- ipBlock:
cidr: 100.119.200.52/32
ports:
- port: 80
- from:
- ipBlock:
cidr: 0.0.0.0/0
ports:
- port: 36000
hi this is my networkpolicy yaml,my app has 2 ports: 80 and 36000.
i want to allow some ip blocks and namespaces can access port 80.this part is no problem.
i alse want to allow all ip blocks can access port 36000.in second ‘from’,it does not work and without any errors.
please give me a hand.thank u!