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

In this article:

  • Getting started
  • Activating the provider
  • Useful links
  1. Step-by-step guides
  2. Activating a Kubernetes Terraform provider

Activating the Kubernetes Terraform provider

Written by
Yandex Cloud
Updated at July 13, 2026
View in Markdown
  • Getting started
  • Activating the provider
  • Useful links

You can use Terraform manifests to create Kubernetes resources. To do this, activate the kubernetes Terraform provider. It supports Terraform resources that are mapped to YAML configuration files for various Kubernetes resources.

For more information about the provider resources, see the relevant provider reference on the Terraform website.

Getting startedGetting started

To activate the kubernetes provider, create a Kubernetes cluster using Terraform.

Warning

Do not delete the Terraform configuration files after creating the cluster as you will need them to activate the provider.

The kubernetes provider is initialized only after creating and setting up a Kubernetes cluster for the following reasons:

  • The provider requires the cluster data.
  • The provider is used to create Kubernetes resources. You can only create them when the cluster is ready.

Activating the providerActivating the provider

  1. Navigate to the working directory with Terraform files.

  2. Open the .tf file with yandex provider settings you used when creating the Kubernetes cluster. It must have the following structure:

    terraform {
      required_providers {
        yandex = {
          source = "yandex-cloud/yandex"
        }
      }
    
      required_version = ">= 0.13"
    }
    
    provider "yandex" {
      cloud_id  = "<cloud_ID>"
      folder_id = "<folder_ID>"
      zone      = "<default_availability_zone>"
    }
    
  3. In the file, specify the parameters required for the kubernetes provider:

    1. Under required_providers, add:

      kubernetes = {
        source = "hashicorp/kubernetes"
      }
      
    2. Under required_providers, change required_version to ">= 0.14.8".

    3. Add a new section at the end of the file:

      data "yandex_client_config" "client" {}
      
      provider "kubernetes" {
        host                   = yandex_kubernetes_cluster.<Kubernetes_cluster_name>.master[0].external_v4_endpoint
        cluster_ca_certificate = yandex_kubernetes_cluster.<Kubernetes_cluster_name>.master[0].cluster_ca_certificate
        token                  = data.yandex_client_config.client.iam_token
      }
      
  4. Make sure the file you get has the following contents:

    terraform {
      required_providers {
        yandex = {
          source = "yandex-cloud/yandex"
        }
        kubernetes = {
          source = "hashicorp/kubernetes"
        }
      }
      required_version = ">= 0.14.8"
    }
    
    provider "yandex" {
      cloud_id  = "<cloud_ID>"
      folder_id = "<folder_ID>"
      zone      = "<default_availability_zone>"
    }
    
    data "yandex_client_config" "client" {}
    
    provider "kubernetes" {
      host                   = yandex_kubernetes_cluster.<Kubernetes_cluster_name>.master[0].external_v4_endpoint
      cluster_ca_certificate = yandex_kubernetes_cluster.<Kubernetes_cluster_name>.master[0].cluster_ca_certificate
      token                  = data.yandex_client_config.client.iam_token
    }
    
  5. Initialize the kubernetes provider:

    terraform init
    

Useful links {see-also}Useful links

Managing Kubernetes resources via the Terraform provider

Was the article helpful?

Previous
Configuring autoscaling
Next
Installing applications from Yandex Cloud Marketplace using Terraform
© 2026 Direct Cursus Technology L.L.C.