From 2a90451cb99bdf7ff77cfc20ea22c5419977c752 Mon Sep 17 00:00:00 2001 From: Thinh Ha Date: Thu, 2 Jan 2020 16:07:16 +0000 Subject: [PATCH] replace jsonpath output with cleaner alternative --- docs/12-dns-addon.md | 2 +- docs/13-smoke-test.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/12-dns-addon.md b/docs/12-dns-addon.md index f7a5d43..c7641c4 100644 --- a/docs/12-dns-addon.md +++ b/docs/12-dns-addon.md @@ -59,7 +59,7 @@ busybox 1/1 Running 0 3s Retrieve the full name of the `busybox` pod: ``` -POD_NAME=$(kubectl get pods -l run=busybox -o jsonpath="{.items[0].metadata.name}") +POD_NAME=$(kubectl get pods -l run=busybox -o name) ``` Execute a DNS lookup for the `kubernetes` service inside the `busybox` pod: diff --git a/docs/13-smoke-test.md b/docs/13-smoke-test.md index ed90844..7888148 100644 --- a/docs/13-smoke-test.md +++ b/docs/13-smoke-test.md @@ -77,7 +77,7 @@ In this section you will verify the ability to access applications remotely usin Retrieve the full name of the `nginx` pod: ``` -POD_NAME=$(kubectl get pods -l app=nginx -o jsonpath="{.items[0].metadata.name}") +POD_NAME=$(kubectl get pods -l app=nginx -o name) ``` Forward port `8080` on your local machine to port `80` of the `nginx` pod: @@ -170,7 +170,7 @@ Retrieve the node port assigned to the `nginx` service: ``` NODE_PORT=$(kubectl get svc nginx \ - --output=jsonpath='{range .spec.ports[0]}{.nodePort}') + --no-headers -o custom-columns=:.spec.ports[0].nodePort') ``` Create a firewall rule that allows remote access to the `nginx` node port: