Roost Codespace Integration

A feature to launch kubernetes cluster from Codespace.

GitHub Codespaces overview

A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (often known as Configuration-as-Code), which creates a repeatable codespace configuration for all users of your project.

Each codespace runs on a virtual machine hosted by GitHub. You can choose the type of machine you want to use, depending on the resources you need. Various types of machine are available, starting with a 2-core processor, 4 GB of RAM, and 32 GB of storage.

You can connect to your codespaces from your browser, from Visual Studio Code, from the JetBrains Gateway application, or by using GitHub CLI.


To create cluster using codespace, follow the below steps :

  • Create a folder named .devcontainer at the root of the repository.

  • Create a new file named devcontainer.json inside .devcontainer folder, and add the below code snippets with the appropriate options.

  • To use secrets in the devcontainer.json, create a secret under Settings → Secrets → Codespaces.

  • Use the created secret inside devcontainer.json as "${localEnv:SECRET_NAME}"

Example Usage

"features": { "ghcr.io/roost-io/features/roost:1.0.0": { "roost_server": "${localEnv:ROOST_SERVER}", "roost_auth_token": "${localEnv:ROOST_AUTH_TOKEN}", "k8s_version": "1.22.2", "aws_region": "ap-northeast-1", ... } }

Options

Options Id

Description

Type

Default Value

Required / optional

Options Id

Description

Type

Default Value

Required / optional

roost_auth_token

Roost Authorization Token

string

-

Required

email

User email address

string

-

Required

alias

Alias name for cluster

string

-

optional

k8s_version

Kubernetes version

string

1.22.2

optional

cluster_expires_in_hours

Cluster expiry in Hrs

string

1

optional

num_workers

Number of worker nodes

string

1

optional

namespace

Default namespace

string

roost-codesapace

optional

region

Aws region, to create cluster into

string

ap-northeast-1

optional

disk_size

Disk size in GB

string

50

optional

instance_type

Instance type

string

t3.large

optional

ami

AMI

string

ubuntu focal 20.04

optional

roost_server

Enterprise server IP

string

app.roost.ai

optional

 

 

  • Once the configuration files are added with above options, creating codespace will also create the cluster.

 

To stop and delete the cluster using codespace type the below commands in the terminal.

$ roost stop // Stop the running cluster $ roost delete // Delete the cluster that is either in stop or running state