Skip to content

Commit 96f2795

Browse files
authored
Merge pull request #110 from necolo/patch-1
Update pod.md and service.md
2 parents 68c97e3 + ca8a5b6 commit 96f2795

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/pod.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ kubectl port-forward nginx-pod 4000:80
7474
我们可以通过 `logs` 或者 `logs -f` 命令查看 pod 日志,可以通过 `exec -it` 进入 pod 或者调用容器命令,通过 `delete pod` 或者 `delete -f nginx.yaml` 的方式删除 pod 资源。这里可以看到 [kubectl 所有命令](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)。
7575

7676
```shell
77-
kubectl logs --follow nginx
77+
kubectl logs --follow nginx-pod
7878
                              
79-
kubectl exec nginx -- ls
79+
kubectl exec nginx-pod -- ls
8080
81-
kubectl delete pod nginx
82-
# pod "nginx" deleted
81+
kubectl delete pod nginx-pod
82+
# pod "nginx-pod" deleted
8383
8484
kubectl delete -f nginx.yaml
85-
# pod "nginx" deleted
85+
# pod "nginx-pod" deleted
8686
```
8787

8888
最后,根据我们在 `container` 的那节构建的 `hellok8s:v1` 的镜像,同时参考 `nginx` pod 的资源定义,你能独自编写出 `hellok8s:v1` Pod 的资源文件吗?并通过 `port-forward` 到本地的 `3000` 端口进行访问,最终得到字符串 `[v1] Hello, Kubernetes!`。

docs/service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ kubectl get service
117117
apiVersion: v1
118118
kind: Pod
119119
metadata:
120-
name: nginx
120+
name: nginx-pod
121121
labels:
122122
app: nginx
123123
spec:

0 commit comments

Comments
 (0)