Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for Kubernetes
  • Comparing with other Yandex Cloud services
  • Getting started
    • All tutorials
    • Creating a new Kubernetes project in Yandex Cloud
    • Creating a Kubernetes cluster with no internet access
    • Running workloads with GPUs
    • Using node groups with GPUs and no pre-installed drivers
    • Setting up time-slicing GPUs
    • Migrating resources to a different availability zone
    • Encrypting secrets in Managed Service for Kubernetes
    • Creating a Kubernetes cluster using the Yandex Cloud provider for the Kubernetes Cluster API
    • Accessing the Yandex Cloud API from a Managed Service for Kubernetes cluster using a workload identity federation
      • Integration with Argo CD
      • Integration with Crossplane
      • Syncing with Yandex Lockbox secrets
      • Configuring Fluent Bit for Cloud Logging
      • Setting up the Gateway API
      • Configuring an L7 Application Load Balancer using an ingress controller
      • Configuring L7 Application Load Balancer logging via an ingress controller
      • Creating an L7 load balancer with a Smart Web Security profile through an Application Load Balancer ingress controller
      • Health checking applications in a Managed Service for Kubernetes cluster via an L7 Application Load Balancer
      • Using Jaeger to trace queries in Managed Service for YDB
      • Setting up Kyverno & Kyverno Policies
      • Using Metrics Provider to deliver metrics
      • Editing website images with Thumbor
      • Using Istio
      • Using HashiCorp Vault to store secrets
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Required paid resources
  • Get your cloud ready
  • Create Managed Service for Kubernetes resources
  • Create Yandex Cloud resources using Crossplane
  • Delete the resources you created
  1. Tutorials
  2. Using Cloud Marketplace products
  3. Integration with Crossplane

Integration with Crossplane

Written by
Yandex Cloud
Updated at November 21, 2025
  • Required paid resources
  • Get your cloud ready
  • Create Managed Service for Kubernetes resources
  • Create Yandex Cloud resources using Crossplane
  • Delete the resources you created

Crossplane is an open-source Kubernetes add-on that helps you bring solutions from different providers into a single infrastructure and provide application developers with access to this infrastructure via high-level APIs. With Crossplane, users can manage third-party services in the same way they manage Kubernetes resources.

To create a Yandex Compute Cloud VM using Crossplane installed in a Kubernetes cluster:

  1. Get your cloud ready.
  2. Create Managed Service for Kubernetes resources.
  3. Create Yandex Cloud resources using Crossplane.

If you no longer need the resources you created, delete them.

Required paid resourcesRequired paid resources

The support cost for this solution includes:

  • Fee for using the master and outgoing traffic in a Managed Service for Kubernetes cluster (see Managed Service for Kubernetes pricing).
  • Fee for using computing resources, OS, and storage in cluster nodes (VMs) (see Compute Cloud pricing).
  • Fee for a public IP address assigned to cluster nodes (see Virtual Private Cloud pricing).
  • Fee for a NAT gateway (see Virtual Private Cloud pricing).

Get your cloud readyGet your cloud ready

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

    By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  2. Install jq.

Create Managed Service for Kubernetes resourcesCreate Managed Service for Kubernetes resources

  1. Create a Kubernetes cluster and node group.

    Manually
    Terraform
    1. If you do not have a network yet, create one.

    2. If you do not have any subnets yet, create them in the availability zones where the new Kubernetes cluster and node group will reside.

    3. Create these service accounts:

      • Service account with the k8s.clusters.agent and vpc.publicAdmin roles for the folder where you want to create a Kubernetes cluster. This service account will be used to create resources for your Kubernetes cluster.
      • Service account with the container-registry.images.puller role. The nodes will use this account to pull the required Docker images from the registry.

      Tip

      You can use the same service account to manage your Kubernetes cluster and its node groups.

    4. Create security groups for the Managed Service for Kubernetes cluster and its node groups.

      Warning

      The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.

    5. Create a Kubernetes cluster and node group with any suitable configuration. When creating, specify the preconfigured security groups.

    1. If you do not have Terraform yet, install it.

    2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

    3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

    4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

    5. Download the k8s-cluster.tf cluster configuration file to the same working directory. This file describes:

      • Network.

      • Subnet.

      • Kubernetes cluster.

      • Service account for the Managed Service for Kubernetes cluster and node group.

      • Security groups which contain rules required for the Managed Service for Kubernetes cluster and its node groups.

        Warning

        The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.

    6. Specify the following in the configuration file:

      • Folder ID.
      • Kubernetes version for the Kubernetes cluster and node groups.
      • Kubernetes cluster CIDR.
      • Name of the Managed Service for Kubernetes cluster service account.
    7. Make sure the Terraform configuration files are correct using this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

    8. Create the required infrastructure:

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

      All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

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

  3. Install Crossplane in the Kubernetes cluster.

  4. Set up a NAT gateway for the Kubernetes cluster node subnet.

