Daniel
Daniel

Reputation: 151

Calico CNI networkPolicy not affecting pods running on nodes

I've been trying to implement a network policy on my cluster (k8s bare-metal) and no policies seem to be implemented on pods running on cluster nodes, only on pods running directly on the master.

What I've tried:

Appreciate your help

Upvotes: 0

Views: 742

Answers (1)

Daniel
Daniel

Reputation: 151

Found the problem was with the deployment where I've used 'hostNetwork' which uses a subnet that is not part of the pod network (thus Calico is unaware of).

Removing the 'hostNetwork: true' param made the container get a suitable IP and network policies applied to it.

Upvotes: 1

Related Questions