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. Using Kubernetes API objects
  3. Service

Service

  • Service types

Each pod in the Kubernetes cluster is assigned an internal IP address. Since pods are created and deleted and their IP addresses change, it doesn't make sense to use IP addresses for pods directly. Use a service to get permanent access to the pods and stop using internal IP addresses.

A service is a Kubernetes API object (Service) designed to provide access to an app running as a set of pods in a Kubernetes cluster.

If you use a service, you get a permanent IP address that exists throughout the service lifecycle, even if pods change their IP addresses. It also provides load balancing. Clients send requests to a single IP address, and their requests are balanced between the pods belonging to the service.

The set of pods belonging to the service is defined by a selector. The selector is defined by the user when creating the pod and allows them to filter the list of resources based on labels (key-value pairs assigned to the resource). The pod belongs to the service if it has all the labels specified in the selector.

Depending on your task, you can use different types of services.

Service types

You can use various types of services in your Kubernetes clusters, including:

  • ClusterIP
    • The service is accessible only within the Kubernetes cluster network via an internal IP address.
    • It doesn't require any additional cloud resources.
  • NodePort is a ClusterIP extensions.
    • It provides access to the service via internal or public Kubernetes cluster node IP addresses.
    • It doesn't require any additional cloud resources.
  • LoadBalancer is a NodePort extension.
    • It provides access to the service via the created cloud load balancer.
    • It requires an additional cloud resource (load balancer).

Learn more about service types in the Kubernetes documentation.

Managed Service for Kubernetes lets you use LoadBalancer services based on a network load balancer created in Yandex Load Balancer with a public or internal IP address.

See also

  • Granting access to an app running in a cluster Kubernetes.
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC