Skip to content

Commit 3332aae

Browse files
authored
Merge pull request #36573 from yanrongshi/zh-cn]Sync-debug-runing-pod-
[zh-cn]Sync debug-service.md
2 parents c52cf3a + 094b685 commit 3332aae

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

content/zh-cn/docs/tasks/debug/debug-application/debug-service.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ can follow along and get a second data point.
7676
或者你也可以跟着教程并开始下面的步骤来获得第二个数据点。
7777

7878
```shell
79-
kubectl create deployment hostnames --image=k8s.gcr.io/serve_hostname
79+
kubectl create deployment hostnames --image=registry.k8s.io/serve_hostname
8080
```
8181

8282
```none
@@ -100,7 +100,8 @@ deployment.apps/hostnames scaled
100100
```
101101

102102
<!--
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:
104105
-->
105106
请注意这与你使用以下 YAML 方式启动 Deployment 类似:
106107

@@ -123,7 +124,7 @@ spec:
123124
spec:
124125
containers:
125126
- name: hostnames
126-
image: k8s.gcr.io/serve_hostname
127+
image: registry.k8s.io/serve_hostname
127128
```
128129
129130
<!--
@@ -133,7 +134,7 @@ You can confirm your Pods are running:
133134
-->
134135
"app" 标签是 `kubectl create deployment` 根据 Deployment 名称自动设置的。
135136

136-
确认你的 Pods 是运行状态:
137+
确认你的 Pod 是运行状态:
137138

138139
```shell
139140
kubectl get pods -l app=hostnames
@@ -281,16 +282,18 @@ hostnames ClusterIP 10.0.1.175 <none> 80/TCP 5s
281282
<!--
282283
Now you know that the Service exists.
283284
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:
285286
-->
286287
现在你知道了 Service 确实存在。
287288

288-
同前,此步骤效果与通过 YAML 方式启动 `Service` 一样:
289+
同前,此步骤效果与通过 YAML 方式启动 Service 一样:
289290

290291
```yaml
291292
apiVersion: v1
292293
kind: Service
293294
metadata:
295+
labels:
296+
app: hostnames
294297
name: hostnames
295298
spec:
296299
selector:
@@ -393,7 +396,7 @@ Namespace you're operating in. The "svc" denotes that this is a Service.
393396
The "cluster.local" is your cluster domain, which COULD be different in your
394397
own cluster.
395398

396-
You can also try this from a `Node` in the cluster:
399+
You can also try this from a Node in the cluster:
397400

398401
-->
399402
注意这里的后缀:"default.svc.cluster.local"。"default" 是我们正在操作的命名空间。
@@ -444,7 +447,7 @@ options ndots:5
444447
```
445448
446449
<!--
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
448451
passed into `kubelet` with the `--cluster-dns` flag.
449452
-->
450453
`nameserver` 行必须指示你的集群的 DNS Service,
@@ -550,7 +553,7 @@ are a number of things that could be going wrong. Read on.
550553
## Is the Service defined correctly?
551554
552555
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
554557
and verify it:
555558
-->
556559
## Service 的配置是否正确? {#is-the-service-defined-correctly}
@@ -598,6 +601,7 @@ kubectl get service hostnames -o json
598601
}
599602
}
600603
```
604+
601605
<!--
602606
* Is the Service port you are trying to access listed in `spec.ports[]`?
603607
* Is the `targetPort` correct for your Pods (some Pods use a different port than the Service)?
@@ -763,7 +767,7 @@ Service 的默认实现(在大多数集群上应用的)是 kube-proxy。
763767
如果你的集群不使用 kube-proxy,则以下各节将不适用,你将必须检查你正在使用的 Service 的实现方式。
764768

765769
<!--
766-
## Is kube-proxy working?
770+
### Is kube-proxy running?
767771
768772
Confirm that `kube-proxy` is running on your Nodes. Running directly on a
769773
Node, you should get something like the below:
@@ -1122,7 +1126,7 @@ Contact us on
11221126
## {{% heading "whatsnext" %}}
11231127

11241128
<!--
1125-
Visit [troubleshooting document](/docs/tasks/debug/) for more information.
1129+
Visit the [troubleshooting overview document](/docs/tasks/debug/) for more information.
11261130
-->
1127-
访问[故障排查文档](/zh-cn/docs/tasks/debug/)获取更多信息。
1131+
访问[故障排查概述文档](/zh-cn/docs/tasks/debug/)获取更多信息。
11281132

0 commit comments

Comments
 (0)