How To Create K8S Cluster Using Qbert API And Private Docker Registry
Problem
- How to use the Qbert API to create new K8S cluster?
- How to create a k8s cluster using Qbert API and Private Docker Registry
Environment
- Platform9 Managed Kubernetes - all version
Procedure
Before creating cluster you need to setup a docker repository with all required docker images
- Generate a Keystone authentication token with project scope by following Keystone Identity API.
- Use below API to create a new cluster with private docker repository
curl -i -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $TOKEN" \
-d \
'{
"nodePoolUuid" : "<node_pool_uuid>",
"allowWorkloadsOnMaster" : true,
"name": "<cluster_name>",
"containersCidr": "<container_cidr>",
"networkPlugin": "calico",
"servicesCidr": "<service_cidr>",
"kubeRoleVersion": "<kube_role_version>",
"containerRuntime": "<container_runtime>",
"dockerPrivateRegistry": "<private_docker_registry_url>",
"k8sPrivateRegistry": "<private_docker_registry_url>",
"gcrPrivateRegistry": "<private_docker_registry_url>",
"quayPrivateRegistry": "<private_docker_registry_url>",
"privileged" : true
}' \
'https://<FQDN>/qbert/v4/<project_uuid>/clusters'
- Once the cluster is created attach a node as master using below API call
curl -i -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $TOKEN" \
-d \
'[
{
"uuid": "<node_uuid>",
"isMaster": true
}
]' \
'https://<FQDN>/qbert/v4/<project_uuid>/clusters/<new_cluster_uuid>/attach'
- Once master node is attached to the cluster and becomes ready, you can attach worker node using same API call to add the node changing 'isMaster' parameter to false
Additional Information
- For additional detail on the Qbert API please refer Platform9 PMK Architecture
- Required Docker images
Docker Images | |
---|---|
Name | Version |
Was this page helpful?