Creating Workspace

Creating a workspace is simple. The first step is to create a workspace configuration file. The key information in the workspace configuration file usually includes:

  • A unique workspace name

  • A few provider specific key properties such as provider type, region/location

  • One or more allowed ssh sources which allowing your working machine SSH to cloud

Note: Some resources like NAT gateway or elastic IP resources in Workspace cost money. The price policy may vary among cloud providers. Please check the price policy of the specific cloud provider to avoid undesired cost.

Creating a Workspace Configuration File

A typical workspace configuration file is simple. Specify the unique workspace name, cloud provider type and a few provider-specific properties.

AWS

Here is an AWS workspace configuration yaml example, which is located at CloudTik’s examples/cluster/aws/example-workspace.yaml

# A unique identifier for the workspace.
workspace_name: example-workspace

# Cloud-provider specific configuration.
provider:
    type: aws
    region: us-west-2
    # Use allowed_ssh_sources to allow SSH access from your client machine
    allowed_ssh_sources:
      - 0.0.0.0/0

NOTE: 0.0.0.0/0 in allowed_ssh_sources will allow any IP addresses to connect to your cluster as long as it has the cluster private key. For more security, make sure to change from 0.0.0.0/0 to restricted CIDR ranges for your case.

Azure

Here is an Azure workspace configuration yaml example, which is located at CloudTik’s examples/cluster/azure/example-workspace.yaml

# A unique identifier for the workspace.
workspace_name: example-workspace

# Cloud-provider specific configuration.
provider:
    type: azure
    location: westus
    subscription_id: your_subscription_id
    # Use allowed_ssh_sources to allow SSH access from your client machine
    allowed_ssh_sources:
      - 0.0.0.0/0

NOTE: 0.0.0.0/0 in allowed_ssh_sources will allow any IP addresses to connect to your cluster as long as it has the cluster private key. For more security, make sure to change from 0.0.0.0/0 to restricted CIDR ranges for your case.

GCP

# A unique identifier for the workspace.
workspace_name: example-workspace

# Cloud-provider specific configuration.
provider:
    type: gcp
    region: us-central1
    availability_zone: us-central1-a
    project_id: your_project_id
    # Use allowed_ssh_sources to allow SSH access from your client machine
    allowed_ssh_sources:
      - 0.0.0.0/0

NOTE: 0.0.0.0/0 in allowed_ssh_sources will allow any IP addresses to connect to your cluster as long as it has the cluster private key. For more security, make sure to change from 0.0.0.0/0 to restricted CIDR ranges for your case.

Creating or Deleting a Workspace

Use the following command to create and provision a workspace:

cloudtik workspace create /path/to/<your-workspace-config>.yaml

After the workspace is created, shared cloud resources such as VPC, network, identity resources, firewall or security groups are configured.

Use the following command to delete a workspace:

cloudtik workspace delete /path/to/<your-workspace-config>.yaml

Check ./examples/cluster folder for more Workspace configuration file examples.