Skip to content

Commit 304df34

Browse files
Backend health - identify primary pod
1 parent 8b3ff95 commit 304df34

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

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

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ 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

@@ -35,27 +35,44 @@ 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 will make backend health available on the controller pod that is acting as primary.
39+
40+
To find the primary pod, you may run the following command:
3941

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

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

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\> |
48+
For indirect access via kubectl utility, you can create a listener that proxies traffic to the pod.
5049

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.
50+
```bash
51+
kubectl port-forward <pod-name> -n <namespace> 8000 8001
52+
```
5253

53-
For example, the following command may be run:
54+
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.
5455

5556
```bash
56-
curl http://10.1.0.247:8000
57+
curl http://127.0.0.1:8000
5758
```
5859

60+
# [Access backend health via controller pod directly](#tab/backend-health-direct-access)
61+
62+
Run the following kubectl command to identify the IP address of the primary ALB Controller pod. You may return a list of all controller pods or run a single command to obtain the IP address per your preference.
63+
64+
```bash
65+
kubectl get pod <alb controller pod name from previous step> -n azure-alb-system -o jsonpath="{.status.podIP}"
66+
```
67+
68+
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.
69+
70+
```bash
71+
curl http://<your-pod-ip>:8000
72+
```
73+
74+
---
75+
5976
Example response:
6077

6178
```text
@@ -188,9 +205,9 @@ Example output:
188205

189206
## Metrics
190207

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.
208+
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 may be found at http://<alb-controller-pod-ip>:8001/metrics
192209

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

195212
| Metric Name | Description |
196213
| ----------- | ------------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)