Skip to content

Commit 474c17f

Browse files
committed
fix: exec [POD] [COMMAND] is not supported anymore. Use exec [POD] -- [COMMAND] instead
1 parent a0b9cda commit 474c17f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
292292
echo "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

docs/service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)