Skip to content

Commit 15591c1

Browse files
HadhemiDDsteveny91drichards-87
authored
Update kubernetes cluster autoscaler docs to add annotations (#17725)
* update kubernetes cluster autoscaler docs * typo * Update kubernetes_cluster_autoscaler/README.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> * Update kubernetes_cluster_autoscaler/README.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> * Update kubernetes_cluster_autoscaler/README.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> * Update kubernetes_cluster_autoscaler/README.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> * Update kubernetes_cluster_autoscaler/README.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> * Update README.md Replace empty link 10 with generic placeholder * add docs link --------- Co-authored-by: Steven Yuen <steven.yuen@datadoghq.com> Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com>
1 parent d054666 commit 15591c1

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

kubernetes_cluster_autoscaler/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,60 @@ No additional installation is needed on your server.
1919

2020
2. [Restart the Agent][5].
2121

22+
#### Metric collection
23+
24+
Make sure that the Prometheus-formatted metrics are exposed in your `kubernetes_cluster_autoscaler` cluster.
25+
For the Agent to start collecting metrics, the `kubernetes_cluster_autoscaler` pods need to be annotated.
26+
27+
[Kubernetes Cluster Autoscaler][11] has metrics and livenessProbe endpoints that can be accessed on port `8085`. These endpoints are located under `/metrics` and `/health-check` and provide valuable information about the state of your cluster during scaling operations.
28+
29+
**Note**: To change the default port, use the `--address` flag.
30+
31+
To configure the Cluster Autoscaler to expose metrics, do the following:
32+
33+
1. Enable access to the `/metrics` route and expose port `8085` for your Cluster Autoscaler deployment:
34+
35+
```
36+
ports:
37+
--name: app
38+
containerPort: 8085
39+
```
40+
41+
b) instruct your Prometheus to scrape it, by adding the following annotation to your Cluster Autoscaler service:
42+
```
43+
prometheus.io/scrape: true
44+
```
45+
46+
**Note**: The listed metrics can only be collected if they are available. Some metrics are generated only when certain actions are performed.
47+
48+
The only parameter required for configuring the `kubernetes_cluster_autoscaler` check is `openmetrics_endpoint`. This parameter should be set to the location where the Prometheus-formatted metrics are exposed. The default port is `8085`. To configure a different port, use the `METRICS_PORT` [environment variable][10]. In containerized environments, `%%host%%` should be used for [host autodetection][3].
49+
50+
```yaml
51+
apiVersion: v1
52+
kind: Pod
53+
# (...)
54+
metadata:
55+
name: '<POD_NAME>'
56+
annotations:
57+
ad.datadoghq.com/controller.checks: |
58+
{
59+
"kubernetes_cluster_autoscaler": {
60+
"init_config": {},
61+
"instances": [
62+
{
63+
"openmetrics_endpoint": "http://%%host%%:8085/metrics"
64+
}
65+
]
66+
}
67+
}
68+
# (...)
69+
spec:
70+
containers:
71+
- name: 'controller'
72+
# (...)
73+
```
74+
75+
2276
### Validation
2377

2478
[Run the Agent's status subcommand][6] and look for `kubernetes_cluster_autoscaler` under the Checks section.
@@ -53,3 +107,5 @@ Need help? Contact [Datadog support][9].
53107
[7]: https://github.com/DataDog/integrations-core/blob/master/kubernetes_cluster_autoscaler/metadata.csv
54108
[8]: https://github.com/DataDog/integrations-core/blob/master/kubernetes_cluster_autoscaler/assets/service_checks.json
55109
[9]: https://docs.datadoghq.com/help/
110+
[10]: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
111+
[11]: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-monitor-cluster-autoscaler

0 commit comments

Comments
 (0)