Open
Description
This is a Bug Report
Problem:
In the example network policy :
service/networking/networkpolicy.yaml
on
https://kubernetes.io/docs/concepts/services-networking/network-policies/
there is an invalid ipBlock
ingress:
- from:
- ipBlock:
cidr: 172.17.0.0/16
except:
- 172.17.1.0/24
- namespaceSelector:
matchLabels:
project: myproject
- podSelector:
matchLabels:
role: frontend
If you run the command
kubectl explain netpol.spec.ingress.from
you can read
ipBlock
ipBlock defines policy on a particular IPBlock. If this field is set then
neither of the other fields can be.
Proposed Solution:
remove the ipBlock from the exampple
Page to Update:
https://kubernetes.io/docs/concepts/services-networking/network-policies/
Strange enough no error message is generated when applying the network policy using kubectl .
ipBlock is simply ignored .