From e6888722ecf79558a2d51341b6131e1e6788a003 Mon Sep 17 00:00:00 2001 From: chenhuan Date: Thu, 9 Aug 2018 06:10:30 +0800 Subject: [PATCH] fix the command output (#9777) I have verified on version v1.11 --- .../administer-cluster/declare-network-policy.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/declare-network-policy.md b/content/en/docs/tasks/administer-cluster/declare-network-policy.md index 6c471332d8..60f2a276fe 100644 --- a/content/en/docs/tasks/administer-cluster/declare-network-policy.md +++ b/content/en/docs/tasks/administer-cluster/declare-network-policy.md @@ -35,9 +35,9 @@ To see how Kubernetes network policy works, start off by creating an `nginx` dep ```console $ kubectl run nginx --image=nginx --replicas=2 -deployment "nginx" created +deployment.apps/nginx created $ kubectl expose deployment nginx --port=80 -service "nginx" exposed +service/nginx exposed ``` This runs two `nginx` pods in the default namespace, and exposes them through a service called `nginx`. @@ -45,12 +45,12 @@ This runs two `nginx` pods in the default namespace, and exposes them through a ```console $ kubectl get svc,pod NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE -svc/kubernetes 10.100.0.1 443/TCP 46m -svc/nginx 10.100.0.16 80/TCP 33s +service/kubernetes 10.100.0.1 443/TCP 46m +service/nginx 10.100.0.16 80/TCP 33s NAME READY STATUS RESTARTS AGE -po/nginx-701339712-e0qfq 1/1 Running 0 35s -po/nginx-701339712-o00ef 1/1 Running 0 35s +pod/nginx-701339712-e0qfq 1/1 Running 0 35s +pod/nginx-701339712-o00ef 1/1 Running 0 35s ``` ## Test the service by accessing it from another pod @@ -96,7 +96,7 @@ Use kubectl to create a NetworkPolicy from the above nginx-policy.yaml file: ```console $ kubectl create -f nginx-policy.yaml -networkpolicy "access-nginx" created +networkpolicy.networking.k8s.io/access-nginx created ``` ## Test access to the service when access label is not defined