Adding a host to a Kubernetes-CoreOS cluster via the REST APIOverviewDescription | Add a host (slave) to an existing Kubernetes-CoreOS Cluster. | Resource Path | /kubernetesClusters/{kubernetesClusterId}/minion | HTTP Method | POST | Request/ Response Format | application/json | Command format | Code Block |
---|
curl -X POST -H "Content-Type: application/json" -d @'<JSON_PAYLOAD>' -k -v -u <username>:<password> https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/kubernetesClusters/{kubernetesClusterId}/minion |
Info |
---|
- The path to the JSON file that defines the Kubernetes-CoreOS host 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 .
|
|
ExampleDefine the Kubernetes-CoreOS host information in a JSON file, which is stored in the <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples /kubernetes-clusters/kubernetes-host.json directory. Thereafter, add the host to the Kubernetes-CoreOS Cluster. Code Block |
---|
cd <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/
curl -X POST -H "Content-Type: application/json" -d @'kubernetes-clusters/kubernetes-host.json' -k -v -u admin:admin https://localhost:9443/api/kubernetesClusters/kubernetes-cluster-1/minion |
Sample output Code Block |
---|
> POST /api/kubernetesClusters/kubernetes-cluster-1/minion HTTP/1.1
> Host: localhost:9443
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 166
>
< HTTP/1.1 201 Created
< Date: Fri, 02 Oct 2015 08:14:15 GMT
< Location: https://localhost:9443/api/kubernetesClusters/kubernetes-cluster-1/minion/minion-7
< Content-Type: application/json
< Transfer-Encoding: chunked
< Server: WSO2 Carbon Server
<
{"status":"success","message":"Kubernetes host added successfully: [kub-host] minion-7"} |
Following are the HTTP status codes you will come across while adding a Kubernetes-CoreOS host: HTTP status code | 201, 400, 409, 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>/minion/<MINION_ID>
|
|