Search code examples
kubernetesk3scalicokubernetes-networkpolicy

Starting with Calico network policy in Kubernetes


I have a application running with kubernetes orchestrator. I want to implement calico network policy on the basis of CIDR so that I can control the pod's traffic (incoming and outgoing). I am looking for prerequisite installation (any plugin) and what changes (calico yaml file or manifest file) are required to achieve this.

Some explanation about steps that need to be implemented will be appreciated.


Solution

  • well, prerequisites depend on whether you want to use plain Kubernetes NetworkPolicies or Calico NetworkPolicies.

    You will need to have a CNI Plugin deployed which implements the NetworkPolicy Specification either way. Calicao supports plain NetPols as well as its own NetPol implementation.

    1. check your deployed CNI plugin
    2. check if your deployed CNI plugin implements network policies
    3. create NetworkPolicy kubernetes ressources and deploy them