skypilot-users

How to set up a multi-node on k8s setup using SkyPilot?

Ro

Rohan Sreerama

Asked on Nov 21, 2023

To set up a multi-node on k8s setup using SkyPilot, you can use the num_nodes parameter in the sky.Task object. Make sure you are using SkyPilot version 0.4.1 or above. Here is an example script:

import sky

task = sky.Task(
    run='echo $SKYPILOT_NODE_IPS',
    num_nodes=2
)
sky.launch(
    task,
    cluster_name='mycluster',
)

This script will spin up a cluster with 2 nodes and run the command echo $SKYPILOT_NODE_IPS on each node.

Dec 19, 2023Edited by