Skip to content

Commit 059e4e6

Browse files
Merge pull request #277056 from JackStromberg/patch-170
Backend health - identify primary pod
2 parents 33d85c2 + 62b929f commit 059e4e6

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

articles/application-gateway/for-containers/alb-controller-backend-health-metrics.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ author: greglin
66
ms.service: application-gateway
77
ms.subservice: appgw-for-containers
88
ms.topic: article
9-
ms.date: 02/27/2024
9+
ms.date: 06/03/2024
1010
ms.author: greglin
1111
---
1212

1313
# ALB Controller - Backend Health and Metrics
1414

15-
Understanding backend health of your Kubernetes services and pods is crucial in identifying issues and assistance in troubleshooting. To help facilitate visibility into backend health, ALB Controller exposes backend health and metrics endpoints in all ALB Controller deployments.
15+
Understanding backend health of your Kubernetes services and pods is crucial in identifying issues and assistance in troubleshooting. To help facilitate visibility into backend health, ALB Controller exposes backend health and metrics endpoints in all ALB Controller deployments.
1616

1717
ALB Controller's backend health exposes three different experiences:
1818

1919
1. Summarized backend health by Application Gateway for Containers resource
2020
2. Summarized backend health by Kubernetes service
2121
3. Detailed backend health for a specified Kubernetes service
2222

23-
ALB Controller's metric endpoint exposes both metrics and summary of backend health. This endpoint enables exposure to Prometheus.
23+
ALB Controller's metric endpoint exposes both metrics and summary of backend health. This endpoint enables exposure to Prometheus.
2424

2525
Access to these endpoints can be reached via the following URLs:
2626

@@ -35,27 +35,45 @@ Any clients or pods that have connectivity to this pod and port may access these
3535

3636
### Discovering backend health
3737

38-
Run the following kubectl command to identify your ALB Controller pod and its corresponding IP address.
38+
The ALB Controller exposes backend health on the ALB controller pod that is acting as primary.
39+
40+
To find the primary pod, run the following command:
3941

4042
```bash
41-
kubectl get pods -n azure-alb-system -o wide
43+
CONTROLLER_NAMESPACE='azure-alb-system'
44+
kubectl get lease -n $CONTROLLER_NAMESPACE alb-controller-leader-election -o jsonpath='{.spec.holderIdentity}' | awk -F'_' '{print $1}'
4245
```
4346

44-
Example output:
47+
# [Access backend health via Kubectl command](#tab/backend-health-kubectl-access)
4548

46-
| NAME | READY | STATUS | RESTARTS | AGE | IP | NODE | NOMINATED NODE | READINESS GATES |
47-
| ------------------------------------------ | ----- | ------- | -------- | ---- | ---------- | -------------------------------- | -------------- | --------------- |
48-
| alb-controller-74df7896b-gfzfc | 1/1 | Running | 0 | 60m | 10.1.0.247 | aks-userpool-21921599-vmss000000 | \<none\> | \<none\> |
49-
| alb-controller-bootstrap-5f7f8f5d4f-gbstq | 1/1 | Running | 0 | 60m | 10.1.1.183 | aks-userpool-21921599-vmss000001 | \<none\> | \<none\> |
49+
For indirect access via kubectl utility, you can create a listener that proxies traffic to the pod.
5050

51-
Once you have the IP address of your alb-controller pod, you may validate the backend health service is running by browsing to http://\<pod-ip\>:8000.
51+
```bash
52+
kubectl port-forward <pod-name> -n $CONTROLLER_NAMESPACE 8000 8001
53+
```
5254

53-
For example, the following command may be run:
55+
Once the kubectl command is listening, open another terminal (or cloud shell session) and execute curl to 127.0.0.1 to be redirected to the pod.
5456

5557
```bash
56-
curl http://10.1.0.247:8000
58+
curl http://127.0.0.1:8000
5759
```
5860

61+
# [Access backend health via controller pod directly](#tab/backend-health-direct-access)
62+
63+
Run the following kubectl command to identify the IP address of the primary ALB Controller pod.
64+
65+
```bash
66+
kubectl get pod <alb controller pod name from previous step> -n $CONTROLLER_NAMESPACE -o jsonpath="{.status.podIP}"
67+
```
68+
69+
Once you have the IP address of your alb-controller pod, you may validate the backend health service is running by browsing to http://\<pod-ip\>:8000.
70+
71+
```bash
72+
curl http://<your-pod-ip>:8000
73+
```
74+
75+
---
76+
5977
Example response:
6078

6179
```text
@@ -188,9 +206,9 @@ Example output:
188206

189207
## Metrics
190208

191-
ALB Controller currently surfaces metrics following [text based format](https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format) to be exposed to Prometheus.
209+
ALB Controller currently surfaces metrics following [text based format](https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format) to be exposed to Prometheus. Access to these logs are available on port 8001 of the primary alb controller pod `http://\<alb-controller-pod-ip\>:8001/metrics`.
192210

193-
The following Application Gateway for Containers specific metrics are currently available today:
211+
The following metrics are exposed today:
194212

195213
| Metric Name | Description |
196214
| ----------- | ------------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)