Skip to content

Commit 8cd9c7d

Browse files
committed
[zh-cn] sync tasks/administer-cluster/*
Signed-off-by: xin.li <xin.li@daocloud.io>
1 parent eb1ead1 commit 8cd9c7d

9 files changed

+79
-26
lines changed

content/zh-cn/docs/tasks/administer-cluster/declare-network-policy.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ To limit the access to the `nginx` service so that only Pods with the label `acc
137137
如果想限制对 `nginx` 服务的访问,只让那些拥有标签 `access: true` 的 Pod 访问它,
138138
那么可以创建一个如下所示的 NetworkPolicy 对象:
139139

140-
{{% code file="service/networking/nginx-policy.yaml" %}}
140+
{{% code_sample file="service/networking/nginx-policy.yaml" %}}
141141

142142
<!--
143143
The name of a NetworkPolicy object must be a valid
@@ -224,4 +224,3 @@ wget --spider --timeout=1 nginx
224224
Connecting to nginx (10.100.0.16:80)
225225
remote file exists
226226
```
227-

content/zh-cn/docs/tasks/administer-cluster/dns-debugging-resolution.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ kube-dns.
4040
<!--
4141
### Create a simple Pod to use as a test environment
4242
43-
{{% code file="admin/dns/dnsutils.yaml" %}}
43+
{{% code_sample file="admin/dns/dnsutils.yaml" %}}
4444
4545
{{< note >}}
4646
This example creates a pod in the `default` namespace. DNS name resolution for
@@ -276,7 +276,7 @@ The service name is `kube-dns` for both CoreDNS and kube-dns deployments.
276276
-->
277277

278278
{{< note >}}
279-
不管是 CoreDNS 还是 kube-dns,这个服务的名字都会是 `kube-dns`
279+
不管是 CoreDNS 还是 kube-dns,这个服务的名字都会是 `kube-dns`
280280
{{< /note >}}
281281

282282
<!--
@@ -411,6 +411,7 @@ CoreDNS 必须能够列出 {{< glossary_tooltip text="service" term_id="service"
411411
{{< glossary_tooltip text="endpoint" term_id="endpoint" >}} 相关的资源来正确解析服务名称。
412412

413413
示例错误消息:
414+
414415
```
415416
2022-03-18T07:12:15.699431183Z [INFO] 10.96.144.227:52299 - 3686 "A IN serverproxy.contoso.net.cluster.local. udp 52 false 512" SERVFAIL qr,aa,rd 145 0.000091221s
416417
```
@@ -428,6 +429,7 @@ kubectl describe clusterrole system:coredns -n kube-system
428429
Expected output:
429430
-->
430431
预期输出:
432+
431433
```
432434
PolicyRule:
433435
Resources Non-Resource URLs Resource Names Verbs
@@ -482,6 +484,7 @@ This query is limited to the pod's namespace:
482484
如果 Pod 和服务的名字空间不相同,则 DNS 查询必须指定服务所在的名字空间。
483485

484486
该查询仅限于 Pod 所在的名字空间:
487+
485488
```shell
486489
kubectl exec -i -t dnsutils -- nslookup <service-name>
487490
```
@@ -490,6 +493,7 @@ kubectl exec -i -t dnsutils -- nslookup <service-name>
490493
This query specifies the namespace:
491494
-->
492495
指定名字空间的查询:
496+
493497
```shell
494498
kubectl exec -i -t dnsutils -- nslookup <service-name>.<namespace>
495499
```

content/zh-cn/docs/tasks/administer-cluster/dns-horizontal-autoscaling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Create a file named `dns-horizontal-autoscaler.yaml` with this content:
147147

148148
创建文件 `dns-horizontal-autoscaler.yaml`,内容如下所示:
149149

150-
{{% code file="admin/dns/dns-horizontal-autoscaler.yaml" %}}
150+
{{% code_sample file="admin/dns/dns-horizontal-autoscaler.yaml" %}}
151151

152152
<!--
153153
In the file, replace `<SCALE_TARGET>` with your scale target.
@@ -397,7 +397,7 @@ patterns: *linear* and *ladder*.
397397
-->
398398
* 扩缩参数是可以被修改的,而且不需要重建或重启 autoscaler Pod。
399399

400-
* autoscaler 提供了一个控制器接口来支持两种控制模式:*linear**ladder*
400+
* autoscaler 提供了一个控制器接口来支持两种控制模式:**linear****ladder**
401401

402402
## {{% heading "whatsnext" %}}
403403

@@ -407,5 +407,5 @@ patterns: *linear* and *ladder*.
407407
[implementation of cluster-proportional-autoscaler](http://github.com/kubernetes-sigs/cluster-proportional-autoscaler).
408408
409409
-->
410-
* 阅读[为关键插件 Pod 提供的调度保障](/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/)
411-
* 进一步了解 [cluster-proportional-autoscaler 实现](http://github.com/kubernetes-sigs/cluster-proportional-autoscaler)
410+
* 阅读[为关键插件 Pod 提供的调度保障](/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/)
411+
* 进一步了解 [cluster-proportional-autoscaler 实现](http://github.com/kubernetes-sigs/cluster-proportional-autoscaler)

content/zh-cn/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Here is a manifest for an example ResourceQuota:
6565

6666
下面是 ResourceQuota 的示例清单:
6767

68-
{{% code file="admin/resource/quota-mem-cpu.yaml" %}}
68+
{{% code_sample file="admin/resource/quota-mem-cpu.yaml" %}}
6969

7070
<!--
7171
Create the ResourceQuota:
@@ -116,7 +116,7 @@ Here is a manifest for an example Pod:
116116

117117
以下是 Pod 的示例清单:
118118

119-
{{% code file="admin/resource/quota-mem-cpu-pod.yaml" %}}
119+
{{% code_sample file="admin/resource/quota-mem-cpu-pod.yaml" %}}
120120

121121
<!--
122122
Create the Pod:
@@ -186,7 +186,7 @@ Here is a manifest for a second Pod:
186186

187187
以下为第二个 Pod 的清单:
188188

189-
{{% code file="admin/resource/quota-mem-cpu-pod-2.yaml" %}}
189+
{{% code_sample file="admin/resource/quota-mem-cpu-pod-2.yaml" %}}
190190

191191
<!--
192192
In the manifest, you can see that the Pod has a memory request of 700 MiB.
@@ -289,4 +289,3 @@ kubectl delete namespace quota-mem-cpu-example
289289
* [为容器和 Pod 分配内存资源](/zh-cn/docs/tasks/configure-pod-container/assign-memory-resource/)
290290
* [为容器和 Pod 分配 CPU 资源](/zh-cn/docs/tasks/configure-pod-container/assign-cpu-resource/)
291291
* [为 Pod 配置服务质量](/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/)
292-

content/zh-cn/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Here is an example manifest for a ResourceQuota:
6161

6262
下面是 ResourceQuota 的示例清单:
6363

64-
{{% code file="admin/resource/quota-pod.yaml" %}}
64+
{{% code_sample file="admin/resource/quota-pod.yaml" %}}
6565

6666
<!--
6767
Create the ResourceQuota:
@@ -104,7 +104,7 @@ Here is an example manifest for a {{< glossary_tooltip term_id="deployment" >}}:
104104
-->
105105
下面是一个 {{< glossary_tooltip term_id="deployment" >}} 的示例清单:
106106
107-
{{% code file="admin/resource/quota-pod-deployment.yaml" %}}
107+
{{% code_sample file="admin/resource/quota-pod-deployment.yaml" %}}
108108
109109
<!--
110110
In that manifest, `replicas: 3` tells Kubernetes to attempt to create three new Pods, all

content/zh-cn/docs/tasks/administer-cluster/namespaces-walkthrough.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ This example demonstrates how to use Kubernetes namespaces to subdivide your clu
5252
This example assumes the following:
5353
5454
1. You have an [existing Kubernetes cluster](/docs/setup/).
55-
2. You have a basic understanding of Kubernetes {{< glossary_tooltip text="Pods" term_id="pod" >}}, {{< glossary_tooltip term_id="service" text="Services" >}}, and {{< glossary_tooltip text="Deployments" term_id="deployment" >}}.
55+
2. You have a basic understanding of Kubernetes {{< glossary_tooltip text="Pods" term_id="pod" >}},
56+
{{< glossary_tooltip term_id="service" text="Services" >}}, and {{< glossary_tooltip text="Deployments" term_id="deployment" >}}.
5657
-->
5758
## 环境准备 {#prerequisites}
5859

@@ -133,7 +134,7 @@ Use the file [`namespace-dev.yaml`](/examples/admin/namespace-dev.yaml) which de
133134
-->
134135
文件 [`namespace-dev.yaml`](/examples/admin/namespace-dev.yaml) 描述了 `development` 名字空间:
135136

136-
{{% code language="yaml" file="admin/namespace-dev.yaml" %}}
137+
{{% code_sample language="yaml" file="admin/namespace-dev.yaml" %}}
137138

138139
<!--
139140
Create the `development` namespace using kubectl.
@@ -151,7 +152,7 @@ Save the following contents into file [`namespace-prod.yaml`](/examples/admin/na
151152
将下列的内容保存到文件 [`namespace-prod.yaml`](/examples/admin/namespace-prod.yaml) 中,
152153
这些内容是对 `production` 名字空间的描述:
153154

154-
{{% code language="yaml" file="admin/namespace-prod.yaml" %}}
155+
{{% code_sample language="yaml" file="admin/namespace-prod.yaml" %}}
155156

156157
<!--
157158
And then let's create the `production` namespace using kubectl.
@@ -239,7 +240,8 @@ lithe-cocoa-92103_kubernetes
239240
```
240241

241242
<!--
242-
The next step is to define a context for the kubectl client to work in each namespace. The value of "cluster" and "user" fields are copied from the current context.
243+
The next step is to define a context for the kubectl client to work in each namespace.
244+
he value of "cluster" and "user" fields are copied from the current context.
243245
-->
244246
下一步是为 kubectl 客户端定义一个上下文,以便在每个名字空间中工作。
245247
"cluster" 和 "user" 字段的值将从当前上下文中复制。
@@ -339,7 +341,7 @@ Let's create some contents.
339341
-->
340342
让我们创建一些内容。
341343
342-
{{% code file="admin/snowflake-deployment.yaml" %}}
344+
{{% code_sample file="admin/snowflake-deployment.yaml" %}}
343345
344346
<!--
345347
Apply the manifest to create a Deployment
@@ -351,7 +353,8 @@ kubectl apply -f http://k8s.io/examples/admin/snowflake-deployment.yaml
351353
```
352354

353355
<!--
354-
We have created a deployment whose replica size is 2 that is running the pod called `snowflake` with a basic container that serves the hostname.
356+
We have created a deployment whose replica size is 2 that is running the pod called
357+
`snowflake` with a basic container that serves the hostname.
355358
-->
356359
我们创建了一个副本大小为 2 的 Deployment,该 Deployment 运行名为 `snowflake` 的 Pod,
357360
其中包含一个仅提供主机名服务的基本容器。
@@ -374,7 +377,8 @@ snowflake-3968820950-vgc4n 1/1 Running 0 2m
374377
```
375378

376379
<!--
377-
And this is great, developers are able to do what they want, and they do not have to worry about affecting content in the `production` namespace.
380+
And this is great, developers are able to do what they want, and they do not have
381+
o worry about affecting content in the `production` namespace.
378382
-->
379383
这很棒,开发人员可以做他们想要的事情,而不必担心影响 `production` 名字空间中的内容。
380384

content/zh-cn/docs/tasks/administer-cluster/quota-api-object.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ object.
2222
-->
2323
本文讨论如何为 API 对象配置配额,包括 PersistentVolumeClaim 和 Service。
2424
配额限制了可以在命名空间中创建的特定类型对象的数量。
25-
你可以在 [ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core) 对象中指定配额。
25+
你可以在 [ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core)
26+
对象中指定配额。
2627

2728
## {{% heading "prerequisites" %}}
2829

@@ -53,7 +54,7 @@ Here is the configuration file for a ResourceQuota object:
5354

5455
下面是一个 ResourceQuota 对象的配置文件:
5556

56-
{{% code file="admin/resource/quota-objects.yaml" %}}
57+
{{% code_sample file="admin/resource/quota-objects.yaml" %}}
5758

5859
<!--
5960
Create the ResourceQuota:
@@ -102,7 +103,7 @@ Here is the configuration file for a PersistentVolumeClaim object:
102103
103104
下面是一个 PersistentVolumeClaim 对象的配置文件:
104105
105-
{{% code file="admin/resource/quota-objects-pvc.yaml" %}}
106+
{{% code_sample file="admin/resource/quota-objects-pvc.yaml" %}}
106107
107108
<!--
108109
Create the PersistentVolumeClaim:
@@ -141,7 +142,7 @@ Here is the configuration file for a second PersistentVolumeClaim:
141142

142143
下面是第二个 PersistentVolumeClaim 的配置文件:
143144

144-
{{% code file="admin/resource/quota-objects-pvc-2.yaml" %}}
145+
{{% code_sample file="admin/resource/quota-objects-pvc-2.yaml" %}}
145146

146147
<!--
147148
Attempt to create the second PersistentVolumeClaim:

content/zh-cn/docs/tasks/administer-cluster/running-cloud-controller.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ manager as a Daemonset in your cluster, use the following as a guideline:
176176
-->
177177
对于已经存在于 Kubernetes 内核中的提供商,你可以在集群中将 in-tree 云管理控制器作为守护进程运行。请使用如下指南:
178178

179-
{{% code file="admin/cloud/ccm-example.yaml" %}}
179+
{{% code_sample file="admin/cloud/ccm-example.yaml" %}}
180180

181181
<!--
182182
## Limitations

content/zh-cn/docs/tasks/administer-cluster/verify-signed-artifacts.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,49 @@ Here are some helpful resources to get started with `policy-controller`:
182182

183183
- [安装](http://github.com/sigstore/helm-charts/tree/main/charts/policy-controller)
184184
- [配置选项](http://github.com/sigstore/policy-controller/tree/main/config)
185+
186+
<!--
187+
## Verify the Software Bill Of Materials
188+
189+
You can verify the Kubernetes Software Bill of Materials (SBOM) by using the
190+
sigstore certificate and signature, or the corresponding SHA files:
191+
-->
192+
## 验证软件物料清单 {#verify-the-software-bill-of-materials}
193+
194+
你可以使用 sigstore 证书和签名或相应的 SHA 文件来验证 Kubernetes 软件物料清单(SBOM):
195+
196+
<!--
197+
# Retrieve the latest available Kubernetes release version
198+
199+
# Verify the SHA512 sum
200+
201+
# Verify the SHA256 sum
202+
203+
# Retrieve sigstore signature and certificate
204+
205+
# Verify the sigstore signature
206+
-->
207+
208+
```shell
209+
# 检索最新可用的 Kubernetes 发行版本
210+
VERSION=$(curl -Ls http://dl.k8s.io/release/stable.txt)
211+
212+
# 验证 SHA512 sum
213+
curl -Ls "http://sbom.k8s.io/$VERSION/release" -o "$VERSION.spdx"
214+
echo "$(curl -Ls "http://sbom.k8s.io/$VERSION/release.sha512") $VERSION.spdx" | sha512sum --check
215+
216+
# 验证 SHA256 sum
217+
echo "$(curl -Ls "http://sbom.k8s.io/$VERSION/release.sha256") $VERSION.spdx" | sha256sum --check
218+
219+
# 检索 sigstore 签名和证书
220+
curl -Ls "http://sbom.k8s.io/$VERSION/release.sig" -o "$VERSION.spdx.sig"
221+
curl -Ls "http://sbom.k8s.io/$VERSION/release.cert" -o "$VERSION.spdx.cert"
222+
223+
# 验证 sigstore 签名
224+
cosign verify-blob \
225+
--certificate "$VERSION.spdx.cert" \
226+
--signature "$VERSION.spdx.sig" \
227+
--certificate-identity krel-staging@k8s-releng-prod.iam.gserviceaccount.com \
228+
--certificate-oidc-issuer http://accounts.google.com \
229+
"$VERSION.spdx"
230+
```

0 commit comments

Comments
 (0)