Provisioning

Summary

Any cluster that you would like Cloudability's Container Cost Allocation tool to report on must first be provisioned. The provisioning process generates credentials as well as a Kubernetes deployment config that should then be installed in the cluster. The deployment will launch the Cloudability Metrics Agent in the cluster, into its own namespace. The Metrics Agent will then gather information about the cluster periodically, and send it back to Cloudability.

The provisioning endpoints provide API access to the provisioning process.

Documentation

Learn more about provisioning a cluster in the Kubernetes Cluster Provisioning support documentation.

Endpoint

/containers/provisioning

Query Arguments

Parameter

Required

Type

Description

clusterName

Yes

string

Name of the cluster to be provisioned (must be unique, and cannot be modified)

kubernetesVersion

Yes

string

The version of Kubernetes that is running on the cluster to be provisioned. Supported versions: (1.9 through 1.17)

Provisioning a Cluster

When you have a new cluster that you'd like to see in the Cloudability Container Allocation tool, you will need to deploy the Cloudability Metrics Agent into the cluster. The provisioning API allows you to let Cloudability know about the cluster by "provisioning" it via this API. Once provisioned, the API can then produce the deployment yaml for you to deploy the Metrics Agent to the new cluster.

Sample curl to provision a cluster:

curl -X POST "https://api.cloudability.com/v3/containers/provisioning?pretty" \
-u "${API_KEY}:" \
-H "Content-type: application/json" \
--data-binary '{
 "clusterName":"myTestCluster",
 "kubernetesVersion":"1.11"
}'
{
  "result": {
    "id": 1,
    "clusterName": "myTestCluster",
    "createdAt": "2018-05-18T15:40:23.29551Z",
    "kubernetesVersion": "1.11",
   }
}

Now, the cluster has been added to our database and a kubernetes deployment configuration has been generated. Note the "id" in the response. Use that in the following examples where "${ID}" is in the uri.

To retrieve the deployment configuration yaml:

curl "https://api.cloudability.com/v3/containers/provisioning/${ID}/config" \
-u "${API_KEY}:"

The output is a kubernetes deployment yaml file that will deploy the Cloudability Metrics Agent to your new cluster (follow whatever process is typical for your company to deploy new services to the cluster).

List All Provisioned Clusters

curl "https://api.cloudability.com/v3/containers/provisioning?pretty" \
-u "${API_KEY}:"

Update Provisioned Cluster

You can also update the provisioning details for a cluster. For example, request to update the kubernetes version to 1.12 for a cluster:

curl "https://api.cloudability.com/v3/containers/provisioning/${ID}?pretty" \
-XPUT \
-u "${API_KEY}:" \
-H "Content-type: application/json" \
--data-binary '{"kubernetesVersion":"1.12"}'

Once updated, you can fetch the updated deployment configuration through the same method as above, and then re-deploy the configuration to your cluster to update the Cloudability Metrics Agent.

Note: clusterName is read-only once created and cannot be modified. Further, you currently must provide ALL the other fields (even those not changing), otherwise they will be updated to whatever the default for the type is. Support for PATCH is coming, which will allow for only specifying the fields that are changing.