replace jsonpath output with cleaner alternative

pull/536/head
Thinh Ha 2020-01-02 16:07:16 +00:00
parent 5c462220b7
commit 2a90451cb9
2 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ busybox 1/1 Running 0 3s
Retrieve the full name of the `busybox` pod: 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: Execute a DNS lookup for the `kubernetes` service inside the `busybox` pod:

View File

@ -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: 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: 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 \ 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: Create a firewall rule that allows remote access to the `nginx` node port: