@@ -76,7 +76,7 @@ can follow along and get a second data point.
76
76
或者你也可以跟着教程并开始下面的步骤来获得第二个数据点。
77
77
78
78
``` shell
79
- kubectl create deployment hostnames --image=k8s.gcr. io/serve_hostname
79
+ kubectl create deployment hostnames --image=registry. k8s.io/serve_hostname
80
80
```
81
81
82
82
``` none
@@ -100,7 +100,8 @@ deployment.apps/hostnames scaled
100
100
```
101
101
102
102
<!--
103
- Note that this is the same as if you had the Deployment with the following YAML:
103
+ Note that this is the same as if you had started the Deployment with the following
104
+ YAML:
104
105
-->
105
106
请注意这与你使用以下 YAML 方式启动 Deployment 类似:
106
107
@@ -123,7 +124,7 @@ spec:
123
124
spec :
124
125
containers :
125
126
- name : hostnames
126
- image : k8s.gcr .io/serve_hostname
127
+ image : registry.k8s .io/serve_hostname
127
128
` ` `
128
129
129
130
<!--
@@ -133,7 +134,7 @@ You can confirm your Pods are running:
133
134
-->
134
135
" app" 标签是 `kubectl create deployment` 根据 Deployment 名称自动设置的。
135
136
136
- 确认你的 Pods 是运行状态 :
137
+ 确认你的 Pod 是运行状态 :
137
138
138
139
` ` ` shell
139
140
kubectl get pods -l app=hostnames
@@ -281,16 +282,18 @@ hostnames ClusterIP 10.0.1.175 <none> 80/TCP 5s
281
282
<!--
282
283
Now you know that the Service exists.
283
284
284
- As before, this is the same as if you had started the ` Service` with YAML:
285
+ As before, this is the same as if you had started the Service with YAML:
285
286
-->
286
287
现在你知道了 Service 确实存在。
287
288
288
- 同前,此步骤效果与通过 YAML 方式启动 ` Service ` 一样:
289
+ 同前,此步骤效果与通过 YAML 方式启动 Service 一样:
289
290
290
291
``` yaml
291
292
apiVersion : v1
292
293
kind : Service
293
294
metadata :
295
+ labels :
296
+ app : hostnames
294
297
name : hostnames
295
298
spec :
296
299
selector :
@@ -393,7 +396,7 @@ Namespace you're operating in. The "svc" denotes that this is a Service.
393
396
The "cluster.local" is your cluster domain, which COULD be different in your
394
397
own cluster.
395
398
396
- You can also try this from a ` Node` in the cluster :
399
+ You can also try this from a Node in the cluster :
397
400
398
401
-->
399
402
注意这里的后缀:"default.svc.cluster.local"。"default" 是我们正在操作的命名空间。
@@ -444,7 +447,7 @@ options ndots:5
444
447
```
445
448
446
449
<!--
447
- The `nameserver` line must indicate your cluster's DNS ` Service`. This is
450
+ The `nameserver` line must indicate your cluster's DNS Service. This is
448
451
passed into `kubelet` with the `--cluster-dns` flag.
449
452
-->
450
453
`nameserver` 行必须指示你的集群的 DNS Service,
@@ -550,7 +553,7 @@ are a number of things that could be going wrong. Read on.
550
553
## Is the Service defined correctly?
551
554
552
555
It might sound silly, but you should really double and triple check that your
553
- ` Service` is correct and matches your ` Pod` 's port. Read back your ` Service`
556
+ Service is correct and matches your Pod's port. Read back your Service
554
557
and verify it:
555
558
-->
556
559
## Service 的配置是否正确? {#is-the-service-defined-correctly}
@@ -598,6 +601,7 @@ kubectl get service hostnames -o json
598
601
}
599
602
}
600
603
```
604
+
601
605
<!--
602
606
* Is the Service port you are trying to access listed in `spec.ports[]`?
603
607
* Is the `targetPort` correct for your Pods (some Pods use a different port than the Service)?
@@ -763,7 +767,7 @@ Service 的默认实现(在大多数集群上应用的)是 kube-proxy。
763
767
如果你的集群不使用 kube-proxy,则以下各节将不适用,你将必须检查你正在使用的 Service 的实现方式。
764
768
765
769
<!--
766
- ## Is kube-proxy working ?
770
+ ### Is kube-proxy running ?
767
771
768
772
Confirm that `kube-proxy` is running on your Nodes. Running directly on a
769
773
Node, you should get something like the below:
@@ -1122,7 +1126,7 @@ Contact us on
1122
1126
## {{% heading "whatsnext" %}}
1123
1127
1124
1128
<!--
1125
- Visit [troubleshooting document](/docs/tasks/debug/) for more information.
1129
+ Visit the [troubleshooting overview document](/docs/tasks/debug/) for more information.
1126
1130
-->
1127
- 访问[ 故障排查文档 ] ( /zh-cn/docs/tasks/debug/ ) 获取更多信息。
1131
+ 访问[ 故障排查概述文档 ] ( /zh-cn/docs/tasks/debug/ ) 获取更多信息。
1128
1132
0 commit comments