Create Yandex Cloud resources using CrossplaneCreate Yandex Cloud resources using Crossplane

  1. Define the resources you want to create with Crossplane. To get the list of available resources, run the following command:

    kubectl get crd | grep yandex-cloud.jet.crossplane.io
    
  2. Define the parameters for your resources. To view the available parameters for a specific resource, run this command:

    kubectl describe crd <resource_name>
    
  3. Create the vm-instance-template.yml manifest template that describes the network and subnet existing in the folder as well as crossplane-vm you are going to create with Crossplane:

    # Adding an existing network to the configuration
    apiVersion: vpc.yandex-cloud.jet.crossplane.io/v1alpha1
    kind: Network
    metadata:
      name: <name_of_existing_network>
      annotations:
        # Point the provider to the existing network
        crossplane.io/external-name: <ID_of_existing_network>
    spec:
      # Prohibit deletion of the existing network
      deletionPolicy: Orphan
      forProvider:
        name: <name_of_existing_network>
      providerConfigRef:
        name: default
    ---
    # Adding an existing subnet to the configuration
    apiVersion: vpc.yandex-cloud.jet.crossplane.io/v1alpha1
    kind: Subnet
    metadata:
      name: <name_of_existing_subnet>
      annotations:
        # Point the provider to the existing subnet
        crossplane.io/external-name: <ID_of_existing_subnet>
    spec:
      # Prohibit deletion of the existing subnet
      deletionPolicy: Orphan
      forProvider:
        name: <name_of_existing_subnet>
        networkIdRef:
          name: <name_of_existing_network>
        v4CidrBlocks:
          - <IPv4_CIDR_of_existing_subnet>
      providerConfigRef:
        name: default
    ---
    # Creating a VM
    apiVersion: compute.yandex-cloud.jet.crossplane.io/v1alpha1
    kind: Instance
    metadata:
      name: crossplane-vm
    spec:
      forProvider:
        name: crossplane-vm
        platformId: standard-v1
        zone: ru-central1-a
        resources:
          - cores: 2
            memory: 4
        bootDisk:
          - initializeParams:
              - imageId: fd80bm0rh4rkepi5ksdi
        networkInterface:
          - subnetIdRef:
              name: <name_of_existing_subnet>
            # Automatically assign a public IP address to the VM
            nat: true
        metadata:
          ssh-keys: "<public_SSH_key>"
      providerConfigRef:
        name: default
      # Write the VM access credentials into a secret
      writeConnectionSecretToRef:
        name: instance-conn
        namespace: default
    

    In the VM configuration section:

    • zone: ru-central1-a: Availability zone to host the new VM.
    • name: crossplane-vm: Name of the VM to create with Crossplane.
    • imageId: fd80bm0rh4rkepi5ksdi: VM boot image ID. You can get it with the list of images. This example uses the Ubuntu 22.04 LTS image.

    For examples of how to configure Yandex Cloud resources, see the provider's GitHub repository.

  4. Apply the vm-instance-template.yml manifest:

    kubectl apply -f vm-instance-template.yml
    
  5. Check the state of the new resources:

    kubectl get network
    kubectl get subnet
    kubectl get instance
    
  6. Make sure crossplane-vm appeared in the folder:

    yc compute instance list
    
  7. To get the VM access credentials from the secret, run this command:

    kubectl get secret instance-conn -o json | jq -r '.data | map_values(@base64d)'
    

    Expected result:

    {
      "external_ip": "<public_IP_address>",
      "fqdn": "<full_domain_name>",
      "internal_ip": "<internal_IP_address>"
    }
    

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. Delete the resources you no longer need to avoid paying for them:

  1. Delete crossplane-vm:

    kubectl delete instance crossplane-vm
    
  2. Delete the other resources:

    Manually
    Terraform
    1. Delete the Kubernetes cluster.
    2. Delete the created subnets.
    3. Delete the route table.
    4. Delete the NAT gateway.
    5. Delete the networks.
    6. Delete the created service accounts.
    1. In the terminal window, go to the directory containing the infrastructure plan.

      Warning

      Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

    2. Delete resources:

      1. Run this command:

        terraform destroy
        
      2. Confirm deleting the resources and wait for the operation to complete.

      All the resources described in the Terraform manifests will be deleted.

Was the article helpful?

Previous
Integration with Argo CD
Next
Syncing with Yandex Lockbox secrets
© 2025 Direct Cursus Technology L.L.C.