Skip to content

Commit 82306fd

Browse files
committed
[zh-cn] sync resource-quotas configure-redis-using-configmap tutorials/security/* hello-minikube
Signed-off-by: xin.li <[email protected]>
1 parent ee45ad0 commit 82306fd

File tree

6 files changed

+56
-47
lines changed

6 files changed

+56
-47
lines changed

content/zh-cn/docs/concepts/policy/resource-quotas.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,11 @@ from getting scheduled in a failure domain.
752752
<!--
753753
Using this scope operators can prevent certain namespaces (`foo-ns` in the example below)
754754
from having pods that use cross-namespace pod affinity by creating a resource quota object in
755-
that namespace with `CrossNamespaceAffinity` scope and hard limit of 0:
755+
that namespace with `CrossNamespacePodAffinity` scope and hard limit of 0:
756756
-->
757757
使用此作用域操作符可以避免某些名字空间(例如下面例子中的 `foo-ns`)运行特别的 Pod,
758758
这类 Pod 使用跨名字空间的 Pod 亲和性约束,在该名字空间中创建了作用域为
759-
`CrossNamespaceAffinity` 的、硬性约束为 0 的资源配额对象。
759+
`CrossNamespacePodAffinity` 的、硬性约束为 0 的资源配额对象。
760760
761761
```yaml
762762
apiVersion: v1
@@ -769,17 +769,18 @@ spec:
769769
pods: "0"
770770
scopeSelector:
771771
matchExpressions:
772-
- scopeName: CrossNamespaceAffinity
772+
- scopeName: CrossNamespacePodAffinity
773+
operator: Exists
773774
```
774775

775776
<!--
776777
If operators want to disallow using `namespaces` and `namespaceSelector` by default, and
777-
only allow it for specific namespaces, they could configure `CrossNamespaceAffinity`
778+
only allow it for specific namespaces, they could configure `CrossNamespacePodAffinity`
778779
as a limited resource by setting the kube-apiserver flag --admission-control-config-file
779780
to the path of the following configuration file:
780781
-->
781782
如果集群运维人员希望默认禁止使用 `namespaces``namespaceSelector`
782-
而仅仅允许在特定名字空间中这样做,他们可以将 `CrossNamespaceAffinity`
783+
而仅仅允许在特定名字空间中这样做,他们可以将 `CrossNamespacePodAffinity`
783784
作为一个被约束的资源。方法是为 `kube-apiserver` 设置标志
784785
`--admission-control-config-file`,使之指向如下的配置文件:
785786

@@ -794,15 +795,16 @@ plugins:
794795
limitedResources:
795796
- resource: pods
796797
matchScopes:
797-
- scopeName: CrossNamespaceAffinity
798+
- scopeName: CrossNamespacePodAffinity
799+
operator: Exists
798800
```
799801
800802
<!--
801803
With the above configuration, pods can use `namespaces` and `namespaceSelector` in pod affinity only
802804
if the namespace where they are created have a resource quota object with
803-
`CrossNamespaceAffinity` scope and a hard limit greater than or equal to the number of pods using those fields.
805+
`CrossNamespacePodAffinity` scope and a hard limit greater than or equal to the number of pods using those fields.
804806
-->
805-
基于上面的配置,只有名字空间中包含作用域为 `CrossNamespaceAffinity`
807+
基于上面的配置,只有名字空间中包含作用域为 `CrossNamespacePodAffinity`
806808
且硬性约束大于或等于使用 `namespaces` 和 `namespaceSelector` 字段的 Pod
807809
个数时,才可以在该名字空间中继续创建在其 Pod 亲和性规则中设置 `namespaces`
808810
或 `namespaceSelector` 的新 Pod。

content/zh-cn/docs/tutorials/configuration/configure-redis-using-configmap.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,25 @@ content_type: tutorial
1313
<!-- overview -->
1414

1515
<!--
16-
This page provides a real world example of how to configure Redis using a ConfigMap and builds upon the [Configure a Pod to Use a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) task.
16+
This page provides a real world example of how to configure Redis using a ConfigMap and
17+
builds upon the [Configure a Pod to Use a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) task.
1718
-->
1819
这篇文档基于[配置 Pod 以使用 ConfigMap](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/)
1920
这个任务,提供了一个使用 ConfigMap 来配置 Redis 的真实案例。
2021

21-
22-
2322
## {{% heading "objectives" %}}
2423

25-
2624
<!--
2725
* Create a ConfigMap with Redis configuration values
2826
* Create a Redis Pod that mounts and uses the created ConfigMap
2927
* Verify that the configuration was correctly applied.
3028
-->
31-
3229
* 使用 Redis 配置的值创建一个 ConfigMap
3330
* 创建一个 Redis Pod,挂载并使用创建的 ConfigMap
3431
* 验证配置已经被正确应用
3532

36-
37-
38-
39-
4033
## {{% heading "prerequisites" %}}
4134

42-
4335
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
4436

4537
<!--
@@ -49,11 +41,8 @@ This page provides a real world example of how to configure Redis using a Config
4941
* 此页面上显示的示例适用于 `kubectl` 1.14 及以上的版本。
5042
* 理解[配置 Pod 以使用 ConfigMap](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/)
5143

52-
53-
5444
<!-- lessoncontent -->
5545

56-
5746
<!--
5847
## Real World Example: Configuring Redis using a ConfigMap
5948
@@ -81,7 +70,7 @@ EOF
8170
<!--
8271
Apply the ConfigMap created above, along with a Redis pod manifest:
8372
-->
84-
应用上面创建的 ConfigMap 以及 Redis pod 清单:
73+
应用上面创建的 ConfigMap 以及 Redis Pod 清单:
8574

8675
```shell
8776
kubectl apply -f example-redis-config.yaml
@@ -109,7 +98,7 @@ ConfigMap above as `/redis-master/redis.conf` inside the Pod.
10998
这样做的最终效果是将上面 `example-redis-config` 配置中 `data.redis-config`
11099
的数据作为 Pod 中的 `/redis-master/redis.conf` 公开。
111100

112-
{{< codenew file="pods/config/redis-pod.yaml" >}}
101+
{{% code_sample file="pods/config/redis-pod.yaml" %}}
113102

114103
<!--
115104
Examine the created objects:
@@ -210,12 +199,12 @@ Now let's add some configuration values to the `example-redis-config` ConfigMap:
210199
-->
211200
现在,向 `example-redis-config` ConfigMap 添加一些配置:
212201

213-
{{< codenew file="pods/config/example-redis-config.yaml" >}}
202+
{{% code_sample file="pods/config/example-redis-config.yaml" %}}
214203

215204
<!--
216205
Apply the updated ConfigMap:
217206
-->
218-
应用更新的 ConfigMap:
207+
应用更新的 ConfigMap
219208

220209
```shell
221210
kubectl apply -f example-redis-config.yaml
@@ -366,11 +355,7 @@ kubectl delete pod/redis configmap/example-redis-config
366355

367356
## {{% heading "whatsnext" %}}
368357

369-
370358
<!--
371359
* Learn more about [ConfigMaps](/docs/tasks/configure-pod-container/configure-pod-configmap/).
372360
-->
373-
* 了解有关 [ConfigMaps](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/) 的更多信息。
374-
375-
376-
361+
* 了解有关 [ConfigMap](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/) 的更多信息。

content/zh-cn/docs/tutorials/hello-minikube.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Open the Kubernetes dashboard. You can do this two different ways:
8888
Open a **new** terminal, and run:
8989
-->
9090
打开一个**新的**终端,然后运行:
91+
9192
```shell
9293
# 启动一个新的终端,并保持此命令运行。
9394
minikube dashboard
@@ -241,6 +242,25 @@ Deployment 是管理 Pod 创建和扩展的推荐方法。
241242
kubectl config view
242243
```
243244

245+
<!--
246+
1. View application logs for a container in a pod.
247+
-->
248+
1. 查看 Pod 中容器的应用程序日志。
249+
250+
```shell
251+
kubectl logs hello-node-5f76cf6ccf-br9b5
252+
```
253+
254+
<!--
255+
The output is similar to:
256+
-->
257+
输出类似于:
258+
259+
```
260+
I0911 09:19:26.677397 1 log.go:195] Started HTTP server on port 8080
261+
I0911 09:19:26.677586 1 log.go:195] Started UDP server on port 8081
262+
```
263+
244264
{{< note >}}
245265
<!--
246266
For more information about `kubectl` commands, see the [kubectl overview](/docs/reference/kubectl/).
@@ -332,7 +352,8 @@ Kubernetes [*Service*](/docs/concepts/services-networking/service/).
332352
<!--
333353
## Enable addons
334354
335-
The minikube tool includes a set of built-in {{< glossary_tooltip text="addons" term_id="addons" >}} that can be enabled, disabled and opened in the local Kubernetes environment.
355+
The minikube tool includes a set of built-in {{< glossary_tooltip text="addons" term_id="addons" >}}
356+
hat can be enabled, disabled and opened in the local Kubernetes environment.
336357
337358
1. List the currently supported addons:
338359
-->
@@ -487,11 +508,12 @@ If you want to use minikube again to learn more about Kubernetes, you don't need
487508
## {{% heading "whatsnext" %}}
488509

489510
<!--
511+
* Tutorial to _[deploy your first app on Kubernetes with kubectl](/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/)_.
490512
* Learn more about [Deployment objects](/docs/concepts/workloads/controllers/deployment/).
491513
* Learn more about [Deploying applications](/docs/tasks/run-application/run-stateless-application-deployment/).
492514
* Learn more about [Service objects](/docs/concepts/services-networking/service/).
493515
-->
516+
* **[使用 kubectl 在 Kubernetes 上部署你的第一个应用程序](/zh-cn/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/)**教程。
494517
* 进一步了解 [Deployment 对象](/zh-cn/docs/concepts/workloads/controllers/deployment/)
495518
* 进一步了解[部署应用](/zh-cn/docs/tasks/run-application/run-stateless-application-deployment/)
496519
* 进一步了解 [Service 对象](/zh-cn/docs/concepts/services-networking/service/)
497-

content/zh-cn/docs/tutorials/security/apparmor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ AppArmor 目前处于 Beta 阶段,因此选项以注解形式设定。
203203
AppArmor profiles are specified *per-container*. To specify the AppArmor profile to run a Pod
204204
container with, add an annotation to the Pod's metadata:
205205
-->
206-
AppArmor 配置文件是按 **逐个容器** 的形式来设置的。
206+
AppArmor 配置文件是按**逐个容器**的形式来设置的。
207207
要指定用来运行 Pod 容器的 AppArmor 配置文件,请向 Pod 的 metadata 添加注解:
208208

209209
```yaml
@@ -329,7 +329,7 @@ Next, we'll run a simple "Hello AppArmor" pod with the deny-write profile:
329329
-->
330330
接下来,我们将运行一个带有拒绝写入配置文件的简单 “Hello AppArmor” Pod:
331331

332-
{{< codenew file="pods/security/hello-apparmor.yaml" >}}
332+
{{% code_sample file="pods/security/hello-apparmor.yaml" %}}
333333

334334
```shell
335335
kubectl create -f ./hello-apparmor.yaml

content/zh-cn/docs/tutorials/security/cluster-level-pss.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Pod 安全是一个准入控制器,当新的 Pod 被创建时,它会根据 K
4545
<!--
4646
Install the following on your workstation:
4747
48-
- [KinD](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
48+
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
4949
- [kubectl](/docs/tasks/tools/)
5050
-->
5151
在你的工作站中安装以下内容:
5252

53-
- [KinD](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
53+
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
5454
- [kubectl](/zh-cn/docs/tasks/tools/)
5555

5656
<!--
@@ -368,11 +368,11 @@ following:
368368
369369
{{<note>}}
370370
<!--
371-
If you use Docker Desktop with KinD on macOS, you can
371+
If you use Docker Desktop with *kind* on macOS, you can
372372
add `/tmp` as a Shared Directory under the menu item
373373
**Preferences > Resources > File Sharing**.
374374
-->
375-
如果你在 macOS 上使用 Docker Desktop 和 KinD
375+
如果你在 macOS 上使用 Docker Desktop 和 kind
376376
你可以在菜单项 **Preferences > Resources > File Sharing**
377377
下添加 `/tmp` 作为共享目录。
378378
{{</note>}}
@@ -411,7 +411,7 @@ following:
411411
<!--
412412
1. Point kubectl to the cluster:
413413
-->
414-
6. 将 kubectl 指向集群
414+
6. 将 kubectl 指向集群
415415

416416
```shell
417417
kubectl cluster-info --context kind-psa-with-cluster-pss

content/zh-cn/docs/tutorials/security/seccomp.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ into the cluster.
123123

124124
{{< tabs name="tab_with_code" >}}
125125
{{< tab name="audit.json" >}}
126-
{{< codenew file="pods/security/seccomp/profiles/audit.json" >}}
126+
{{% code_sample file="pods/security/seccomp/profiles/audit.json" %}}
127127
{{< /tab >}}
128128
{{< tab name="violation.json" >}}
129-
{{< codenew file="pods/security/seccomp/profiles/violation.json" >}}
129+
{{% code_sample file="pods/security/seccomp/profiles/violation.json" %}}
130130
{{< /tab >}}
131131
{{< tab name="fine-grained.json" >}}
132-
{{< codenew file="pods/security/seccomp/profiles/fine-grained.json" >}}
132+
{{% code_sample file="pods/security/seccomp/profiles/fine-grained.json" %}}
133133
{{< /tab >}}
134134
{{< /tabs >}}
135135

@@ -170,7 +170,7 @@ onto a node.
170170
Kind 在 Docker 中运行 Kubernetes,因此集群的每个节点都是一个容器。
171171
这允许将文件挂载到每个容器的文件系统中,类似于将文件加载到节点上。
172172

173-
{{< codenew file="pods/security/seccomp/kind.yaml" >}}
173+
{{% code_sample file="pods/security/seccomp/kind.yaml" %}}
174174

175175
<!--
176176
Download that example kind configuration, and save it to a file named `kind.yaml`:
@@ -298,7 +298,7 @@ for all its containers:
298298
-->
299299
这是一个 Pod 的清单,它要求其所有容器使用 `RuntimeDefault` seccomp 配置文件:
300300

301-
{{< codenew file="pods/security/seccomp/ga/default-pod.yaml" >}}
301+
{{% code_sample file="pods/security/seccomp/ga/default-pod.yaml" %}}
302302

303303
<!--
304304
Create that Pod:
@@ -346,7 +346,7 @@ Here's a manifest for that Pod:
346346

347347
这是该 Pod 的清单:
348348

349-
{{< codenew file="pods/security/seccomp/ga/audit-pod.yaml" >}}
349+
{{% code_sample file="pods/security/seccomp/ga/audit-pod.yaml" %}}
350350

351351
{{< note >}}
352352
<!--
@@ -515,7 +515,7 @@ The manifest for this demonstration is:
515515

516516
此演示的清单是:
517517

518-
{{< codenew file="pods/security/seccomp/ga/violation-pod.yaml" >}}
518+
{{% code_sample file="pods/security/seccomp/ga/violation-pod.yaml" %}}
519519

520520
<!--
521521
Attempt to create the Pod in the cluster:
@@ -585,7 +585,7 @@ The manifest for this example is:
585585

586586
此示例的清单是:
587587

588-
{{< codenew file="pods/security/seccomp/ga/fine-pod.yaml" >}}
588+
{{% code_sample file="pods/security/seccomp/ga/fine-pod.yaml" %}}
589589

590590
<!--
591591
Create the Pod in your cluster:

0 commit comments

Comments
 (0)