mirror of https://github.com/istio/istio.io.git
Fix code in 'Authorization for TCP traffic' (#7117)
The pod of tcp-echo which is asked its podIP is in `foo` namespace, so the `kubectl get` should specify the namespace as `foo`. Co-authored-by: Koki Tomoshige <36136133+tomocy@users.noreply.github.com>
This commit is contained in:
parent
2a7240035e
commit
9071b1f385
|
@ -52,7 +52,7 @@ defined in the Kubernetes service object of `tcp-echo`.
|
|||
Get the pod IP address and send the request with the following command:
|
||||
|
||||
{{< text bash >}}
|
||||
$ TCP_ECHO_IP=$(kubectl get pod $(kubectl get pod -l app=tcp-echo -n foo -o jsonpath={.items..metadata.name}) -o jsonpath={.status.podIP})
|
||||
$ TCP_ECHO_IP=$(kubectl get pod $(kubectl get pod -l app=tcp-echo -n foo -o jsonpath={.items..metadata.name}) -n foo -o jsonpath={.status.podIP})
|
||||
$ kubectl exec $(kubectl get pod -l app=sleep -n foo -o jsonpath={.items..metadata.name}) -c sleep -n foo -- sh -c "echo \"port 9002\" | nc $TCP_ECHO_IP 9002" | grep "hello" && echo 'connection succeeded' || echo 'connection rejected'
|
||||
hello port 9002
|
||||
connection succeeded
|
||||
|
|
Loading…
Reference in New Issue