Skip to content

Commit 2e40c15

Browse files
Update metrics doc to add instructions for scraping etcd metrics (#9089)
* Update metrics doc to include etcd * Update docs/content/en/docs/clustermgmt/observability/expose-metrics.md Co-authored-by: Saurabh Parekh <[email protected]> --------- Co-authored-by: Saurabh Parekh <[email protected]>
1 parent 420e518 commit 2e40c15

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

designs/expose-metrics.md

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Exposing metrics securely for the following components:
2828
* kube-controller-manager
2929
* kube-scheduler
3030
* kube-proxy
31+
* etcd
3132

3233
2. EKS Anywhere components
3334

@@ -149,6 +150,13 @@ data:
149150
default_backend kube-scheduler
150151
backend kube-scheduler
151152
server kube-scheduler 127.0.0.1:10259 ssl verify none check
153+
154+
frontend etcd
155+
bind \${NODE_IP}:2381
156+
http-request deny if !{ path /metrics }
157+
default_backend etcd
158+
backend etcd
159+
server etcd 127.0.0.1:2381 check
152160
```
153161
154162
4. Create a Daemonset object to deploy the proxy so that metrics are exposed on all the nodes
@@ -192,6 +200,8 @@ spec:
192200
containerPort: 10257
193201
- name: kube-scheduler
194202
containerPort: 10259
203+
- name: etcd
204+
containerPort: 2381
195205
volumeMounts:
196206
- mountPath: "/usr/local/etc/haproxy"
197207
name: haproxy-config

designs/images/expose-metrics.png

-165 KB
Loading

docs/content/en/docs/clustermgmt/observability/expose-metrics.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: >
77
Expose metrics for EKS Anywhere components
88
---
99

10-
Some Kubernetes system components like kube-controller-manager, kube-scheduler and kube-proxy expose metrics only on the localhost by default. In order to expose metrics for these components so that other monitoring systems like Prometheus can scrape them, you can deploy a proxy as a Daemonset on the host network of the nodes. The proxy pods also need to be configured with control plane tolerations so that they can be scheduled on the control plane nodes.
10+
Some Kubernetes system components like kube-controller-manager, kube-scheduler, kube-proxy and etcd (Stacked) expose metrics only on the localhost by default. In order to expose metrics for these components so that other monitoring systems like Prometheus can scrape them, you can deploy a proxy as a Daemonset on the host network of the nodes. The proxy pods also need to be configured with control plane tolerations so that they can be scheduled on the control plane nodes. For Unstacked/External etcd, metrics are already exposed on `https://<etcd-machine-ip>:2379/metrics` endpoint and can be scraped by Prometheus directly without deploying anything.
1111

1212
### Configure Proxy
1313

@@ -51,6 +51,13 @@ To configure a proxy for exposing metrics on an EKS Anywhere cluster, you can pe
5151
default_backend kube-scheduler
5252
backend kube-scheduler
5353
server kube-scheduler 127.0.0.1:10259 ssl verify none check
54+
55+
frontend etcd
56+
bind \${NODE_IP}:2381
57+
http-request deny if !{ path /metrics }
58+
default_backend etcd
59+
backend etcd
60+
server etcd 127.0.0.1:2381 check
5461
EOF
5562
```
5663
@@ -93,6 +100,8 @@ To configure a proxy for exposing metrics on an EKS Anywhere cluster, you can pe
93100
containerPort: 10257
94101
- name: kube-scheduler
95102
containerPort: 10259
103+
- name: etcd
104+
containerPort: 2381
96105
volumeMounts:
97106
- mountPath: "/usr/local/etc/haproxy"
98107
name: haproxy-config
@@ -172,4 +181,5 @@ To configure a proxy for exposing metrics on an EKS Anywhere cluster, you can pe
172181
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:10257/metrics"
173182
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:10259/metrics"
174183
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:10249/metrics"
184+
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:2381/metrics"
175185
```

0 commit comments

Comments
 (0)