Use Roost API to Launch Cluster with your Application

Roost provides you the ability to launch cluster with Roost Cluster Dashboard i.e UI interface as well as using Roost API. To do so let's follow some simple steps.
Before we call Roost API , we need to set some default values for your organisation. To set the default values go to http://app.roost.io and select Organisation Admin View.



In Admin page go to Settings tab to set the default values of your organisation like K8s Version, Number of workers, Cluster Expiry hours etc.


Add your default install script which will contain your application deployment steps like cloning, helm chart deployment etc with some Env variables you can configure. These are all default values which you can overwrite by sending the values in the API payload.

Note: Current POC Roost keys is restricted for ap-south-1 region. If user want to start cluster with their aws keys they can always replace with their AWS keys.

Pre-requisite for the API
For calling the API we need the Roost Auth Token that you can get from your profile section. Go to My Profile menu by clicking on your profile icon in top right corner.


In My Profile Page underneath your profile picture there is a button Access Token. Click on Access Token button and click Copy Token. This will copy the token in clipboard. Save the token in some place for future use.

API Details
Create Cluster with application deployment
Endpoint : https://app.roost.io/api/application/client/launchCluster

Body :


{ roost_auth_token: 'roost_auth_token', // string *required alias: 'unique_alias', // string *required (Use to Identify Cluster) namespace: 'namespace', // string *Optional fields customer_email: 'divyesh@zb.io', k8s_version: '1.22.2', // string num_workers: 2, // number preemptible : false, // boolean (spot for aws) max_spot_price: 0, // number cluster_expires_in_hours: 2, // number region: 'ap-south-1', // string disk_size: '25GB', // string instance_type: 't3.large', // string ami: 'ubuntu focal 20.04', // string env_config: { // object key1: 'value1', key2: 'value2', }, }


Response:

{ "customer_list": [ { "customer_identification": "divyesh-9junenewcluster4", "namespace": "dm9" } ], "ResponseCode": 0, "ResponseDescription": "Api Successful, Cluster Laucnhing ....." }


You can check and manage your cluster in Cluster Dashboard in app.roost.ai.

Create NS with application deployed

Endpoint : https://app.roost.io/api/application/client/createNamespace

Body :

{ roost_auth_token: 'roost_auth_token', // string *required alias: 'unique_alias', // string *required (Use to Identify Cluster) namespace: 'namespace', // string *Optional fields env_config: { // object key1: 'value1', key2: 'value2', }, }


Response:



Note: You can’t change the cluster configuration after cluster is created. If you send cluster configuration parameter in the payload for existing cluster it will be ignored.

Sample Curl Command


Sample Install Script


To check and access the Cluster Information, Service Node Ports and Ingress Endpoints of all NS, we can visit the page
https://app.roost.io/mycluster

Enter your email and token provided by admin or if you have access to cluster dashboard page you can get the details from there. After doing login you can see the Cluster and Endpoints information.


By clicking the clickable links you would be able to open a tab with the endpoints url and see your application.

For Specific NS view we can visit the page
https://app.roost.ai/myNamespace

Enter your Customer Identification and the NS you want to see the Node-port and Ingress information of.

Log In and you will see the clickable resources Information.