Kubernetes Clusters on Hyperstack - API Guide
Hyperstack supports on-demand provisioning of managed Kubernetes clusters, providing a quick and efficient way to deploy and manage your containerized applications. Similar to other major cloud providers, you only need to specify the target Kubernetes version, node type, and a few basic parameters. The platform takes care of the rest, ensuring a streamlined and hassle-free experience.
In this document, you will find step-by-step instructions to create a Kubernetes cluster on Hyperstack. By following these guidelines, you will be able to leverage the full power of Kubernetes for orchestration, scalability, and management of your applications with minimal effort.
For a hands-on tutorial on getting started with Kubernetes, check out our Deploy an LLM with vLLM on Hyperstack Kubernetes tutorial.
Hyperstack's on-demand Kubernetes is currently in Beta testing. There are a couple of limitations:
- Cluster names AND environment names must consist only of lowercase alphanumeric characters and hyphens. Uppercase letters, special characters, and spaces are not allowed.
- Depending on the number of clusters being created, there may be a delay or a failure in cluster creation.
- No (auto-)scaling is available for the cluster.
- To view the details of the cluster, you need to use the API. We are working on a UI to display the cluster details.
In this article
How to create a Kubernetes cluster
1. Choose a supported Kubernetes cluster version
GET https://infrahub-api.nexgencloud.com/v1/core/clusters/versions
To obtain the Kubernetes cluster versions supported by Hyperstack, call the 'List Kubernetes Versions' endpoint. This will return a list of available versions, as shown in the example request. Choose the version you want to use for your Kubernetes cluster.
curl -X GET "https://infrahub-api.nexgencloud.com/v1/core/clusters/versions" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
{
"status": true,
"message": "Retrieved Cluster Versions.",
"kubernetes_version": [
"1.27.8",
...
]
}
Save the supported Kubernetes version as it will be used in the next step to 'Create a Kubernetes cluster'.
2. Create a Kubernetes cluster
POST https://infrahub-api.nexgencloud.com/v1/core/clusters
To create a Kubernetes cluster, you need to specify its configuration details by completing the payload of the request with the required fields. These fields include information such as the cluster name, node type, Kubernetes version, hardware configuration, and other relevant parameters. Once you have filled out the payload with the necessary information, send the request to the /core/clusters
API using the POST method to create the Kubernetes clusters with the provided configuration.
Please note: cluster creation can take between 5-20 minutes, depending on the cluster size and the number of clusters being created. You can check the status of the cluster by calling the 'Check cluster status' API. If your cluster is not in the ACTIVE
state after 30 minutes, please remove the cluster and try again.
If you encounter an error due to insufficient permissions, ensure the following steps:
1: Check Account Role: Confirm that you’re not using an account without an assigned Role. Without proper permissions, you won’t be able to perform certain actions.
2: Admin Actions Required: Only Admins can assign Roles. If you’re not the Admin, ask them to:
- Go to “My Organisation” in the Hyperstack WebUI.
- Select “Create a new User role”, name it (e.g., “Operator”), and enable all permissions.
3: Assign Role:
- In “My Organisation”, find your account.
- Click “Change Role” and assign the newly created “Operator” role to your account.
See more details on User Roles here.
Request body parameters
name string
Required
The name assigned to the Kubernetes cluster.
Cluster names AND environment names must consist only of lowercase alphanumeric characters and hyphens. Uppercase letters, special characters, and spaces are not allowed.
environment_name string
Required
The name of the environment where the cluster will be created.
To learn how to create a new environment, click here.
keypair_name integer
Required
The name of the SSH key used to securely access your cluster.
To learn how to create a new SSH key, click here.
image_name string
optional
Name of the operating system image to be installed on your cluster.
Use the GET /core/images
API to retrieve a list of images offered by Hyperstack.
Recommended image: Ubuntu Server 22.04 LTS R535 CUDA 12.2
The image names with the suffix with Docker
(e.g. Ubuntu Server 22.04 LTS R535 CUDA 12.2 with Docker
) are not supported for now.