Skip to content

Commit 1e33c9f

Browse files
Namespace variable
1 parent 304df34 commit 1e33c9f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,16 @@ The ALB Controller will make backend health available on the controller pod that
4040
To find the primary pod, you may run the following command:
4141

4242
```bash
43-
kubectl get lease -n azure-alb-system alb-controller-leader-election -o jsonpath='{.spec.holderIdentity}' | awk -F'_' '{print $1}'
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}'
4445
```
4546

4647
# [Access backend health via Kubectl command](#tab/backend-health-kubectl-access)
4748

4849
For indirect access via kubectl utility, you can create a listener that proxies traffic to the pod.
4950

5051
```bash
51-
kubectl port-forward <pod-name> -n <namespace> 8000 8001
52+
kubectl port-forward <pod-name> -n $CONTROLLER_NAMESPACE 8000 8001
5253
```
5354

5455
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.
@@ -62,7 +63,7 @@ curl http://127.0.0.1:8000
6263
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.
6364

6465
```bash
65-
kubectl get pod <alb controller pod name from previous step> -n azure-alb-system -o jsonpath="{.status.podIP}"
66+
kubectl get pod <alb controller pod name from previous step> -n $CONTROLLER_NAMESPACE -o jsonpath="{.status.podIP}"
6667
```
6768

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

0 commit comments

Comments
 (0)