This documentation is for WSO2 Private PaaS 4.1.0. View documentation for the latest release.
Updating a Kubernetes-CoreOS Master - WSO2 Private PaaS 4.1.0 - WSO2 Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
||
Skip to end of metadata
Go to start of metadata

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
DescriptionUpdate 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 <JSON_FILE_PATH> value.

Parameter definition
Short optionLong optionDescriptionRequiredExample value

-p

--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
                  
/kubernetes-clusters/kuberenetes-master.json

-c

--cluster-idID of the Kubernetes CoreOS Cluster.Yes

kubernetes-cluster-1

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
DescriptionUpdate the master node in a Kubernetes-CoreOS group.
Resource Path/kubernetesClusters/{kubernetesClusterId}/master
HTTP MethodPUT
Request/Response Formatapplication/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  
  • The path to the JSON file that defines the Kubernetes-CoreOS master needs to be defined as the <JSON_PAYLOAD> value.
  • By default, <USERNAME>:<PASSWORD> is admin:admin.
  • By default, <PRIVATE_PAAS_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified.
  • By default, <PRIVATE_PAAS_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n, the default port value needs to be incremented by n.
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 URLhttps://<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": [
     
  ]
}
  • No labels