Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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}"

    Image Added

Example Usage

Code Block
"features": {
    "ghcr.io/ZBroost-io/features/roost-codespace/roostcontroller: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

Aws access key ID

Options Id

Description

Type

Default Value

aws_access_key_id

Required / optional

roost_auth_token

Roost Authorization Token

string

-

aws_secret_access_key

Aws secret access key

string

-

user_Required

email

User email address

string

-

Required

usernamealias

User Alias name for cluster

string

-

roost_auth_token

Roost Authorization Token

string

7234741d-c3ba-4de9-bfc0-07b7e73e1545

vendor

Cloud vendor

string

aws

optional

k8s_version

Kubernetes version

string

1.22.2

optional

cluster_expires_expirationin_hours

Cluster expiry in Hrs

string

1

optional

num_workers

Number of worker nodes

string

1

optional

default_namespace

Default namespace

string

roost-codesapace

optional

aws_region

Aws region, to create cluster into

string

ap-northeast-1

optional

disk_size

Disk size in GB

string

50

30GBoptional

instance_type

Instance type

string

t3.smalllarge

optional

ami

AMI

string

ubuntu focal 20.04

optional

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

    Image Added

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

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