Skip to content

Commit

Permalink
Update metrics doc to add instructions for scraping etcd metrics (#9089)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
rajeshvenkata and sp1999 authored Dec 31, 2024
1 parent 420e518 commit 2e40c15
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions designs/expose-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Exposing metrics securely for the following components:
* kube-controller-manager
* kube-scheduler
* kube-proxy
* etcd

2. EKS Anywhere components

Expand Down Expand Up @@ -149,6 +150,13 @@ data:
default_backend kube-scheduler
backend kube-scheduler
server kube-scheduler 127.0.0.1:10259 ssl verify none check
frontend etcd
bind \${NODE_IP}:2381
http-request deny if !{ path /metrics }
default_backend etcd
backend etcd
server etcd 127.0.0.1:2381 check
```
4. Create a Daemonset object to deploy the proxy so that metrics are exposed on all the nodes
Expand Down Expand Up @@ -192,6 +200,8 @@ spec:
containerPort: 10257
- name: kube-scheduler
containerPort: 10259
- name: etcd
containerPort: 2381
volumeMounts:
- mountPath: "/usr/local/etc/haproxy"
name: haproxy-config
Expand Down
Binary file modified designs/images/expose-metrics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion docs/content/en/docs/clustermgmt/observability/expose-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >
Expose metrics for EKS Anywhere components
---

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.
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.

### Configure Proxy

Expand Down Expand Up @@ -51,6 +51,13 @@ To configure a proxy for exposing metrics on an EKS Anywhere cluster, you can pe
default_backend kube-scheduler
backend kube-scheduler
server kube-scheduler 127.0.0.1:10259 ssl verify none check
frontend etcd
bind \${NODE_IP}:2381
http-request deny if !{ path /metrics }
default_backend etcd
backend etcd
server etcd 127.0.0.1:2381 check
EOF
```
Expand Down Expand Up @@ -93,6 +100,8 @@ To configure a proxy for exposing metrics on an EKS Anywhere cluster, you can pe
containerPort: 10257
- name: kube-scheduler
containerPort: 10259
- name: etcd
containerPort: 2381
volumeMounts:
- mountPath: "/usr/local/etc/haproxy"
name: haproxy-config
Expand Down Expand Up @@ -172,4 +181,5 @@ To configure a proxy for exposing metrics on an EKS Anywhere cluster, you can pe
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:10257/metrics"
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:10259/metrics"
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:10249/metrics"
curl -H "Authorization: Bearer ${TOKEN}" "http://${NODE_IP}:2381/metrics"
```

0 comments on commit 2e40c15

Please sign in to comment.