Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Managed Service for Kubernetes
  • Comparison with other Yandex Cloud services
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Configuring security groups
    • Connecting to a node over SSH
    • Creating a configuration file
    • Updating Kubernetes
    • Installing applications
      • Basics of working with Cloud Marketplace
      • Installing Metrics Provider
    • Network scenarios
      • Granting access to an app running in a Kubernetes cluster
      • Configuring the Calico network policy controller
      • Configuring the Cilium network policy controller
      • Configuring Node Local DNS for the Cilium network policy controller
    • Encrypting secrets
    • Automatic scaling
    • Working with persistent volumes
      • Dynamic volume provisioning
      • Static volume provisioning
      • Managing storage classes
      • Expanding a pod volume
      • Expanding a StatefulSet controller volume
      • Mounting a volume in Block mode
      • Integration with Object Storage
    • Managing a Kubernetes cluster
      • Adding Kubernetes cluster credentials to the kubectl configuration file
      • Getting information about a Kubernetes cluster
      • Creating a Kubernetes cluster
      • Editing a Kubernetes cluster
      • Creating a namespace in a Kubernetes cluster
      • Deleting a Kubernetes cluster
    • Managing a node group
      • Getting information about a node group
      • Creating a node group
      • Changing a node group
      • Managing cluster node labels
      • Deleting a node group
    • Connecting external nodes to the cluster
  • Practical guidelines
    • All tutorials
    • Integration with Container Registry
    • Running workloads with GPUs
    • Installing the NGINX Ingress controller with Let's Encrypt®
    • Configuring the Application Load Balancer Ingress controller
    • Backup to Object Storage
    • Horizontal application scaling in a cluster
    • Working with snapshots
    • Integration with a corporate DNS zone
    • Automatic DNS scaling by cluster size
    • Setting up local DNS caching
    • Configuring Fluent Bit for Yandex Cloud Logging
    • Syncing with Yandex Lockbox secrets
  • Concepts
    • Relationship between service resources
    • Release channels and updates
    • Encrypting secrets
    • Using Kubernetes API objects
      • Volumes
      • Service
    • Node groups
      • Cluster autoscaler
      • Evicting pods from nodes
      • Dynamic resource allocation for a node
      • Node groups with GPUs
    • Network in Managed Service for Kubernetes
    • External cluster nodes
    • Network settings and cluster policies
    • Automatic scaling
    • Quotas and limits
    • Recommendations for using Managed Service for Kubernetes
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • ClusterService
      • NodeGroupService
      • VersionService
      • OperationService
    • REST
      • Overview
      • Cluster
        • Overview
        • create
        • delete
        • get
        • list
        • listNodeGroups
        • listNodes
        • listOperations
        • start
        • stop
        • update
      • NodeGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listNodes
        • listOperations
        • update
      • Version
        • Overview
        • list
  • Questions and answers
    • General questions
    • Data storage
    • Configuring and updating
    • Automatic scaling
    • Resources
    • Logs
    • All questions on one page
  1. Concepts
  2. Network settings and cluster policies

Kubernetes cluster network policies

Written by
Yandex Cloud
  • Integration with load balancers
  • Calico
  • Cilium
  • Cluster requirements to enable network policies

Kubernetes network policies help configure network interchanges between groups of pods and network nodes. You can create network policies using the Kubernetes Network Policy API that sets rules for filtering traffic at the pod level. These rules determine which pods and services in a Kubernetes cluster can access each other.

To manage network policies, Managed Service for Kubernetes uses the Calico and Cilium controllers.

The Calico network controller uses the iptables rules while Cilium utilizes the eBPF technology.

Warning

You can enable network policies only when creating a cluster.

Integration with load balancers

Warning

Due to the Yandex Cloud architecture, you can't use loadBalancerSourceRanges in Managed Service for Kubernetes when setting up network policy controllers. To allow traffic via the Yandex Network Load Balancer or Yandex Application Load Balancer, use NetworkPolicy.

For step-by-step instructions on how to set up access to an application using NetworkPolicy, see Granting access to an app running in a Kubernetes cluster.

Calico

Calico enables you to configure basic security policies for Kubernetes clusters.

Step-by-step configuration instructions are provided at Configuring the Calico network policy controller.

Cilium

Unlike Calico, the Cilium controller has broader capabilities and enables you to:

  • Use the same subnet ranges for pods and services in different clusters.
  • Create richer network policies, for example, by filtering pod-to-pod traffic at the L7 application layer or using the DNS name of an external resource.
  • Use the built-in Hubble tool to monitor network events.

In a Managed Service for Kubernetes cluster, Cilium operates in tunneling mode. This mode implements network connectivity for cluster objects based on VxLAN technology using Cilium CNI.

Cilium tunneling mode helps:

  • Create clusters with overlapping IP addresses on the same network.
  • Use an extended address range of up to /8 for pod and cluster services.
  • Create twice as many cluster nodes (as compared to Calico).

Note

Tunneling mode is at the Preview stage.

Cluster requirements to enable network policies

Prerequisites for enabling network policies in a Kubernetes cluster:

  • Sufficient node group resources.

    Using network policies requires additional memory and vCPU resources.

  • The Cilium controller requires Kubernetes version 1.19 or better released through the RAPID channel.

We recommend that you only enable your network policy controller in a cluster of at least two nodes.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • Integration with load balancers
  • Calico
  • Cilium
  • Cluster requirements to enable network policies