From 473c267609e6046428693e21e0f90931f0cb4856 Mon Sep 17 00:00:00 2001 From: Shahrooz Aghili Date: Fri, 20 Sep 2024 09:52:40 +0200 Subject: [PATCH] fix(smoke-test): dynamically fetch node name for service curl test --- docs/12-smoke-test.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/12-smoke-test.md b/docs/12-smoke-test.md index 9a92ce8..9b43396 100644 --- a/docs/12-smoke-test.md +++ b/docs/12-smoke-test.md @@ -168,11 +168,16 @@ Retrieve the node port assigned to the `nginx` service: NODE_PORT=$(kubectl get svc nginx \ --output=jsonpath='{range .spec.ports[0]}{.nodePort}') ``` +Identify the node where the nginx pod is scheduled: + +```bash +NODE_NAME=$(kubectl get pod -l app=nginx -o jsonpath='{.items[0].spec.nodeName}') +``` Make an HTTP request using the IP address and the `nginx` node port: ```bash -curl -I http://node-0:${NODE_PORT} +curl -I http://${NODE_NAME}:${NODE_PORT} ``` ```text