mirror of https://github.com/k3s-io/k3s
Merge pull request #11519 from satnam6502/doc14
Fix doc formatting in connecting to app port forwardingpull/6/head
commit
3a6e60be40
|
@ -37,14 +37,14 @@ kubectl port-forward forwards connections to a local port to a port on a pod. It
|
||||||
|
|
||||||
## Creating a Redis master
|
## Creating a Redis master
|
||||||
|
|
||||||
```
|
```console
|
||||||
$kubectl create examples/redis/redis-master.yaml
|
$ kubectl create examples/redis/redis-master.yaml
|
||||||
pods/redis-master
|
pods/redis-master
|
||||||
```
|
```
|
||||||
|
|
||||||
wait until the Redis master pod is Running and Ready,
|
wait until the Redis master pod is Running and Ready,
|
||||||
|
|
||||||
```
|
```console
|
||||||
$ kubectl get pods
|
$ kubectl get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
redis-master 2/2 Running 0 41s
|
redis-master 2/2 Running 0 41s
|
||||||
|
@ -55,7 +55,7 @@ redis-master 2/2 Running 0 41s
|
||||||
|
|
||||||
The Redis master is listening on port 6397, to verify this,
|
The Redis master is listening on port 6397, to verify this,
|
||||||
|
|
||||||
```
|
```console
|
||||||
$ kubectl get pods redis-master -t='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
|
$ kubectl get pods redis-master -t='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
|
||||||
6379
|
6379
|
||||||
```
|
```
|
||||||
|
@ -63,7 +63,7 @@ $ kubectl get pods redis-master -t='{{(index (index .spec.containers 0).ports 0)
|
||||||
|
|
||||||
then we forward the port 6379 on the local workstation to the port 6379 of pod redis-master,
|
then we forward the port 6379 on the local workstation to the port 6379 of pod redis-master,
|
||||||
|
|
||||||
```
|
```console
|
||||||
$ kubectl port-forward -p redis-master 6379:6379
|
$ kubectl port-forward -p redis-master 6379:6379
|
||||||
I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:6379 -> 6379
|
I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:6379 -> 6379
|
||||||
I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:6379 -> 6379
|
I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:6379 -> 6379
|
||||||
|
@ -71,7 +71,7 @@ I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:6379 ->
|
||||||
|
|
||||||
To verify the connection is successful, we run a redis-cli on the local workstation,
|
To verify the connection is successful, we run a redis-cli on the local workstation,
|
||||||
|
|
||||||
```
|
```console
|
||||||
$ redis-cli
|
$ redis-cli
|
||||||
127.0.0.1:6379> ping
|
127.0.0.1:6379> ping
|
||||||
PONG
|
PONG
|
||||||
|
|
Loading…
Reference in New Issue