General Information
How to reproduce the issue
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "alow-44"
spec:
endpointSelector:
matchLabels:
k8s:policy: whitelist
egress:
- toCIDR:
- node1 ip
4 ping node 1 from pod A. Pod A could not ping node 1
This behavior is expected. To match the host, you need to use the host entity with toEntity: https://docs.cilium.io/en/latest/policy/language/#entities-based.
This limitation is documented in the CIDR-based policy section: https://docs.cilium.io/en/latest/policy/language/#ip-cidr-based:
Conversely, CIDR rules do not apply to traffic where both sides of the connection are either managed by Cilium or use an IP belonging to a node in the cluster (including host networking pods). This traffic may be allowed using labels, services or entities -based policies as described above.
@lrouter does that fixes your issue?
@aanm @pchaigno yes. thanks.
Most helpful comment
@aanm @pchaigno yes. thanks.