How To Rename PMK Cluster?
Problem
Update or change in the cluster name.
Environment
- Platform9 Managed Kubernetes v 5.6 and above
Procedure
To perform cluster rename we have curl put request, which helps to rename cluster. We need "user token" and "qbert api url" to execute this request. Steps can be followed as below:
Get the required details as below:
Token
- Copy user token from cluster kubconfig downloaded from GUIRequest-API-URL-for-target-cluster
- On GUI - Click on Access --> API services --> qbert --> click getClusterDetails in requests method --> get copy the Request API.Export user token as
# export TOKEN=<copy-it-from-cluster-kubconfig-file-for-your-user>
- Execute the curl API request as below - you should see an "Ok" message at the bottom. This should start the cluster rename process. please wait for some time as the cluster will renew its certificates on all nodes. During this time cluster and nodes may not look healthy.
x
# curl --request PUT --url <Request-API-URL-for-target-cluster> --header "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" --data '{ "name": "<new-cluster-name>" }'
e.g.
@ curl --request PUT --url https://gauravk.platform9.horse/qbert/v4/c98516ee2cca4744965a1e6decab3475/clusters/5bb89ce7-cf20-4c73-af26-38e58430ab0d --header "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" --data '{ "name": "my-2node-cluster" }'
OK
- Verify new cluster name using curl get request
# curl --request GET --url <Request-API-URL-for-target-cluster> --header "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" | jq | grep "name"
e.g.
# curl --request GET --url https://gauravk.platform9.horse/qbert/v4/c98516ee2cca4744965a1e6decab3475/clusters/5bb89ce7-cf20-4c73-af26-38e58430ab0d --header "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" | jq | grep "name"
"name": "my-2node-cluster"
Once cluster and every node is updated, verify the changes and check the status of cluster and nodes if all looks healthy.
Was this page helpful?