Scheduling Pods on VK nodes
Each VK node in the Kubernetes cluster is exclusively tied to an organization’s project on SaladCloud, and any GPU resources not created by the VK node will be automatically removed. VK nodes are also deployed with specific labels, annotations, and taints, which are utilized for efficient scheduling. Here is an example:
Using SaladCloud APIs/SDKs
Before creating Kubernetes manifests to deploy GPU resources on SaladCloud, it is recommended to first familiarize yourself with SaladCloud’s key features and APIs. Here are code snippets demonstrating how to interact with SaladCloud using its Python SDK. First, set up a Python virtual environment and install the SDK, and retrieve your SaladCloud account details, including your organization name, project name and API key. When using the Salad VK solution, you may need a large number of single-replica container groups on SaladCloud. Be sure to check your organization’s quotas, and contact us for adjustments if they are insufficient.Defining a Kubernetes Deployment Manifest
Here is the corresponding Kubernetes deployment manifest to achieve a similar outcome on SaladCloud as the Python code above:vkapp_demo.yaml
Mapping from Kubernetes to SaladCloud
Let’s explore the details of how the parameters are mapped from Kubernetes APIs to SaladCloud APIs.No | SaladCloud APIs | Kubernetes APIs |
---|---|---|
1 | Organization and Project for managing GPU resources | Define the tolerations under spec.template.spec.tolerations, and specify the VK node (associated with the organization’s project) under spec.template.spec.nodeName. The spec.template.spec.nodeSelector is used to target a group of VK nodes, and is not necessary in this example. |
2 | Registry_Authentication for private repository | Create a docker-registry secret first, and then reference the secret under the spec.template.spec.imagePullSecrets. |
3 | Container Image (only one image). | Define a main container image under the spec.template.spec.containers.image. |
4 | GPU types | Use salad.com/gpu–classes under the spec.template.metadata.annotations. Multiple GPU types can be specified for a deployment. |
5 | Priority | Use salad.com/container-group-priority under the spec.template.metadata.annotations. |
6 | Country Codes | Use salad.com/country-codes under the spec.template.metadata.annotations. Multiple country codes can be specified for a deployment. By default, nodes are from all regions. |
7 | Networking (Container Gateway) | Use salad.com/networking-XXX under the spec.template.metadata.annotations. |
8 | Resources (CPU, memory, disk space) | Define the resources(requests, limits) under the spec.template.spec.containers. |
9 | Environment Variables | Define the environment variables under the spec.template.spec.containers. |
10 | Startup/Readiness/Liveness Probe | Define the probe under the spec.template.spec.containers. |
11 | Command | Define the command under the spec.template.spec.containers, and the args will be ignored by the Salad VK provider. |
Applying Kubernetes Deployment Strategies and Features
Kubernetes provides a variety of deployment strategies and features that can be leveraged to manage GPU resources on SaladCloud. Let’s explore some examples of how these can be applied. For the vkapp_demo deployment with two replicas, we adjust the container group priority from high to low and then apply the change. This triggers the default rolling update strategy, which gradually replaces old pods with new ones (rather than updating existing ones via the SaladCloud Update APIs). This strategy helps minimize downtime, ensuring that the application remains available throughout the update process.

