File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ kubectl port-forward nginx-pod 4000:80
287287` kubectl exec -it` 可以用来进入 Pod 内容器的 Shell。通过命令下面的命令来配置 `nginx` 的首页内容。
288288
289289` ` ` shell
290- kubectl exec -it nginx-pod /bin/bash
290+ kubectl exec -it nginx-pod -- /bin/bash
291291
292292echo "hello kubernetes by nginx!" > /usr/share/nginx/html/index.html
293293
@@ -934,7 +934,7 @@ kubectl get service
934934# NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
935935# service-hellok8s-clusterip ClusterIP 10.104.96.153 <none> 3000/TCP 10s
936936
937- kubectl exec -it nginx-pod /bin/bash
937+ kubectl exec -it nginx-pod -- /bin/bash
938938# root@nginx-pod:/# curl 10.104.96.153:3000
939939# [v3] Hello, Kubernetes!, From host: hellok8s-deployment-5d5545b69c-9gm8r
940940# root@nginx-pod:/# curl 10.104.96.153:3000
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ kubectl get service
138138# NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
139139# service-hellok8s-clusterip ClusterIP 10.104.96.153 <none> 3000/TCP 10s
140140
141- kubectl exec -it nginx-pod /bin/bash
141+ kubectl exec -it nginx-pod -- /bin/bash
142142# root@nginx-pod:/# curl 10.104.96.153:3000
143143# [v3] Hello, Kubernetes!, From host: hellok8s-deployment-5d5545b69c-9gm8r
144144# root@nginx-pod:/# curl 10.104.96.153:3000
You can’t perform that action at this time.
0 commit comments