You can update a Kubernetes-CoreOS master using the CLI tool or REST API, as shown below:
Updating a Kubernetes-CoreOS master via the CLI
Overview
CLI command | update-kubernetes-master |
Description | Update the master node of the Kubernetes-CoreOS Cluster. |
Command format | update-kubernetes-master -c <CLUSTER_ID> -p <JSON_FILE_PATH> The path to the JSON file that defines the Kubernetes-CoreOS master needs to be defined as the |
Parameter definition
Short option | Long option | Description | Required | Example value |
---|---|---|---|---|
| --resource-path | Folder path where the JSON file that defines the Kubernetes-CoreOS Master is stored. | Yes | <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples |
| --cluster-id | ID of the Kubernetes CoreOS Cluster. | Yes |
|
Example
Update the master node of the Kubernetes-CoreOS Cluster with the Kubernetes master details defined in the <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/kubernetes-clusters/kubernetes-master.json
file.
update-kubernetes-master -c kubernetes-cluster-1 -p <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/kubernetes-clusters/kuberenetes-master.json
Sample output
Kubernetes master updated successfully: [kub-master] master
Updating a Kubernetes-CoreOS master via the REST API
Overview
Description | Update the master node in a Kubernetes-CoreOS group. |
Resource Path | /kubernetesClusters/{kubernetesClusterId}/master |
HTTP Method | PUT |
Request/Response Format | application/json |
Command format | curl -X PUT -H "Content-Type: application/json" -d @'<JSON_PAYLOAD>' -k -v -u admin:admin https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/kubernetesClusters/{kubernetesClusterId}/master
|
Example
Update the master node of the Kubernetes-CoreOS Cluster with the Kubernetes Master details defined in the <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/kubernetes-clusters/kubernetes-master.json
file.
cd <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/kubernetes-clusters curl -X PUT -H "Content-Type: application/json" -d @'kubernetes-cluster-2.json' -k -v -u admin:admin https://localhost:9443/api/kubernetesClusters/kubernetes-cluster-1/master
Sample output
> PUT /api/kubernetesClusters/kubernetes-cluster-1/master HTTP/1.1 > Host: localhost:9443 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 197 > < HTTP/1.1 200 OK < Date: Wed, 30 Sep 2015 09:23:54 GMT < Content-Type: application/json < Transfer-Encoding: chunked < Server: WSO2 Carbon Server < {"status":"success","message":"Kubernetes master updated successfully: [kub-master] master"}
Following are the HTTP status codes you will come across while updating a Kubernetes-CoreOS master:
HTTP status code | 200, 404, 500 See the descriptions of the HTTP status codes here. |
Location header URL | https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/kubernetesClusters/<KUBERNETES_GROUP_ID>/master/<MASTER_HOST_ID> |
Sample Kubernetes-CoreOS master JSON
{ "hostId": "master", "hostname": "master.dev.kubernetes.org", "privateIPAddress": "172.17.8.105", "publicIPAddress": "172.17.8.109", "property": [ ] }