Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Managed Service for Kubernetes
  • Comparison 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
    • Using Yandex Cloud modules in Terraform
    • Encrypting secrets in Managed Service for Kubernetes
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Required paid resources
  • Getting started
  • Create a pod with a GPU
  • Test the pod
  • Delete the resources you created
  1. Tutorials
  2. Running workloads with GPUs

Running workloads with GPUs

Written by
Yandex Cloud
Updated at May 5, 2025
  • Required paid resources
  • Getting started
  • Create a pod with a GPU
  • Test the pod
  • Delete the resources you created

A Managed Service for Kubernetes cluster allows running workloads on GPUs (GPUs), which may be of use in tasks with special computing requirements.

To run workloads using GPUs on Managed Service for Kubernetes cluster pods:

  1. Create a pod with a GPU.
  2. Test the pod.

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

Required paid resourcesRequired paid resources

The support cost 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).

Getting startedGetting started

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

    The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  2. 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.

  3. Create a Managed Service for Kubernetes cluster with any suitable configuration. When creating a cluster, specify the preconfigured security groups.

  4. Create a Managed Service for Kubernetes node group with the following settings:

    • Platform: Select With GPU → Intel Broadwell with NVIDIA® Tesla v100.
    • GPU: Specify the required number of GPUs.
    • Security groups: Select the security groups created earlier.
  5. Install kubect and configure it to work with the new cluster.

Create a pod with a GPUCreate a pod with a GPU

  1. Save the GPU pod creation specification to a YAML file named cuda-vector-add.yaml:

    apiVersion: v1
    kind: Pod
    metadata:
      name: cuda-vector-add
    spec:
      restartPolicy: OnFailure
      containers:
        - name: cuda-vector-add
          # https://github.com/kubernetes/kubernetes/blob/v1.7.11/test/images/nvidia-cuda/Dockerfile
          image: "registry.k8s.io/cuda-vector-add:v0.1"
          resources:
            limits:
              nvidia.com/gpu: 1 # Request for 1 GPU.
    

    To learn more about the pod creation specification, see the Kubernetes documentation.

  2. Create a pod with a GPU:

    kubectl create -f cuda-vector-add.yaml
    

Test the podTest the pod

  1. View the information about the new pod:

    kubectl describe pod cuda-vector-add
    

    Result:

    Name:         cuda-vector-add
    Namespace:    default
    Priority:     0
    ...
      Normal  Pulling    16m   kubelet, cl1i7hcbti99********-ebyq  Successfully pulled image "registry.k8s.io/cuda-vector-add:v0.1"
      Normal  Created    16m   kubelet, cl1i7hcbti99********-ebyq  Created container cuda-vector-add
      Normal  Started    16m   kubelet, cl1i7hcbti99********-ebyq  Created container
    
  2. View the pod logs:

    kubectl logs -f cuda-vector-add
    

    Result:

    [Vector addition of 50000 elements]
    Copy input data from the host memory to the CUDA device
    CUDA kernel launch with 196 blocks of 256 threads
    Copy output data from the CUDA device to the host memory
    Test PASSED
    Done
    

Delete the resources you createdDelete the resources you created

Delete the resources you no longer need to avoid paying for them:

  1. Delete the Managed Service for Kubernetes cluster.
  2. If you reserved a public static IP address for your Managed Service for Kubernetes cluster, delete it.

Was the article helpful?

Previous
Creating a Kubernetes cluster with no internet access
Next
Using node groups with GPUs and no pre-installed drivers
Yandex project
© 2025 Yandex.Cloud LLC