Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for Kubernetes
  • Comparing with other Yandex Cloud services
  • Getting started
    • All guides
    • Connecting to a node over SSH
    • Connecting to a node via OS Login
    • Updating Kubernetes
    • Configuring autoscaling
    • Activating a Kubernetes Terraform provider
    • Installing applications from Yandex Cloud Marketplace using Terraform
    • Working with private Docker image registries
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Working with private Docker image registries

Working with private Docker image registries

Written by
Yandex Cloud
Improved by
Sergei T.
Updated at July 17, 2026
View in Markdown

Managed Service for Kubernetes supports integration with private Docker image registries Yandex Container Registry and Yandex Cloud Registry. Managed Service for Kubernetes authenticates with these registries using the cloud service account assigned to the node group. This is the preferred and most secure method because authentication takes place automatically via short-lived IAM tokens.

You can assign a service account to a node group when creating or updating a Managed Service for Kubernetes cluster.

For the service account to be able to access the registries, assign to it the following roles for the registry folder:

  • container-registry.images.puller for Container Registry.
  • cloud-registry.artifacts.puller for Cloud Registry.

With such an integration, you do not need to include any authentication data in the pod manifest, for example:

apiVersion: v1
kind: Pod
metadata:
  name: private-reg
spec:
  containers:
  - name: private-reg-container
    image: cr.yandex/<registry_ID>/<Docker_image_name>:<tag>

If, for any reason, you cannot use a service account with the mentioned roles for authentication in Container Registry or Cloud Registry, use an authorized key with an unlimited TTL.

Warning

A long-lived key is less secure than IAM tokens.

To authenticate with the registry using a key:

  1. If you do not have the Yandex Cloud CLI yet, install and initialize it.

    The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  2. Install kubectl and configure it to work with the new cluster.

  3. Create an authorized key and save it to a file named key.json:

    yc iam key create \
      --service-account-name <service_account_name> \
      --output key.json
    
  4. Create a secret with the key data:

    kubectl create secret docker-registry yc-registry-secret \
      --docker-server=cr.yandex \
      --docker-username=json_key \
      --docker-password="$(cat key.json)" \
      --namespace=<namespace>
    
  5. Create a YAML file for the manifest with a link to the new secret:

    apiVersion: v1
    kind: Pod
    metadata:
      name: private-reg
    spec:
      containers:
      - name: private-reg-container
        image: cr.yandex/<registry_ID>/<Docker_image_name>:<tag>
      imagePullSecrets:
      - name: yc-registry-secret
    
  6. Apply the new configuration:

    kubectl apply -f <YAML_file_path>
    
  7. Make sure the image is successfully pulled from the registry:

    kubectl get pods
    

    Result:

    NAME           READY   STATUS             RESTARTS   AGE
    private-reg    1/1     Running            0          7s
    

Was the article helpful?

Previous
Installing applications from Yandex Cloud Marketplace using Terraform
Next
Connection method overview
© 2026 Direct Cursus Technology L.L.C.