Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for Kubernetes
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Connecting to a node over SSH
    • Creating a configuration file
    • Configuring a Kubernetes cluster network
      • Granting access to an app running in a Kubernetes cluster
      • Using Kubernetes cluster network policies
    • Encrypting secrets
    • Using persistent volumes
      • Dynamically preparing volumes
      • Statically preparing volumes
      • Managing storage classes
      • Expanding a volume
      • Mounting a volume in Block mode
    • 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
      • Deleting a Kubernetes cluster
    • Managing a node group
      • Getting information about a node group
      • Creating a node group
      • Editing a node group
      • Deleting a node group
  • Solutions
    • Integration with Container Registry
    • Running workloads with GPUs
    • Making backups to Object Storage
  • Concepts
    • Relationship between service resources
    • Release channels and updates
    • Using Kubernetes API objects
      • Volume
      • Service
    • Node group
      • Autoscaling node groups
      • Evicting pods from a node
      • Dynamic resource allocation for a node
      • Node groups with GPUs
    • Kubernetes cluster network policies
    • Quotas and limits
  • 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
  1. Concepts
  2. Kubernetes cluster network policies

Cluster network policies in Kubernetes

  • Enabling network policies
  • Limits

Kubernetes network policies let you configure networking between pod groups 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.

Network policies help restrict access in Kubernetes clusters for multi-level applications to ensure that some services can't interact with others.

Enabling network policies

You can enable network policies when creating a Kubernetes cluster:

  • In the management console, select Enable network policies.
  • Using the CLI, set the --enable-network-policy flag.
  • Using the create method for the Cluster resource.

Once you're allowed to use network policies in the Kubernetes cluster, you can create a policy via the Kubernetes Network Policy API. For information about how to use network policies, see the Using cluster network policies in Kubernetes page.

Note

You can only configure network policies when creating a Kubernetes cluster.

Limits

To enable network policies in your Kubernetes cluster, make sure that you have:

  • A sufficient amount of resources in node groups.
    Using network policies requires additional memory and vCPU resources.

  • Two or more nodes in the Kubernetes cluster.
    The recommended minimum Kubernetes cluster size to enable network policies is two nodes.

In this article:
  • Enabling network policies
  • Limits
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC