mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Improve console output in k8s201 walkthrough.
This commit is contained in:
parent
d95ca69400
commit
9b474c1afe
@ -86,13 +86,13 @@ spec:
|
||||
|
||||
Create the labeled pod ([pod-nginx-with-label.yaml](pod-nginx-with-label.yaml)):
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl create -f docs/user-guide/walkthrough/pod-nginx-with-label.yaml
|
||||
```
|
||||
|
||||
List all pods with the label `app=nginx`:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl get pods -l app=nginx
|
||||
```
|
||||
|
||||
@ -139,19 +139,19 @@ spec:
|
||||
|
||||
Create an nginx replication controller ([replication-controller.yaml](replication-controller.yaml)):
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl create -f docs/user-guide/walkthrough/replication-controller.yaml
|
||||
```
|
||||
|
||||
List all replication controllers:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl get rc
|
||||
```
|
||||
|
||||
Delete the replication controller by name:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl delete rc nginx-controller
|
||||
```
|
||||
|
||||
@ -187,13 +187,13 @@ spec:
|
||||
|
||||
Create an nginx service ([service.yaml](service.yaml)):
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl create -f docs/user-guide/walkthrough/service.yaml
|
||||
```
|
||||
|
||||
List all services:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl get services
|
||||
```
|
||||
|
||||
@ -201,7 +201,7 @@ On most providers, the service IPs are not externally accessible. The easiest wa
|
||||
|
||||
Provided the service IP is accessible, you should be able to access its http endpoint with curl on port 80:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ export SERVICE_IP=$(kubectl get service nginx-service -o=template -t={{.spec.clusterIP}})
|
||||
$ export SERVICE_PORT=$(kubectl get service nginx-service -o=template '-t={{(index .spec.ports 0).port}}')
|
||||
$ curl http://${SERVICE_IP}:${SERVICE_PORT}
|
||||
@ -209,7 +209,7 @@ $ curl http://${SERVICE_IP}:${SERVICE_PORT}
|
||||
|
||||
To delete the service by name:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ kubectl delete service nginx-controller
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user