The metrics-agent collects allocation metrics from a container orchestration system (currently Kubernetes) and sends them to cloudability to help you gain visibility, reduce costs and increase efficiency across your infrastructure. The agent is designed to run as a docker container in each cluster inside your orchestration system.
The agent requires that it runs in a namespace named "cloudability" with a service account, pulling metrics from the Kubernetes API and Heapster. The agent will attempt to connect to heapster, and if unable to communicate with it, the agent will launch Heapster as a service in the cloudability namespace. An example kubernetes deployment can be found here.
Environment Variable | Description |
---|---|
CLOUDABILITY_API_KEY | Required: Cloudability api key |
CLOUDABILITY_CLUSTER_NAME | Required: The cluster name to be used for the cluster the agent is running in. |
CLOUDABILITY_POLL_INTERVAL | Optional: The interval (Seconds) to poll metrics. Default: 300 |
CLOUDABILITY_HEAPSTER_URL | Optional: Only required if heapster is not deployed as a service in your cluster or is only accessable via a specific URL. |
CLOUDABILITY_OUTBOUND_PROXY | Optional: The URL of an outbound HTTP/HTTPS proxy for the agent to use (eg: http://x.x.x.x:8080). The URL must contain the scheme prefix (http:// or https://) |
CLOUDABILITY_OUTBOUND_PROXY_AUTH | Optional: Basic Authentication credentials to be used with the defined outbound proxy. If your outbound proxy requires basic authentication credentials can be defined in the form username:password |
CLOUDABILITY_OUTBOUND_PROXY_INSECURE | Optional: When true, does not verify TLS certificates when using the outbound proxy. Default: False |
CLOUDABILITY_INSECURE | Optional: When true, does not verify certificates when making TLS connections. Default: False |
metrics-agent kubernetes --help
Command to collect Kubernetes Metrics
Usage:
metrics-agent kubernetes [flags]
Flags:
--api_key string Cloudability API Key - required
--certificate_file string The path to a certificate file. - Optional
--cluster_name string Kubernetes Cluster Name - required this must be unique to every cluster.
--heapster_override_url string URL to connect to a running heapster instance. - optionally override the discovered Heapster URL.
-h, --help help for kubernetes
--insecure When true, does not verify certificates when making TLS connections. Default: False
--key_file string The path to a key file. - Optional
--outbound_proxy string Outbound HTTP/HTTPS proxy eg: http://x.x.x.x:8080. Must have a scheme prefix (http:// or https://) - Optional
--outbound_proxy_auth string Outbound proxy basic authentication credentials. Must defined in the form username:password - Optional
--outbound_proxy_insecure When true, does not verify TLS certificates when using the outbound proxy. Default: False
--poll_interval int Time, in seconds, to poll the services infrastructure. Default: 180 (default 180)
We're using dep to manage our Go dependencies.
We're using Go Meta Linter for static source code analysis.
You'll find information and help on how to contribute code see the contributing doc of this repo.
You must obtain a valid API Key and export it locally as an environment variable.
export CLOUDABILITY_API_KEY={your_api_key}
make deploy-local
The makefile step deploy-local assumes that you have docker and kubernetes (with a context: docker-for-desktop) running locally. The step does the following:
-
Build a container with the local project codebase
-
locally deploy a deployment / pod with the local metrics agent container