Cloudability Kubernetes cluster provisioning
Overview
In order to gather the data we need to perform allocation for a given cluster, you will need to deploy the Cloudability Metrics Agent to each cluster you want to report on.
This is done through a YAML deployment provisioned for each cluster, and is dependent on the specific Kubernetes version you are running.
-
Navigate to Insights > Containers .
-
Select the Provision Clusters button.
-
Fill out the form with your cluster name and either your Kubernetes version or your OpenShift version.
- Select Generate Template .
Cloudability generates a YAML file for you to download, and you can run the deployment from there. Once complete, Cloudability will start receiving data for the cluster within a few hours.
Cluster data should show up in Cloudability the following day. If you run into any issues with the deployment, contact Apptio support.
Google Kubernetes Engine (GKE)-specific instructions
- key: gke-cluster
- value: the cluster name(s) you set in the form/YAML. This allows Cloudability to map GKE clusters to line items in the GCP billing file, and allocate costs to your clusters.
Cloudability will need to ingest a billing file with the cluster labels you added, which can take up to 48 hours. Once Cloudability has processed the new billing file, you need to create a new tag mapping in the Cloudability application. Set a Cloudability Dimension as gke-cluster and map this to the gke-cluster tag. This is a one time need, not per cluster.
Ensure that your account has cluster-admin role before deploying the Metrics agent. By default, a user account does not have the cluster-admin role. Use the following command on the GKE cluster to grant a user the cluster-admin role:
"kubectl create clusterrolebinding username-cluster-admin-binding --
clusterrole=cluster-admin --user=username@emailaddress.com"
Deploy the Metrics agent
Deploy the Metrics agent using YAML
metrics-agent-deployment.yaml.
kubectl apply -f metrics-agent-deployment.yaml
To uninstall metrics agent using deployment file:
kubectl delete -f metrics-agent-deployment.yaml
Deploying the metrics-agent With Helm
Helm must be installed to use the charts. Refer to Helm’s documentation to get started.
helm repo add metrics-agent https://cloudability.github.io/metrics-agent/
helm repo update
To retrieve the latest versions of the packages. You can then run helm search repo
metrics-agent
to see the charts.
Kubernetes
To install the metrics-agent chart:
helm install metrics-agent --set apiKey=<yourApiKey> --set clusterName=<yourClusterName> metrics-agent/metrics-agent -n cloudability --create-namespace
Or, to install the metrics-agent chart into an existing Cloudability namespace where the api key is stored in an existing kubernetes secret
helm install metrics-agent --set secretName=<NameOfSecret> --set clusterName=<yourClusterName> metrics-agent/metrics-agent -n cloudability
OpenShift
helm install metrics-agent --set apiKey=<yourApiKey> --set clusterName=<yourClusterName> --set openShift=true metrics-agent/metrics-agent -n cloudability --create-namespace
helm install metrics-agent --set secretName=<NameOfSecret> --set clusterName=<yourClusterName> --set openShift=true metrics-agent/metrics-agent -n cloudability
helm delete metrics-agent -n cloudability
- <yourApiKey> is obtained through the Containers Insights page in the Cloudability UI.
- Deploying the metrics-agent with Helm creates a kubernetes secret that stores the api-key value. The metrics-agent deployment then pulls the apikey value from this secret.
Reprovision clusters
If you are reprovisioning an existing cluster, you need to fill out the provisioning form in Cloudability with the same cluster name and Kubernetes version to get a YAML or Helm file for the re-deployment.
If you are reprovisioning an existing cluster, you need to fill out the provisioning form in Cloudability with the same cluster name and the cluster version to get a YAML or Helm file for the re-deployment.
When reprovisioning clusters, you must ensure you use the same cluster name as is currently in use.
When upgrading to a new Kubernetes version, you need to install a new version of the Cloudability Metrics Agent to ensure data continues to flow for that cluster. To do so, fill out the provisioning form in Cloudability with the same cluster name and new Kubernetes version to get a YAML file for the deployment.
DNS Whitelisting policy for Metrics-Agent
If you have installed metrics-agent in your Kubernetes clusters you may have configured outbound policies for security reasons.
If you allow all outbound traffic, then there is no need to configure any whitelisting rules.
However, if you have disallowed outbound traffic by default, the following endpoints need be allowed to access (IP-based whitelisting is not supported because IPs are dynamic):
- metrics-collector.cloudability.com port 443
- api.cloudability.com port 443
- frontdoor.apptio.com port 443
- apptio*.s3.amazonaws.com
- metrics-collector-eu.cloudability.com port 443
- api-eu.cloudability.com port 443
- frontdoor-eu.apptio.com port 443
- apptio*.s3.amazonaws.com
- metrics-collector-au.cloudability.com port 443
- api-au.cloudability.com port 443
- frontdoor-au.apptio.com port 443
- apptio*.s3.amazonaws.com
- metrics-collector-me.cloudability.com port 443
- api-me.cloudability.com port 443
- frontdoor-me.apptio.com port 443
- apptio*.s3.amazonaws.com