From 809ce2f54a8cc18cec66b34057910b27b3d33667 Mon Sep 17 00:00:00 2001
From: chrismetz09
Date: Mon, 7 Feb 2022 14:58:33 -0800
Subject: [PATCH 001/245] Add figure to text/caption _index.md
Change file: ../docs/contribute/_index.md
Method described in [How to use captions](https://kubernetes.io/docs/contribute/style/diagram-guide/#how-to-use-captions)
Contributes to common method for referencing and labeling figures in docs.
---
content/en/docs/contribute/_index.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/content/en/docs/contribute/_index.md b/content/en/docs/contribute/_index.md
index 9c48566ccd..7aec439fec 100644
--- a/content/en/docs/contribute/_index.md
+++ b/content/en/docs/contribute/_index.md
@@ -95,9 +95,9 @@ class A,B,C,D,E,F,G,H,M,Q,N,O,P,V grey
class S,T,U spacewhite
class first,second,third white
{{ mermaid >}}
-***Figure - Getting started for a new contributor***
+Figure 1. Getting started for a new contributor
-The figure above outlines a roadmap for new contributors. You can follow some or all of the steps for `Sign up` and `Review`. Now you are ready to open PRs that achieve your contribution objectives with some listed under `Open PR`. Again, questions are always welcome!
+Figure 1 outlines a roadmap for new contributors. You can follow some or all of the steps for `Sign up` and `Review`. Now you are ready to open PRs that achieve your contribution objectives with some listed under `Open PR`. Again, questions are always welcome!
Some tasks require more trust and more access in the Kubernetes organization.
See [Participating in SIG Docs](/docs/contribute/participate/) for more details about
@@ -105,7 +105,7 @@ roles and permissions.
## Your first contribution
-You can prepare for your first contribution by reviewing several steps beforehand. The figure below outlines the steps and the details follow.
+You can prepare for your first contribution by reviewing several steps beforehand. Figure 2 outlines the steps and the details follow.
@@ -136,7 +136,7 @@ class A,B,D,E,F,G grey
class S,T spacewhite
class first,second white
{{ mermaid >}}
-***Figure - Preparation for your first contribution***
+Figure 2. Preparation for your first contribution
- Read the [Contribution overview](/docs/contribute/new-content/overview/) to
learn about the different ways you can contribute.
From 72d99dfae643b3ae7cafb573d7f516d8cbb86bca Mon Sep 17 00:00:00 2001
From: chrismetz09
Date: Mon, 7 Feb 2022 15:16:37 -0800
Subject: [PATCH 002/245] add period to caption text
---
content/en/docs/contribute/_index.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/en/docs/contribute/_index.md b/content/en/docs/contribute/_index.md
index 7aec439fec..61a4e0a118 100644
--- a/content/en/docs/contribute/_index.md
+++ b/content/en/docs/contribute/_index.md
@@ -95,7 +95,7 @@ class A,B,C,D,E,F,G,H,M,Q,N,O,P,V grey
class S,T,U spacewhite
class first,second,third white
{{ mermaid >}}
-Figure 1. Getting started for a new contributor
+Figure 1. Getting started for a new contributor.
Figure 1 outlines a roadmap for new contributors. You can follow some or all of the steps for `Sign up` and `Review`. Now you are ready to open PRs that achieve your contribution objectives with some listed under `Open PR`. Again, questions are always welcome!
@@ -136,7 +136,7 @@ class A,B,D,E,F,G grey
class S,T spacewhite
class first,second white
{{ mermaid >}}
-Figure 2. Preparation for your first contribution
+Figure 2. Preparation for your first contribution.
- Read the [Contribution overview](/docs/contribute/new-content/overview/) to
learn about the different ways you can contribute.
From fdfc64e861e36fbe6e28f3801bca84c2b54d6ab6 Mon Sep 17 00:00:00 2001
From: sgpinkus
Date: Sat, 19 Mar 2022 13:17:50 +1100
Subject: [PATCH 003/245] Update _index.md
Make 100% clear, that according to the k8s networking model pods are supposed to get their own unique IP address. I always thought this was the case. But then faced debugging issue where some pods are being assigned the same IP addresses. Came here to review my understanding of it, and confirm this is expected behaviour or not. But it was not stated unequivocally. This change makes it so.
---
.../docs/concepts/services-networking/_index.md | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/content/en/docs/concepts/services-networking/_index.md b/content/en/docs/concepts/services-networking/_index.md
index ab1b784658..2e443d4744 100644
--- a/content/en/docs/concepts/services-networking/_index.md
+++ b/content/en/docs/concepts/services-networking/_index.md
@@ -7,26 +7,25 @@ description: >
## The Kubernetes network model
-Every [`Pod`](/docs/concepts/workloads/pods/) gets its own IP address.
+Every [`Pod`](/docs/concepts/workloads/pods/) in a cluster gets its own unique cluster wide IP address.
This means you do not need to explicitly create links between `Pods` and you
almost never need to deal with mapping container ports to host ports.
This creates a clean, backwards-compatible model where `Pods` can be treated
much like VMs or physical hosts from the perspectives of port allocation,
-naming, service discovery, [load balancing](/docs/concepts/services-networking/ingress/#load-balancing), application configuration,
-and migration.
+naming, service discovery, [load balancing](/docs/concepts/services-networking/ingress/#load-balancing),
+application configuration, and migration.
Kubernetes imposes the following fundamental requirements on any networking
implementation (barring any intentional network segmentation policies):
- * pods on a [node](/docs/concepts/architecture/nodes/) can communicate with all pods on all nodes without NAT
+ * pods can communicate with all other pods on any other [node](/docs/concepts/architecture/nodes/)
+ without NAT
* agents on a node (e.g. system daemons, kubelet) can communicate with all
pods on that node
Note: For those platforms that support `Pods` running in the host network (e.g.
-Linux):
-
- * pods in the host network of a node can communicate with all pods on all
- nodes without NAT
+Linux), when pods are attached to the host network of a node they can still communicate
+with all pods on all nodes without NAT.
This model is not only less complex overall, but it is principally compatible
with the desire for Kubernetes to enable low-friction porting of apps from VMs
From 417eede9858a94fc8f2dec5cf03b7e7cd7566229 Mon Sep 17 00:00:00 2001
From: sgpinkus
Date: Mon, 21 Mar 2022 21:01:49 +1100
Subject: [PATCH 004/245] Update
content/en/docs/concepts/services-networking/_index.md
Co-authored-by: divya-mohan0209
---
content/en/docs/concepts/services-networking/_index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/docs/concepts/services-networking/_index.md b/content/en/docs/concepts/services-networking/_index.md
index 2e443d4744..b4f7861075 100644
--- a/content/en/docs/concepts/services-networking/_index.md
+++ b/content/en/docs/concepts/services-networking/_index.md
@@ -7,7 +7,7 @@ description: >
## The Kubernetes network model
-Every [`Pod`](/docs/concepts/workloads/pods/) in a cluster gets its own unique cluster wide IP address.
+Every [`Pod`](/docs/concepts/workloads/pods/) in a cluster gets its own unique cluster-wide IP address.
This means you do not need to explicitly create links between `Pods` and you
almost never need to deal with mapping container ports to host ports.
This creates a clean, backwards-compatible model where `Pods` can be treated
From f26337fadc73cbc4dbe37c376919e89f63801b8f Mon Sep 17 00:00:00 2001
From: s-kawamura-w664
Date: Fri, 25 Feb 2022 09:11:00 +0000
Subject: [PATCH 005/245] Add that pv's access modes are not constraints on the
volume.
---
content/en/docs/concepts/storage/persistent-volumes.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/content/en/docs/concepts/storage/persistent-volumes.md b/content/en/docs/concepts/storage/persistent-volumes.md
index 7a11939507..e7f4f52ce3 100644
--- a/content/en/docs/concepts/storage/persistent-volumes.md
+++ b/content/en/docs/concepts/storage/persistent-volumes.md
@@ -477,6 +477,15 @@ In the CLI, the access modes are abbreviated to:
* RWX - ReadWriteMany
* RWOP - ReadWriteOncePod
+{{< note >}}
+Kubernetes uses volume access modes to match PersistentVolumeClaims and PersistentVolumes.
+In some cases, the volume access modes also constrain where the PersistentVolume can be mounted.
+Volume access modes do **not** enforce write protection once the storage has been mounted.
+Even if the access modes are specified as ReadWriteOnce, ReadOnlyMany, or ReadWriteMany, they don't set any constraints on the volume.
+For example, even if a PersistentVolume is created as ReadOnlyMany, it is no guarantee that it will be read-only.
+If the access modes are specified as ReadWriteOncePod, the volume is constrained and can be mounted on only a single Pod.
+{{< /note >}}
+
> __Important!__ A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time.
From f22d7fa961b4ac229d83f769f2acf670c542ea53 Mon Sep 17 00:00:00 2001
From: "Mr. Erlison"
Date: Thu, 21 Apr 2022 13:32:11 -0300
Subject: [PATCH 006/245] Add
content/pt-br/docs/reference/glossary/applications.md
---
.../pt-br/docs/reference/glossary/applications.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 content/pt-br/docs/reference/glossary/applications.md
diff --git a/content/pt-br/docs/reference/glossary/applications.md b/content/pt-br/docs/reference/glossary/applications.md
new file mode 100644
index 0000000000..a00ca0ec6c
--- /dev/null
+++ b/content/pt-br/docs/reference/glossary/applications.md
@@ -0,0 +1,12 @@
+---
+title: Aplicações
+id: applications
+date: 2019-05-12
+full_link:
+short_description: >
+ A camada onde vários aplicativos em contêiner são executados.
+aka:
+tags:
+- fundamental
+---
+ A camada onde vários aplicativos em contêiner são executados.
From aaeaddba63bcbde54893b87c36c795e73b6d34dd Mon Sep 17 00:00:00 2001
From: "Mr. Erlison"
Date: Thu, 21 Apr 2022 13:38:19 -0300
Subject: [PATCH 007/245] Add
content/pt-br/docs/reference/glossary/certificate.md
---
.../docs/reference/glossary/certificate.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 content/pt-br/docs/reference/glossary/certificate.md
diff --git a/content/pt-br/docs/reference/glossary/certificate.md b/content/pt-br/docs/reference/glossary/certificate.md
new file mode 100644
index 0000000000..d43ead1f32
--- /dev/null
+++ b/content/pt-br/docs/reference/glossary/certificate.md
@@ -0,0 +1,17 @@
+---
+title: Certificado
+id: certificate
+date: 2018-04-12
+full_link: /docs/tasks/tls/managing-tls-in-a-cluster/
+short_description: >
+ Um arquivo criptograficamente seguro usado para validar o acesso ao cluster Kubernetes.
+
+aka:
+tags:
+- security
+---
+ Um arquivo criptograficamente seguro usado para validar o acesso ao cluster Kubernetes.
+
+
+
+Os certificados permitem que aplicativos dentro de um cluster Kubernetes acessem a API do Kubernetes com segurança. Os certificados validam que os clientes têm permissão para acessar a API.
\ No newline at end of file
From 688060dcc9c67f932d8fde43db51213e4d0277f6 Mon Sep 17 00:00:00 2001
From: "Mr. Erlison"
Date: Thu, 21 Apr 2022 13:55:23 -0300
Subject: [PATCH 008/245] Add
content/pt-br/docs/reference/glossary/cluster-architect.md
---
.../reference/glossary/cluster-architect.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 content/pt-br/docs/reference/glossary/cluster-architect.md
diff --git a/content/pt-br/docs/reference/glossary/cluster-architect.md b/content/pt-br/docs/reference/glossary/cluster-architect.md
new file mode 100644
index 0000000000..3aeb95e084
--- /dev/null
+++ b/content/pt-br/docs/reference/glossary/cluster-architect.md
@@ -0,0 +1,17 @@
+---
+title: Arquiteto de Cluster
+id: cluster-architect
+date: 2018-04-12
+full_link:
+short_description: >
+ Uma pessoa que projeta infraestrutura que envolve um ou mais clusters Kubernetes.
+
+aka:
+tags:
+- user-type
+---
+ Uma pessoa que projeta infraestrutura que envolve um ou mais clusters Kubernetes.
+
+
+
+Os arquitetos de clusters estão preocupados com as melhores práticas para sistemas distribuídos, por exemplo: alta disponibilidade e segurança.
\ No newline at end of file
From ebdae18bd1b88a2cbbe114601a45c48cb1a59196 Mon Sep 17 00:00:00 2001
From: "Mr. Erlison"
Date: Sat, 23 Apr 2022 12:39:15 -0300
Subject: [PATCH 009/245] Add pt-br/docs/reference/glossary/data-plane.md
---
content/pt-br/docs/reference/glossary/data-plane.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 content/pt-br/docs/reference/glossary/data-plane.md
diff --git a/content/pt-br/docs/reference/glossary/data-plane.md b/content/pt-br/docs/reference/glossary/data-plane.md
new file mode 100644
index 0000000000..2e7c9946f9
--- /dev/null
+++ b/content/pt-br/docs/reference/glossary/data-plane.md
@@ -0,0 +1,13 @@
+---
+title: Plano de Dados
+id: data-plane
+date: 2019-05-12
+full_link:
+short_description: >
+ A camada que fornece capacidade, tais como CPU, memória, rede e armazenamento, para que os contêineres possam ser executados e conectados a uma rede.
+
+aka:
+tags:
+- fundamental
+---
+ A camada que fornece capacidade, tais como CPU, memória, rede e armazenamento, para que os contêineres possam ser executados e conectados a uma rede.
From c83e9500d240e603b5afc2b59e395adc3731dcec Mon Sep 17 00:00:00 2001
From: Shabir Mohamed Abdul Samadh
<7249208+Shabirmean@users.noreply.github.com>
Date: Mon, 25 Apr 2022 12:57:47 -0400
Subject: [PATCH 010/245] doc: add note about endpoint.name==service.name
For Services without selectors, there is no mention of the requirement that the name of the associated Endpoint object must be the same as the Service name. Thus, I have added that note.
---
content/en/docs/concepts/services-networking/service.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md
index fa201c0e1b..7f89b14d0d 100644
--- a/content/en/docs/concepts/services-networking/service.md
+++ b/content/en/docs/concepts/services-networking/service.md
@@ -203,6 +203,8 @@ subsets:
The name of the Endpoints object must be a valid
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
+{{< note >}} The name of the Endpoint must be the same as the name of the Service. {{< /note >}}
+
{{< note >}}
The endpoint IPs _must not_ be: loopback (127.0.0.0/8 for IPv4, ::1/128 for IPv6), or
link-local (169.254.0.0/16 and 224.0.0.0/24 for IPv4, fe80::/64 for IPv6).
From 7454622a18ae7d94380d62fc46cd41f6adff410e Mon Sep 17 00:00:00 2001
From: Shabir Mohamed Abdul Samadh
<7249208+Shabirmean@users.noreply.github.com>
Date: Tue, 26 Apr 2022 07:02:40 -0400
Subject: [PATCH 011/245] doc: adopt suggestion
Co-authored-by: Tim Bannister
---
content/en/docs/concepts/services-networking/service.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md
index 7f89b14d0d..c04e7d6398 100644
--- a/content/en/docs/concepts/services-networking/service.md
+++ b/content/en/docs/concepts/services-networking/service.md
@@ -203,7 +203,9 @@ subsets:
The name of the Endpoints object must be a valid
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
-{{< note >}} The name of the Endpoint must be the same as the name of the Service. {{< /note >}}
+When you create an [Endpoints](docs/reference/kubernetes-api/service-resources/endpoints-v1/)
+object for a Service, you set the name of the new Endpoints to be the same as the
+name of the Service.
{{< note >}}
The endpoint IPs _must not_ be: loopback (127.0.0.0/8 for IPv4, ::1/128 for IPv6), or
From f2ef9858a38eb06e58ec55862b37215d84cb46c2 Mon Sep 17 00:00:00 2001
From: Shabir Mohamed Abdul Samadh
<7249208+Shabirmean@users.noreply.github.com>
Date: Tue, 26 Apr 2022 07:04:44 -0400
Subject: [PATCH 012/245] doc: add comment about the name match in the example
---
content/en/docs/concepts/services-networking/service.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md
index c04e7d6398..571d5f2a0a 100644
--- a/content/en/docs/concepts/services-networking/service.md
+++ b/content/en/docs/concepts/services-networking/service.md
@@ -192,6 +192,7 @@ where it's running, by adding an Endpoints object manually:
apiVersion: v1
kind: Endpoints
metadata:
+ # the name here should match the name of the Service
name: my-service
subsets:
- addresses:
From 7359d60de8ebea02c8735e1f357f8b7990d9c8c5 Mon Sep 17 00:00:00 2001
From: Qiming Teng
Date: Wed, 27 Apr 2022 10:20:18 +0800
Subject: [PATCH 013/245] Tweak indentation on portforward page
This PR fixes the indentation nits in the
`port-forward-access-application-cluster` page.
We are not supposed to indent lines by 4 spaces because such
indentations may mislead the markdown parser to render them as code
snippets.
---
...port-forward-access-application-cluster.md | 218 ++++++++----------
1 file changed, 102 insertions(+), 116 deletions(-)
diff --git a/content/en/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md b/content/en/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md
index ba8f7b1244..3b2648f943 100644
--- a/content/en/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md
+++ b/content/en/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md
@@ -11,180 +11,169 @@ This page shows how to use `kubectl port-forward` to connect to a MongoDB
server running in a Kubernetes cluster. This type of connection can be useful
for database debugging.
-
-
-
## {{% heading "prerequisites" %}}
-
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
-
* Install [MongoDB Shell](https://www.mongodb.com/try/download/shell).
-
-
-
## Creating MongoDB deployment and service
1. Create a Deployment that runs MongoDB:
- ```shell
- kubectl apply -f https://k8s.io/examples/application/mongodb/mongo-deployment.yaml
- ```
+ ```shell
+ kubectl apply -f https://k8s.io/examples/application/mongodb/mongo-deployment.yaml
+ ```
- The output of a successful command verifies that the deployment was created:
+ The output of a successful command verifies that the deployment was created:
- ```
- deployment.apps/mongo created
- ```
+ ```
+ deployment.apps/mongo created
+ ```
- View the pod status to check that it is ready:
+ View the pod status to check that it is ready:
- ```shell
- kubectl get pods
- ```
+ ```shell
+ kubectl get pods
+ ```
- The output displays the pod created:
+ The output displays the pod created:
- ```
- NAME READY STATUS RESTARTS AGE
- mongo-75f59d57f4-4nd6q 1/1 Running 0 2m4s
- ```
+ ```
+ NAME READY STATUS RESTARTS AGE
+ mongo-75f59d57f4-4nd6q 1/1 Running 0 2m4s
+ ```
- View the Deployment's status:
+ View the Deployment's status:
- ```shell
- kubectl get deployment
- ```
+ ```shell
+ kubectl get deployment
+ ```
- The output displays that the Deployment was created:
+ The output displays that the Deployment was created:
- ```
- NAME READY UP-TO-DATE AVAILABLE AGE
- mongo 1/1 1 1 2m21s
- ```
+ ```
+ NAME READY UP-TO-DATE AVAILABLE AGE
+ mongo 1/1 1 1 2m21s
+ ```
- The Deployment automatically manages a ReplicaSet.
- View the ReplicaSet status using:
+ The Deployment automatically manages a ReplicaSet.
+ View the ReplicaSet status using:
- ```shell
- kubectl get replicaset
- ```
+ ```shell
+ kubectl get replicaset
+ ```
- The output displays that the ReplicaSet was created:
-
- ```
- NAME DESIRED CURRENT READY AGE
- mongo-75f59d57f4 1 1 1 3m12s
- ```
+ The output displays that the ReplicaSet was created:
+ ```
+ NAME DESIRED CURRENT READY AGE
+ mongo-75f59d57f4 1 1 1 3m12s
+ ```
2. Create a Service to expose MongoDB on the network:
- ```shell
- kubectl apply -f https://k8s.io/examples/application/mongodb/mongo-service.yaml
- ```
+ ```shell
+ kubectl apply -f https://k8s.io/examples/application/mongodb/mongo-service.yaml
+ ```
- The output of a successful command verifies that the Service was created:
+ The output of a successful command verifies that the Service was created:
- ```
- service/mongo created
- ```
+ ```
+ service/mongo created
+ ```
- Check the Service created:
+ Check the Service created:
- ```shell
- kubectl get service mongo
- ```
+ ```shell
+ kubectl get service mongo
+ ```
- The output displays the service created:
+ The output displays the service created:
- ```
- NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
- mongo ClusterIP 10.96.41.183 27017/TCP 11s
- ```
+ ```
+ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+ mongo ClusterIP 10.96.41.183 27017/TCP 11s
+ ```
3. Verify that the MongoDB server is running in the Pod, and listening on port 27017:
- ```shell
- # Change mongo-75f59d57f4-4nd6q to the name of the Pod
- kubectl get pod mongo-75f59d57f4-4nd6q --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
- ```
+ ```shell
+ # Change mongo-75f59d57f4-4nd6q to the name of the Pod
+ kubectl get pod mongo-75f59d57f4-4nd6q --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
+ ```
- The output displays the port for MongoDB in that Pod:
+ The output displays the port for MongoDB in that Pod:
- ```
- 27017
- ```
+ ```
+ 27017
+ ```
- (this is the TCP port allocated to MongoDB on the internet).
+ 27017 is the TCP port allocated to MongoDB on the internet.
## Forward a local port to a port on the Pod
-1. `kubectl port-forward` allows using resource name, such as a pod name, to select a matching pod to port forward to.
+1. `kubectl port-forward` allows using resource name, such as a pod name, to select a matching pod to port forward to.
- ```shell
- # Change mongo-75f59d57f4-4nd6q to the name of the Pod
- kubectl port-forward mongo-75f59d57f4-4nd6q 28015:27017
- ```
+ ```shell
+ # Change mongo-75f59d57f4-4nd6q to the name of the Pod
+ kubectl port-forward mongo-75f59d57f4-4nd6q 28015:27017
+ ```
- which is the same as
+ which is the same as
- ```shell
- kubectl port-forward pods/mongo-75f59d57f4-4nd6q 28015:27017
- ```
+ ```shell
+ kubectl port-forward pods/mongo-75f59d57f4-4nd6q 28015:27017
+ ```
- or
+ or
- ```shell
- kubectl port-forward deployment/mongo 28015:27017
- ```
+ ```shell
+ kubectl port-forward deployment/mongo 28015:27017
+ ```
- or
+ or
- ```shell
- kubectl port-forward replicaset/mongo-75f59d57f4 28015:27017
- ```
+ ```shell
+ kubectl port-forward replicaset/mongo-75f59d57f4 28015:27017
+ ```
- or
+ or
- ```shell
- kubectl port-forward service/mongo 28015:27017
- ```
+ ```shell
+ kubectl port-forward service/mongo 28015:27017
+ ```
- Any of the above commands works. The output is similar to this:
+ Any of the above commands works. The output is similar to this:
- ```
- Forwarding from 127.0.0.1:28015 -> 27017
- Forwarding from [::1]:28015 -> 27017
- ```
+ ```
+ Forwarding from 127.0.0.1:28015 -> 27017
+ Forwarding from [::1]:28015 -> 27017
+ ```
-{{< note >}}
+ {{< note >}}
+ `kubectl port-forward` does not return. To continue with the exercises, you will need to open another terminal.
+ {{< /note >}}
-`kubectl port-forward` does not return. To continue with the exercises, you will need to open another terminal.
+2. Start the MongoDB command line interface:
-{{< /note >}}
+ ```shell
+ mongosh --port 28015
+ ```
-2. Start the MongoDB command line interface:
+3. At the MongoDB command line prompt, enter the `ping` command:
- ```shell
- mongosh --port 28015
- ```
+ ```
+ db.runCommand( { ping: 1 } )
+ ```
-3. At the MongoDB command line prompt, enter the `ping` command:
+ A successful ping request returns:
- ```
- db.runCommand( { ping: 1 } )
- ```
-
- A successful ping request returns:
-
- ```
- { ok: 1 }
- ```
+ ```
+ { ok: 1 }
+ ```
### Optionally let _kubectl_ choose the local port {#let-kubectl-choose-local-port}
@@ -204,7 +193,6 @@ Forwarding from 127.0.0.1:63753 -> 27017
Forwarding from [::1]:63753 -> 27017
```
-
## Discussion
@@ -219,9 +207,7 @@ The support for UDP protocol is tracked in
[issue 47862](https://github.com/kubernetes/kubernetes/issues/47862).
{{< /note >}}
-
-
-
## {{% heading "whatsnext" %}}
Learn more about [kubectl port-forward](/docs/reference/generated/kubectl/kubectl-commands/#port-forward).
+
From 65dbc312c73cbe7873dd63aac60d9c2d0198052c Mon Sep 17 00:00:00 2001
From: Shabir Mohamed Abdul Samadh
<7249208+Shabirmean@users.noreply.github.com>
Date: Wed, 27 Apr 2022 18:30:27 -0400
Subject: [PATCH 014/245] doc: adopt PR comment suggestion
---
content/en/docs/concepts/services-networking/service.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md
index 571d5f2a0a..6d3312e204 100644
--- a/content/en/docs/concepts/services-networking/service.md
+++ b/content/en/docs/concepts/services-networking/service.md
@@ -205,7 +205,7 @@ The name of the Endpoints object must be a valid
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
When you create an [Endpoints](docs/reference/kubernetes-api/service-resources/endpoints-v1/)
-object for a Service, you set the name of the new Endpoints to be the same as the
+object for a Service, you set the name of the new Endpoints object to be the same as the
name of the Service.
{{< note >}}
From 9673cd2f7512f0238bbca0a7ce908e7f01682f8a Mon Sep 17 00:00:00 2001
From: Shabir Mohamed Abdul Samadh
<7249208+Shabirmean@users.noreply.github.com>
Date: Fri, 29 Apr 2022 10:25:28 -0400
Subject: [PATCH 015/245] doc: apply suggestions from code review
Co-authored-by: divya-mohan0209
---
content/en/docs/concepts/services-networking/service.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md
index 6d3312e204..5d2d72d0b1 100644
--- a/content/en/docs/concepts/services-networking/service.md
+++ b/content/en/docs/concepts/services-networking/service.md
@@ -205,8 +205,8 @@ The name of the Endpoints object must be a valid
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
When you create an [Endpoints](docs/reference/kubernetes-api/service-resources/endpoints-v1/)
-object for a Service, you set the name of the new Endpoints object to be the same as the
-name of the Service.
+object for a Service, you set the name of the new object to be the same as that
+of the Service.
{{< note >}}
The endpoint IPs _must not_ be: loopback (127.0.0.0/8 for IPv4, ::1/128 for IPv6), or
From 95257a2eddd1a9733dd622e3d97c28c2d0738f59 Mon Sep 17 00:00:00 2001
From: Qiming Teng
Date: Sat, 23 Apr 2022 16:56:15 +0800
Subject: [PATCH 016/245] Improve the linkchecker script
The linkchecker script is not working the same way as the `scripts/lsync.sh`.
- The path must start with '/docs'. This is not implied in any way.
- The language can be deduced if user provides a full path to a markdown
file, e.g. `content/en/docs/concepts/security/controlling-access.md`.
- The path parameter could use a positional argument for ease of use.
This PR improves the user experience for the tool.
---
scripts/linkchecker.py | 110 +++++++++++++++++++++++------------------
1 file changed, 63 insertions(+), 47 deletions(-)
diff --git a/scripts/linkchecker.py b/scripts/linkchecker.py
index 5bc63e1d7f..6dfd39b81e 100755
--- a/scripts/linkchecker.py
+++ b/scripts/linkchecker.py
@@ -1,13 +1,12 @@
#!/usr/bin/env python3
#
# This a link checker for Kubernetes documentation website.
-# - We cover the following cases for the language you provide via `-l`, which
-# defaults to 'en'.
-# - If the language specified is not English (`en`), we check if you are
-# actually using the localized links. For example, if you specify `zh` as
-# the language, and for link target `/docs/foo/bar`, we check if the English
-# version exists AND if the Chinese version exists as well. A checking record
-# is produced if the link can use the localized version.
+#
+# If the language to check is not English (`en`), we check if you are actually
+# using the localized links. For example, if you checking
+# `content/zh/docs/foo/bar`, we check if the English version exists AND if the
+# Chinese version exists as well. A checking record is produced if the link
+# can use the localized version.
#
# Usage: linkchecker.py -h
#
@@ -64,12 +63,16 @@ BAD_LINK_TYPES = {
C_RED = "\033[31m"
C_GREEN = "\033[32m"
C_YELLOW = "\033[33m"
-C_GRAY = "\033[90m"
+C_GRAY = "\033[90m"
C_CYAN = "\033[36m"
C_END = "\033[0m"
# Command line arguments shared across functions
ARGS = None
+# Command line parser
+PARSER = None
+# Language as parsed from the file path
+LANG = None
# Global result dictionary keyed by page examined
RESULT = {}
# Cached redirect entries
@@ -77,6 +80,7 @@ REDIRECTS = {}
# Cached anchors in target pages
ANCHORS = {}
+
def new_record(level, message, target):
"""Create new checking record.
@@ -89,7 +93,7 @@ def new_record(level, message, target):
global ARGS
# Skip info when verbose
- if ARGS.verbose == False and level == "INFO":
+ if ARGS.verbose is False and level == "INFO":
return None
result = None
@@ -98,9 +102,9 @@ def new_record(level, message, target):
else:
target = C_GRAY + target + C_END
if level == "INFO":
- result = target + ": " + C_GREEN + message + C_END
+ result = target + ": " + C_GREEN + message + C_END
elif level == "WARNING":
- result = target + ": " + C_YELLOW+ message + C_END
+ result = target + ": " + C_YELLOW + message + C_END
else: # default to error
result = target + ": " + C_RED + message + C_END
@@ -286,7 +290,7 @@ def check_target(page, anchor, target):
# link to English or localized page
if (target.startswith("/docs/") or
- target.startswith("/" + ARGS.lang + "/docs/")):
+ target.startswith("/" + LANG + "/docs/")):
# target is shared reference (kubectl or kubernetes-api?
if (target.find("/docs/reference/generated/kubectl/") >= 0 or
@@ -305,22 +309,22 @@ def check_target(page, anchor, target):
if ok:
# We do't do additional checks for English site even if it has
# links to a non-English page
- if ARGS.lang == "en":
+ if LANG == "en":
return None
# If we are already checking localized link, fine
- if target.startswith("/" + ARGS.lang + "/docs/"):
+ if target.startswith("/" + LANG + "/docs/"):
return None
# additional check for localization even if English target exists
- base = os.path.join(ROOT, "content", ARGS.lang)
+ base = os.path.join(ROOT, "content", LANG)
found = check_file_exists(base, target)
if not found:
# Still to be translated
return None
msg = ("Localized page detected, please append '/%s' to the target"
- % ARGS.lang)
- return new_record("ERROR", "Link not using localized page", target)
+ % LANG)
+ return new_record("ERROR", msg, target)
# taget might be a redirect entry
real_target = get_redirect(target)
@@ -333,15 +337,16 @@ def check_target(page, anchor, target):
msg = "Link may be wrong for the anchor [%s]" % anchor
return new_record("WARNING", msg, target)
-def check_anchor(target_page, anchor):
+
+def check_anchor(target, anchor):
"""Check if an anchor is defined in the target page
- :param target_page: The target page to check
+ :param target: The target page to check
:param anchor: Anchor string to find in the target page
"""
- if target_page not in ANCHORS:
+ if target not in ANCHORS:
try:
- with open(target_page, "r") as f:
+ with open(target, "r") as f:
data = f.readlines()
except Exception as ex:
print("[Error] failed in reading markdown file: " + str(ex))
@@ -351,8 +356,9 @@ def check_anchor(target_page, anchor):
regex1 = re.compile(anchor_pattern1)
anchor_pattern2 = r"{#(.*?)}"
regex2 = re.compile(anchor_pattern2)
- ANCHORS[target_page] = regex1.findall(content) + regex2.findall(content)
- return anchor in ANCHORS[target_page]
+ ANCHORS[target] = regex1.findall(content) + regex2.findall(content)
+ return anchor in ANCHORS[target]
+
def check_apiref_target(target, anchor):
"""Check a link to an API reference page.
@@ -360,7 +366,8 @@ def check_apiref_target(target, anchor):
:param target: The link target string to check
:param anchor: Anchor string from the content page
"""
- base = os.path.join(ROOT, "content", "en", "docs", "reference", "kubernetes-api")
+ base = os.path.join(ROOT, "content", "en", "docs", "reference",
+ "kubernetes-api")
ok = check_file_exists(base + "/", target)
if not ok:
return new_record("ERROR", "API reference page not found", target)
@@ -370,7 +377,9 @@ def check_apiref_target(target, anchor):
target_page = os.path.join(base, target)+".md"
if not check_anchor(target_page, anchor):
- return new_record("ERROR", "Anchor not found in API reference page", target+"#"+anchor)
+ return new_record("ERROR", "Anchor not found in API reference page",
+ target+"#"+anchor)
+
def validate_links(page):
"""Find and validate links on a content page.
@@ -398,8 +407,8 @@ def validate_links(page):
records.append(r)
# searches for pattern: {{< api-reference page="" anchor=""
- apiref_pattern = r"{{ *< *api-reference page=\"([^\"]*?)\" *anchor=\"(.*?)\""
- regex = re.compile(apiref_pattern)
+ apiref_re = r"{{ *< *api-reference page=\"([^\"]*?)\" *anchor=\"(.*?)\""
+ regex = re.compile(apiref_re)
matches = regex.findall(content)
for m in matches:
@@ -408,8 +417,8 @@ def validate_links(page):
records.append(r)
# searches for pattern: {{< api-reference page=""
- apiref_pattern = r"{{ *< *api-reference page=\"([^\"]*?)\""
- regex = re.compile(apiref_pattern)
+ apiref_re = r"{{ *< *api-reference page=\"([^\"]*?)\""
+ regex = re.compile(apiref_re)
matches = regex.findall(content)
for m in matches:
@@ -426,31 +435,38 @@ def parse_arguments():
Result is returned and saved into global variable ARGS.
"""
- parser = argparse.ArgumentParser(description="Links checker for docs.")
- parser.add_argument("-l", dest="lang", default="en", metavar="",
- help=("two letter language code, e.g. 'zh'. "
- "(default='en')"))
- parser.add_argument("-v", dest="verbose", action="store_true",
- help="switch on verbose level")
- parser.add_argument("-f", dest="filter", default="/docs/**/*.md",
- metavar="",
- help=("File pattern to scan, e.g. '/docs/foo.md'. "
- "(default='/docs/**/*.md')"))
- parser.add_argument("-n", "--no-color", action="store_true",
- help="Suppress colored printing.")
+ global PARSER
- return parser.parse_args()
+ PARSER = argparse.ArgumentParser(description="Links checker for docs.")
+ PARSER.add_argument("-v", dest="verbose", action="store_true",
+ help="switch on verbose level")
+ PARSER.add_argument("-n", "--no-color", action="store_true",
+ help="Suppress colored printing.")
+ PARSER.add_argument("-f", dest="filter", default="content/en/docs/**/*.md",
+ metavar="",
+ help=("File pattern to scan. "
+ "(default='content/en/docs/**/*.md')"))
+
+ return PARSER.parse_args()
def main():
"""The main entry of the program."""
- global ARGS, ROOT, REDIRECTS
+ global ARGS, ROOT, REDIRECTS, PARSER, LANG
ARGS = parse_arguments()
- print("Language: " + ARGS.lang)
ROOT = os.path.join(os.path.dirname(__file__), '..')
- content_dir = os.path.join(ROOT, 'content')
- lang_dir = os.path.join(content_dir, ARGS.lang)
+
+ print(ARGS.filter)
+ parts = ARGS.filter.split("/", 2)
+ if len(parts) != 3 or parts[0] != "content":
+ print("ERROR:\nPlease specify file pattern in the format "
+ "'content//', for example:\n"
+ "'content/zh/docs/concepts/**/*.md'\n")
+ PARSER.print_help()
+ sys.exit(-1)
+
+ LANG = parts[1]
# read redirects data
redirects_fn = os.path.join(ROOT, "static", "_redirects")
@@ -473,7 +489,7 @@ def main():
print("[Error] failed in reading redirects file: " + str(ex))
return
- folders = [f for f in glob.glob(lang_dir + ARGS.filter, recursive=True)]
+ folders = [f for f in glob.glob(ARGS.filter, recursive=True)]
for page in folders:
validate_links(page)
From 59fb0551406c964dbeca7fbf1df42744890c3920 Mon Sep 17 00:00:00 2001
From: Tim Bannister
Date: Fri, 13 May 2022 14:02:36 +0100
Subject: [PATCH 017/245] Update banner styles
Allow text to be any color, not just white. Leave white text as the
default.
---
assets/scss/_custom.scss | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss
index 1ebe8c81fa..db0263d991 100644
--- a/assets/scss/_custom.scss
+++ b/assets/scss/_custom.scss
@@ -634,12 +634,12 @@ body.td-documentation {
a {
color: inherit;
- border-bottom: 1px solid #fff;
+ text-decoration: underline;
}
a:hover {
color: inherit;
- border-bottom: none;
+ text-decoration: initial;
}
}
@@ -648,6 +648,9 @@ body.td-documentation {
}
#announcement {
+ // default background is blue; overrides are possible
+ color: #fff;
+
.announcement-main {
margin-left: auto;
margin-right: auto;
@@ -660,9 +663,8 @@ body.td-documentation {
}
- /* always white */
h1, h2, h3, h4, h5, h6, p * {
- color: #ffffff;
+ color: inherit; /* defaults to white */
background: transparent;
img.event-logo {
From 2663c19414da81f6b35ab1c8d8f419404a5fa9e8 Mon Sep 17 00:00:00 2001
From: song
Date: Sat, 14 May 2022 17:51:16 +0800
Subject: [PATCH 018/245] [zh] sync migrating-from-dockershim doc
Signed-off-by: song
---
.../migrating-from-dockershim/_index.md | 50 ++++-
...k-if-dockershim-deprecation-affects-you.md | 185 ------------------
.../find-out-runtime-you-use.md | 105 +++++++++-
3 files changed, 153 insertions(+), 187 deletions(-)
delete mode 100644 content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you.md
diff --git a/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/_index.md b/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/_index.md
index cdeaed150c..8b55a149c0 100644
--- a/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/_index.md
+++ b/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/_index.md
@@ -2,6 +2,7 @@
title: "从 dockershim 迁移"
weight: 10
content_type: task
+no_list: true
---
+Dockershim 在 Kubernetes v1.24 版本已经被移除。
+如果你集群内是通过 dockershim 使用 Docker 作为容器运行时,并希望 Kubernetes 升级到 v1.24,
+建议你迁移到其他容器运行时或使用其他方法以获得 Docker 引擎支持。
+
+
+你的集群中可以有不止一种类型的节点,尽管这不是常见的情况。
+
+下面这些任务可以帮助你完成迁移:
+
+* [检查弃用 Dockershim 对你的影响](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/)
+* [dockershim 迁移](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/)
+* [从 dockershim 迁移遥测和安全代理](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/)
+
+
+## 下一步
+
+* 查看[容器运行时](/zh/docs/setup/production-environment/container-runtimes/)了解可选的容器运行时。
+* [GitHub 问题](https://github.com/kubernetes/kubernetes/issues/106917)跟踪有关 dockershim 的弃用和删除的讨论。
+* 如果你发现与 dockershim 迁移相关的缺陷或其他技术问题,
+ 可以在 Kubernetes 项目[报告问题](https://github.com/kubernetes/kubernetes/issues/new/choose)。
+
\ No newline at end of file
diff --git a/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you.md b/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you.md
deleted file mode 100644
index 96132ad465..0000000000
--- a/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you.md
+++ /dev/null
@@ -1,185 +0,0 @@
----
-title: 检查弃用 Dockershim 对你的影响
-content_type: task
-weight: 20
----
-
-
-
-
-
-Kubernetes 的 `dockershim` 组件使得你可以把 Docker 用作 Kubernetes 的
-{{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}。
-在 Kubernetes v1.20 版本中,内建组件 `dockershim` 被[弃用](/zh/blog/2020/12/08/kubernetes-1-20-release-announcement/#dockershim-deprecation)。
-
-
-
-本页讲解你的集群把 Docker 用作容器运行时的运作机制,
-并提供使用 `dockershim` 时,它所扮演角色的详细信息,
-继而展示了一组操作,可用来检查弃用 `dockershim` 对你的工作负载是否有影响。
-
-
-## 检查你的应用是否依赖于 Docker {#find-docker-dependencies}
-
-
-即使你是通过 Docker 创建的应用容器,也不妨碍你在其他任何容器运行时上运行这些容器。
-这种使用 Docker 的方式并不构成对 Docker 作为一个容器运行时的依赖。
-
-
-当用了别的容器运行时之后,Docker 命令可能不工作,或者产生意外的输出。
-下面是判定你是否依赖于 Docker 的方法。
-
-
-1. 确认没有特权 Pod 执行 Docker 命令(如 `docker ps`)、重新启动 Docker
- 服务(如 `systemctl restart docker.service`)或修改 Docker 配置文件
- `/etc/docker/daemon.json`。
-2. 检查 Docker 配置文件(如 `/etc/docker/daemon.json`)中容器镜像仓库的镜像(mirror)站点设置。
- 这些配置通常需要针对不同容器运行时来重新设置。
-3. 检查确保在 Kubernetes 基础设施之外的节点上运行的脚本和应用程序没有执行 Docker 命令。
- 可能的情况如:
- - SSH 到节点排查故障;
- - 节点启动脚本;
- - 直接安装在节点上的监控和安全代理。
-4. 检查执行上述特权操作的第三方工具。详细操作请参考
- [从 dockershim 迁移遥测和安全代理](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents)。
-5. 确认没有对 dockershim 行为的间接依赖。这是一种极端情况,不太可能影响你的应用。
- 一些工具很可能被配置为使用了 Docker 特性,比如,基于特定指标发警报,
- 或者在故障排查指令的一个环节中搜索特定的日志信息。
- 如果你有此类配置的工具,需要在迁移之前,在测试集群上测试这类行为。
-
-
-## Docker 依赖详解 {#role-of-dockershim}
-
-
-[容器运行时](/zh/docs/concepts/containers/#container-runtimes)是一个软件,用来运行组成 Kubernetes Pod 的容器。
-Kubernetes 负责编排和调度 Pod;在每一个节点上,{{< glossary_tooltip text="kubelet" term_id="kubelet" >}}
-使用抽象的容器运行时接口,所以你可以任意选用兼容的容器运行时。
-
-
-在早期版本中,Kubernetes 提供的兼容性支持一个容器运行时:Docker。
-在 Kubernetes 发展历史中,集群运营人员希望采用更多的容器运行时。
-于是 CRI 被设计出来满足这类灵活性需要 - 而 kubelet 亦开始支持 CRI。
-然而,因为 Docker 在 CRI 规范创建之前就已经存在,Kubernetes 就创建了一个适配器组件 `dockershim`。
-dockershim 适配器允许 kubelet 与 Docker 交互,就好像 Docker 是一个 CRI 兼容的运行时一样。
-
-
-你可以阅读博文
-[Kubernetes 正式支持集成 Containerd](/zh/blog/2018/05/24/kubernetes-containerd-integration-goes-ga/)。
-
-
-
-
-
-切换到容器运行时 Containerd 可以消除掉中间环节。
-所有相同的容器都可由 Containerd 这类容器运行时来运行。
-但是现在,由于直接用容器运行时调度容器,它们对 Docker 是不可见的。
-因此,你以前用来检查这些容器的 Docker 工具或漂亮的 UI 都不再可用。
-
-
-你不能再使用 `docker ps` 或 `docker inspect` 命令来获取容器信息。
-由于你不能列出容器,因此你不能获取日志、停止容器,甚至不能通过 `docker exec` 在容器中执行命令。
-
-
-{{< note >}}
-如果你在用 Kubernetes 运行工作负载,最好通过 Kubernetes API 停止容器,
-而不是通过容器运行时来停止它们
-(此建议适用于所有容器运行时,不仅仅是针对 Docker)。
-{{< /note >}}
-
-
-你仍然可以下载镜像,或者用 `docker build` 命令创建它们。
-但用 Docker 创建、下载的镜像,对于容器运行时和 Kubernetes,均不可见。
-为了在 Kubernetes 中使用,需要把镜像推送(push)到某镜像仓库。
-
-
-## {{% heading "whatsnext" %}}
-
-- 阅读[从 dockershim 迁移](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/)以了解你的下一步工作
-- 阅读[dockershim 弃用常见问题解答](/zh/blog/2020/12/02/dockershim-faq/)文章了解更多信息。
\ No newline at end of file
diff --git a/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use.md b/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use.md
index 7a6f3c8df9..5c11ccc645 100644
--- a/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use.md
+++ b/content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use.md
@@ -55,16 +55,34 @@ kubectl get nodes -o wide
输出如下面所示。`CONTAINER-RUNTIME` 列给出容器运行时及其版本。
+对于 Docker Engine,输出类似于:
```none
-# For dockershim
NAME STATUS VERSION CONTAINER-RUNTIME
node-1 Ready v1.16.15 docker://19.3.1
node-2 Ready v1.16.15 docker://19.3.1
node-3 Ready v1.16.15 docker://19.3.1
```
+
+
+如果你的容器运行时显示为 Docker Engine,你仍然可能不会被 1.24 中 dockershim 的移除所影响。
+通过[检查运行时端点](#which-endpoint),可以查看你是否在使用 dockershim。
+如果你没有使用 dockershim,你就不会被影响。
+看下是否是使用的 dockershim,如何是 dockershim 则会受到在 Kubernetes 1.24 中移除 dockershim 的影响。
+反之则不会受到影响。
+
+对于 containerd,输出类似于这样:
```none
# For containerd
@@ -81,3 +99,88 @@ on [Container Runtimes](/docs/setup/production-environment/container-runtimes/)
你可以在[容器运行时](/zh/docs/setup/production-environment/container-runtimes/)
页面找到与容器运行时相关的更多信息。
+
+## 检查当前使用的运行时端点 {#which-endpoint}
+
+
+
+容器运行时使用 Unix Socket 与 kubelet 通信,这一通信使用基于 gRPC 框架的
+[CRI 协议](/zh/docs/concepts/architecture/cri/)。kubelet 扮演客户端,运行时扮演服务器端。
+在某些情况下,你可能想知道你的节点使用的是哪个 socket。
+如若集群是 Kubernetes 1.24 及以后的版本,
+或许你想知道当前运行时是否是使用 dockershim 的 Docker Engine。
+
+
+
+{{}}
+如果你的节点在通过 `cri-dockerd` 使用 Docker Engine,
+那么集群不会受到 Kubernetes 移除 dockershim 的影响。
+{{}}
+
+
+可以通过检查 kubelet 的参数得知当前使用的是哪个 socket。
+
+
+1. 查看 kubelet 进程的启动命令
+
+ ```
+ tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline
+ ```
+ 如有节点上没有 `tr` 或者 `pgrep`,就需要手动检查 kubelet 的启动命令
+
+
+2. 在命令的输出中,查找 `--container-runtime` 和 `--container-runtime-endpoint` 标志。
+
+ * 如果 Kubernetes 集群版本是 v1.23 或者更早的版本,并且这两个参数不存在,
+ 或者 `container-runtime` 标志值不是 `remote`,则你在通过 dockershim 套接字使用
+ Docker Engine。
+ 或者如果集群使用的 Docker engine 和 dockershim socket,则输出结果中 `--container-runtime` 不是 `remote`,
+ * 如果设置了 `--container-runtime-endpoint` 参数,查看套接字名称即可得知当前使用的运行时。
+ 如若套接字 `unix:///run/containerd/containerd.sock` 是 containerd 的端点。
+
+
+如果想将节点上的容器运行时从 Docker Engine 切换成 containerd,可在
+[Docker Engine 迁移到 containerd](zh/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd/)
+找到更多信息。或者,如果你想在 Kubernetes v1.24 及以后的版本仍使用 Docker Engine,
+可以安装 CRI 兼容的适配器实现,如 [`cri-dockerd`](https://github.com/Mirantis/cri-dockerd)。
+[`cri-dockerd`](https://github.com/Mirantis/cri-dockerd)。
\ No newline at end of file
From 33ee5309b62eeeb96734aa19851314e1d554a445 Mon Sep 17 00:00:00 2001
From: Jordan Liggitt
Date: Sat, 14 May 2022 14:11:24 -0400
Subject: [PATCH 019/245] Correct misstatement about finalizers making objects
read-only
---
.../_posts/2021-05-14-using-finalizers-to-control-deletion.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/blog/_posts/2021-05-14-using-finalizers-to-control-deletion.md b/content/en/blog/_posts/2021-05-14-using-finalizers-to-control-deletion.md
index a361c4d0be..c868b1bd5c 100644
--- a/content/en/blog/_posts/2021-05-14-using-finalizers-to-control-deletion.md
+++ b/content/en/blog/_posts/2021-05-14-using-finalizers-to-control-deletion.md
@@ -108,7 +108,7 @@ metadata:
uid: 93a37fed-23e3-45e8-b6ee-b2521db81638
```
-In short, what’s happened is that the object was updated, not deleted. That’s because Kubernetes saw that the object contained finalizers and put it into a read-only state. The deletion timestamp signals that the object can only be read, with the exception of removing the finalizer key updates. In other words, the deletion will not be complete until we edit the object and remove the finalizer.
+In short, what’s happened is that the object was updated, not deleted. That’s because Kubernetes saw that the object contained finalizers and blocked removal of the object from etcd. The deletion timestamp signals that deletion was requested, but the deletion will not be complete until we edit the object and remove the finalizer.
Here's a demonstration of using the `patch` command to remove finalizers. If we want to delete an object, we can simply patch it on the command line to remove the finalizers. In this way, the deletion that was running in the background will complete and the object will be deleted. When we attempt to `get` that configmap, it will be gone.
From 9bbaab5d0b8f577f7f9f7bd58b0576a61cf5a9f5 Mon Sep 17 00:00:00 2001
From: "xin.li"
Date: Tue, 26 Apr 2022 19:29:12 +0800
Subject: [PATCH 020/245] [zh] Create
kubernetes-api/authentication-resources/service-account-v1.md
Signed-off-by: xin.li
---
.../service-account-v1.md | 808 ++++++++++++++++++
1 file changed, 808 insertions(+)
create mode 100644 content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md
diff --git a/content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md b/content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md
new file mode 100644
index 0000000000..f306b2cf21
--- /dev/null
+++ b/content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md
@@ -0,0 +1,808 @@
+---
+api_metadata:
+ apiVersion: "v1"
+ import: "k8s.io/api/core/v1"
+ kind: "ServiceAccount"
+content_type: "api_reference"
+description: "ServiceAccount 将以下内容绑定在一起:1. 用户可以理解的名称,也可能是外围系统理解的身份标识 2. 可以验证和授权的主体 3. 一组 secret 。"
+title: "ServiceAccount"
+weight: 1
+auto_generated: true
+---
+
+
+
+
+
+`apiVersion: v1`
+
+`import "k8s.io/api/core/v1"`
+
+
+## ServiceAccount {#ServiceAccount}
+
+
+ServiceAccount 将以下内容绑定在一起:
+* 用户可以理解的名称,也可能是外围系统理解的身份标识
+* 可以验证和授权的主体
+* 一组 secret
+
+
+
+- **apiVersion**: v1
+
+
+- **kind**: ServiceAccount
+
+
+- **metadata** (}}">ObjectMeta)
+
+
+ 标准对象的元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+
+- **automountServiceAccountToken** (boolean)
+
+
+ AutomountServiceAccountToken 指示作为此服务帐户运行的 pod 是否应自动挂载 API 令牌,
+ 可以在 pod 级别覆盖。
+
+- **imagePullSecrets** ([]}}">LocalObjectReference)
+
+
+ imagePullSecrets 是对同一命名空间中 Secret 的引用列表,用于拉取引用此 ServiceAccount 的 Pod 中的任何镜像。
+ imagePullSecrets 与 Secrets 不同,因为 Secrets 可以挂载在 Pod 中,但 imagePullSecrets 只能由 kubelet 访问。
+ 更多信息:https://kubernetes.io/zh/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
+
+- **secrets** ([]}}">ObjectReference)
+
+
+ **补丁策略:基于键 `name` 合并**
+ Secrets 是允许使用此 ServiceAccount 运行的 Pod 使用的 Secret 列表。
+ 更多信息:https://kubernetes.io/zh/docs/concepts/configuration/secret
+
+## ServiceAccountList {#ServiceAccountList}
+
+
+ServiceAccountList 是 ServiceAccount 对象的列表
+
+
+
+- **apiVersion**: v1
+
+
+- **kind**: ServiceAccountList
+
+
+- **metadata** (}}">ListMeta)
+
+
+ 标准列表元数据, 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+
+
+- **items** ([]}}">ServiceAccount), 必需
+
+
+ ServiceAccount 列表,更多信息:https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-service-account/
+
+
+## 操作 {#Operations}
+
+
+
+
+### `get` 读取指定的 ServiceAccount
+
+#### HTTP 请求
+
+GET /api/v1/namespaces/{namespace}/serviceaccounts/{name}
+
+
+#### 参数
+
+
+- **name** (**位于路径中**): string, 必需
+
+
+ ServiceAccount 的名称
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">ServiceAccount): OK
+
+401: Unauthorized
+
+
+### `list` 列出或监控 ServiceAccount 类型的对象
+
+#### HTTP 请求
+
+GET /api/v1/namespaces/{namespace}/serviceaccounts
+
+
+#### 参数
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **allowWatchBookmarks** (**查询字符串**): boolean
+
+ }}">allowWatchBookmarks
+
+
+- **continue** (**查询字符串**): string
+
+ }}">continue
+
+
+- **fieldSelector** (**查询字符串**): string
+
+ }}">fieldSelector
+
+
+
+- **labelSelector** (**查询字符串**): string
+
+ }}">labelSelector
+
+
+
+- **limit** (*查询字符串*): integer
+
+ }}">limit
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+- **resourceVersion** (**查询字符串**): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (**查询字符串**): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (**查询字符串**): integer
+
+ }}">timeoutSeconds
+
+
+- **watch** (**查询字符串**): boolean
+
+ }}">watch
+
+
+#### 响应
+
+
+200 (}}">ServiceAccountList): OK
+
+401: Unauthorized
+
+
+### `list` 列出或监控 ServiceAccount 类型的对象
+
+#### HTTP 请求
+
+GET /api/v1/serviceaccounts
+
+
+#### 参数
+
+
+- **allowWatchBookmarks** (**查询字符串**): boolean
+
+ }}">allowWatchBookmarks
+
+
+- **continue** (**查询字符串**): string
+
+ }}">continue
+
+
+- **fieldSelector** (**查询字符串**): string
+
+ }}">fieldSelector
+
+
+
+- **labelSelector** (**查询字符串**): string
+
+ }}">labelSelector
+
+
+- **limit** (**查询字符串**): integer
+
+ }}">limit
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+- **resourceVersion** (**查询字符串**): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (**查询字符串**): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (**查询字符串**): integer
+
+ }}">timeoutSeconds
+
+
+- **watch** (**查询字符串**): boolean
+
+ }}">watch
+
+
+
+#### 响应
+
+200 (}}">ServiceAccountList): OK
+
+401: Unauthorized
+
+
+### `create` 创建一个 ServiceAccount
+
+#### HTTP 请求
+
+POST /api/v1/namespaces/{namespace}/serviceaccounts
+
+
+#### 参数
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **body**: }}">ServiceAccount,必需
+
+
+- **dryRun** (**查询字符串**): string
+
+ }}">dryRun
+
+
+- **fieldManager** (**查询字符串**): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (**查询字符串**): string
+
+ }}">fieldValidation
+
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+
+#### 响应
+
+200 (}}">ServiceAccount): OK
+
+201 (}}">ServiceAccount): Created
+
+202 (}}">ServiceAccount): Accepted
+
+401: Unauthorized
+
+
+`update` 替换指定的ServiceAccount
+
+#### HTTP 请求
+
+PUT /api/v1/namespaces/{namespace}/serviceaccounts/{name}
+
+
+#### 参数
+
+
+- **name** (**位于路径中**): string, required
+
+ name of the ServiceAccount
+
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **body**: }}">ServiceAccount,必需
+
+
+- **dryRun** (**查询字符串**): string
+
+ }}">dryRun
+
+
+- **fieldManager** (**查询字符串**): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (**查询字符串**): string
+
+ }}">fieldValidation
+
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">ServiceAccount): OK
+
+201 (}}">ServiceAccount): Created
+
+401: Unauthorized
+
+
+`patch` 部分更新指定的 ServiceAccount
+
+#### HTTP 请求
+
+PATCH /api/v1/namespaces/{namespace}/serviceaccounts/{name}
+
+
+#### 参数
+
+
+- **name** (**位于路径中**): string, 必需
+
+
+ ServiceAccount 的名称
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **body**: }}">Patch, required
+
+
+
+- **dryRun** (**查询字符串**): string
+
+ }}">dryRun
+
+
+- **fieldManager** (**查询字符串**): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (**查询字符串**): string
+
+ }}">fieldValidation
+
+
+- **force** (**查询字符串**): boolean
+
+ }}">force
+
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+
+#### 响应
+
+
+200 (}}">ServiceAccount): OK
+
+201 (}}">ServiceAccount): Created
+
+401: Unauthorized
+
+
+### `delete` 删除一个 ServiceAccount
+#### HTTP 请求
+
+
+DELETE /api/v1/namespaces/{namespace}/serviceaccounts/{name}
+
+
+#### 参数
+
+
+- **name** (**位于路径中**): string, 必需
+
+
+ ServiceAccount 的名称
+
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **body**: }}">DeleteOptions
+
+
+- **dryRun** (**查询字符串**): string
+
+ }}">dryRun
+
+
+- **gracePeriodSeconds** (*查询字符串*): integer
+
+ }}">gracePeriodSeconds
+
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+- **propagationPolicy** (*in query*): string
+
+ }}">propagationPolicy
+
+
+
+#### 响应
+
+200 (}}">ServiceAccount): OK
+
+202 (}}">ServiceAccount): Accepted
+
+401: Unauthorized
+
+
+### `deletecollection` 删除 ServiceAccount 的集合
+
+#### HTTP 请求
+
+DELETE /api/v1/namespaces/{namespace}/serviceaccounts
+
+
+#### 参数
+
+
+- **namespace** (**位于路径中**): string, 必需
+
+ }}">namespace
+
+
+- **body**: }}">DeleteOptions
+
+
+- **continue** (**查询字符串**): string
+
+ }}">continue
+
+
+
+- **dryRun** (**查询字符串**): string
+
+ }}">dryRun
+
+
+- **fieldSelector** (**查询字符串**): string
+
+ }}">fieldSelector
+
+
+
+- **gracePeriodSeconds** (*查询字符串*): integer
+
+ }}">gracePeriodSeconds
+
+
+- **labelSelector** (*查询字符串*): string
+
+ }}">labelSelector
+
+
+- **limit** (*查询字符串*): integer
+
+ }}">limit
+
+
+
+- **pretty** (**查询字符串**): string
+
+ }}">pretty
+
+
+- **propagationPolicy** (**查询字符串**): string
+
+ }}">propagationPolicy
+
+
+- **resourceVersion** (**查询字符串**): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (**查询字符串**): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (**查询字符串**): integer
+
+ }}">timeoutSeconds
+
+
+
+#### 响应
+
+200 (}}">Status): OK
+
+401: Unauthorized
+
From 50b706eb60167150969c928962c90df3831a4ab4 Mon Sep 17 00:00:00 2001
From: Sean
Date: Mon, 16 May 2022 13:57:11 +0800
Subject: [PATCH 021/245] [id] Fix `Kubernetes` typo
---
content/id/docs/concepts/workloads/pods/disruptions.md | 2 +-
.../tutorials/kubernetes-basics/explore/explore-intro.html | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/content/id/docs/concepts/workloads/pods/disruptions.md b/content/id/docs/concepts/workloads/pods/disruptions.md
index 7a09eed3a5..f466bc6300 100644
--- a/content/id/docs/concepts/workloads/pods/disruptions.md
+++ b/content/id/docs/concepts/workloads/pods/disruptions.md
@@ -67,7 +67,7 @@ Kubernetes menawarkan fitur-fitur untuk membantu menjalankan aplikasi-aplikasi d
Pemilik aplikasi dapat membuat objek `PodDisruptionBudget` (PDB) untuk setiap aplikasi. Sebuah PDB membatasi jumlah Pod yang boleh mati secara bersamaan pada aplikasi yang direplikasi dikarenakan disrupsi yang disengaja.
Misalnya, sebuah aplikasi yang bekerja secara _quorum_ mau memastikan bahwa jumlah replika yang berjalan tidak jatuh ke bawah yang dibutuhkan untuk membentuk sebuah _quorum_. Contoh lainnya, sebuah _front-end_ web mungkin perlu memastikan bahwa jumlah replika yang melayani trafik tidak pernah turun ke total persentase yang telah ditentukan.
-Administrator klaster dan penyedia layanan Kubernetes sebaiknya menggunakan alat-alat yang menghormati PDB dengan cara berkomunikasi dengan [Eviction API](/docs/tasks/administer-cluster/safely-drain-node/#the-eviction-api) dari pada menghapus Pod atau Deployment secara langsung. Contohnya adalah perintah `kubectl drain` dan skrip pembaruan Kubernets-on-GCE (`cluster/gce/upgrade.sh`)
+Administrator klaster dan penyedia layanan Kubernetes sebaiknya menggunakan alat-alat yang menghormati PDB dengan cara berkomunikasi dengan [Eviction API](/docs/tasks/administer-cluster/safely-drain-node/#the-eviction-api) dari pada menghapus Pod atau Deployment secara langsung. Contohnya adalah perintah `kubectl drain` dan skrip pembaruan Kubernetes-on-GCE (`cluster/gce/upgrade.sh`)
Saat seorang administrator klaster ingin melakukan _drain_ terhadap sebuah node, ia akan menggunakan perintah `kubectl drain`. Alat tersebut mencoba untuk "mengusir" semua Pod di node tersebut. Permintaan untuk mengusir Pod tersebut mungkin ditolak untuk sementara, dan alat tersebut akan mencoba ulang permintaannya secara periodik hingga semua Pod dihapus, atau hingga batas waktu yang ditentukan telah dicapai.
diff --git a/content/id/docs/tutorials/kubernetes-basics/explore/explore-intro.html b/content/id/docs/tutorials/kubernetes-basics/explore/explore-intro.html
index a6381b3275..1b3b494b1a 100644
--- a/content/id/docs/tutorials/kubernetes-basics/explore/explore-intro.html
+++ b/content/id/docs/tutorials/kubernetes-basics/explore/explore-intro.html
@@ -76,9 +76,9 @@ weight: 10
Node
Sebuah Pod selalu berjalan dalam sebuah Node. Node merupakan sebuah mesin pekerja (worker) di Kubernetes dan mungkin merupakan mesin virtual ataupun fisik, tergantung dari klaster. Tiap Node dikelola oleh control plane. Satu Node dapat memiliki beberapa Pod, dan control plane Kubernetes yang otomatis menangani penjadwalan pod seluruh Node-Node dalam klaster. Penjadwalan otomatis oleh control plane memperhitungkan tersedianya sumber daya tiap Node.
-
Tiap Node Kuberbetes menjalankan setidaknya:
+
Tiap Node Kubernetes menjalankan setidaknya:
-
Kubelet, satu proses yang bertanggung jawab untuk berkomunikasi antara control plane Kuberneter dan Node; ini juga mengelola Pod-Pod dan kontainer-kontainer yang berjalan di sebuah mesin.
+
Kubelet, satu proses yang bertanggung jawab untuk berkomunikasi antara control plane Kubernetes dan Node; ini juga mengelola Pod-Pod dan kontainer-kontainer yang berjalan di sebuah mesin.
Satu container runtime, seperti Docker, bertanggung jawab untuk menarik image kontainer dari register, membuka kontainer, dan menjalankan aplikasi.
From 6960097befe155b79f2d53d647e8d2d1e80a24f7 Mon Sep 17 00:00:00 2001
From: Abirdcfly
Date: Mon, 16 May 2022 00:19:56 +0800
Subject: [PATCH 022/245] [zh] sync custom-resource-definitions.md
Signed-off-by: Abirdcfly
Co-authored-by: Qiming Teng
---
.../custom-resource-definitions.md | 799 +++++++++++++++++-
1 file changed, 791 insertions(+), 8 deletions(-)
diff --git a/content/zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md b/content/zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md
index 76ac25c924..0f60c649f1 100644
--- a/content/zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md
+++ b/content/zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md
@@ -546,7 +546,7 @@ resource definitions to:
* 裁剪未启用。
* 可以存储任意数据。
-为了与 `apiextensions.k8s.io/v1` 兼容,将你的自定义资源定义更新为:
+为了与 `apiextensions.k8s.io/v1` 兼容,将你的定制资源定义更新为:
1. 使用结构化的 OpenAPI 模式。
2. `spec.preserveUnknownFields` 设置为 `false`。
@@ -902,15 +902,16 @@ Kubernetes 会最终删除该资源,
### Validation
Custom resources are validated via
-[OpenAPI v3 schemas](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject)
-and you can add additional validation using
+[OpenAPI v3 schemas](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject),
+by x-kubernetes-validations when the [Validation Rules feature](#validation-rules) is enabled, and you
+can add additional validation using
[admission webhooks](/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook).
-->
### 合法性检查 {#validation}
定制资源是通过
[OpenAPI v3 模式定义](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject)
-来执行合法性检查的,
+来执行合法性检查的,当启用[验证规则特性](#validation-rules)时,通过 `x-kubernetes-validations` 验证,
你可以通过使用[准入控制 Webhook](/zh/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook)
来添加额外的合法性检查逻辑。
@@ -949,6 +950,16 @@ Additionally, the following restrictions are applied to the schema:
- 字段 `additionalProperties` 不可设置为 `false`
- 字段 `additionalProperties` 与 `properties` 互斥,不可同时使用
+
+当[验证规则特性](#validation-rules)被启用并且 CustomResourceDefinition
+模式是一个[结构化的模式定义](#specifying-a-structural-schema)时,
+`x-kubernetes-validations` 扩展可以使用[通用表达式语言(CEL)](https://github.com/google/cel-spec)表达式来验证定制资源。
+
+## 验证规则
+
+{{< feature-state state="alpha" for_k8s_version="v1.23" >}}
+
+
+验证规则从 1.23 开始处于 Alpha 状态,
+当 `CustomResourceValidationExpressions` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)被启用时,
+验证定制资源。这个功能只有在模式是[结构化的模式](#specifying-a-structural-schema)时才可用。
+
+
+验证规则使用[通用表达式语言(CEL)](https://github.com/google/cel-spec)来验证定制资源的值。
+验证规则使用 `x-kubernetes-validations` 扩展包含在 `CustomResourceDefinition` 模式定义中。
+
+
+规则的作用域是模式定义中 `x-kubernetes-validations` 扩展所在的位置。
+CEL 表达式中的 `self` 变量被绑定到限定作用域的取值。
+
+
+所有验证规则都是针对当前对象的:不支持跨对象或有状态的验证规则。
+
+
+例如:
+
+```yaml
+ ...
+ openAPIV3Schema:
+ type: object
+ properties:
+ spec:
+ type: object
+ x-kubernetes-validations:
+ - rule: "self.minReplicas <= self.replicas"
+ message: "replicas should be greater than or equal to minReplicas."
+ - rule: "self.replicas <= self.maxReplicas"
+ message: "replicas should be smaller than or equal to maxReplicas."
+ properties:
+ ...
+ minReplicas:
+ type: integer
+ replicas:
+ type: integer
+ maxReplicas:
+ type: integer
+ required:
+ - minReplicas
+ - replicas
+ - maxReplicas
+```
+
+
+将拒绝创建这个定制资源的请求:
+
+```yaml
+apiVersion: "stable.example.com/v1"
+kind: CronTab
+metadata:
+ name: my-new-cron-object
+spec:
+ minReplicas: 0
+ replicas: 20
+ maxReplicas: 10
+```
+
+
+返回响应为:
+
+```
+The CronTab "my-new-cron-object" is invalid:
+* spec: Invalid value: map[string]interface {}{"maxReplicas":10, "minReplicas":0, "replicas":20}: replicas should be smaller than or equal to maxReplicas.
+```
+
+
+`x-kubernetes-validations` 可以有多条规则。
+
+`x-kubernetes-validations` 下的 `rule` 代表将由 CEL 评估的表达式。
+
+`message` 代表验证失败时显示的信息。如果消息没有设置,上述响应将是:
+```
+The CronTab "my-new-cron-object" is invalid:
+* spec: Invalid value: map[string]interface {}{"maxReplicas":10, "minReplicas":0, "replicas":20}: failed rule: self.replicas <= self.maxReplicas
+```
+
+
+当 CRD 被创建/更新时,验证规则被编译。
+如果验证规则的编译失败,CRD 的创建/更新请求将失败。
+编译过程也包括类型检查。
+
+
+编译失败:
+- `no_matching_overload`:此函数没有参数类型的重载。
+
+ 例如,像 `self == true` 这样的规则对一个整数类型的字段将得到错误:
+ ```
+ Invalid value: apiextensions.ValidationRule{Rule:"self == true", Message:""}: compilation failed: ERROR: \:1:6: found no matching overload for '_==_' applied to '(int, bool)'
+ ```
+
+- `no_such_field`:不包含所需的字段。
+ 例如,针对一个不存在的字段,像 `self.nonExistingField > 0` 这样的规则将返回错误:
+ ```
+ Invalid value: apiextensions.ValidationRule{Rule:"self.nonExistingField > 0", Message:""}: compilation failed: ERROR: \:1:5: undefined field 'nonExistingField'
+ ```
+
+- `invalid argument`:对宏的无效参数。
+ 例如,像 `has(self)` 这样的规则将返回错误:
+ ```
+ Invalid value: apiextensions.ValidationRule{Rule:"has(self)", Message:""}: compilation failed: ERROR: :1:4: invalid argument to has() macro
+ ```
+
+
+
+验证规则例子:
+
+| 规则 | 目的 |
+| ---------------- | ------------ |
+| `self.minReplicas <= self.replicas && self.replicas <= self.maxReplicas` | 验证定义副本数的三个字段大小顺序是否正确 |
+| `'Available' in self.stateCounts` | 验证 map 中是否存在键名为 `Available`的条目 |
+| `(size(self.list1) == 0) != (size(self.list2) == 0)` | 验证两个 list 之一是非空的,但不是二者都非空 |
+| !('MY_KEY' in self.map1) || self['MY_KEY'].matches('^[a-zA-Z]*$') | 如果某个特定的 key 在 map 中,验证 map 中这个 key 的 value |
+| `self.envars.filter(e, e.name = 'MY_ENV').all(e, e.value.matches('^[a-zA-Z]*$')` | 验证一个 listMap 中主键 'name' 为 'MY_ENV' 'value' 的表项,检查其取值 'value' |
+| `has(self.expired) && self.created + self.ttl < self.expired` | 验证 'Expired' 日期是否晚于 'Create' 日期加上 'ttl' 持续时间 |
+| `self.health.startsWith('ok')` | 验证 'health' 字符串字段有前缀 'ok' |
+| `self.widgets.exists(w, w.key == 'x' && w.foo < 10)` | 验证 key 为 'x' 的 listMap 项的 'foo' 属性是否小于 10 |
+| `type(self) == string ? self == '100%' : self == 1000` | 在 int 型和 string 型两种情况下验证 int-or-string 字段 |
+| `self.metadata.name.startsWith(self.prefix)` | 验证对象的名称是否具有另一个字段值的前缀 |
+| `self.set1.all(e, !(e in self.set2))` | 验证两个 listSet 是否不相交 |
+| `size(self.names) == size(self.details) && self.names.all(n, n in self.details)` | 验证 'details' map 是由 'names' listSet 的项目所决定的。 |
+
+参考:[CEL 中支持的求值](https://github.com/google/cel-spec/blob/v0.6.0/doc/langdef.md#evaluation)
+
+
+
+- 如果规则的作用域是某资源的根,则它可以对 CRD 的 OpenAPIv3 模式表达式中声明的任何字段进行字段选择,
+ 以及 `apiVersion`、`kind`、`metadata.name` 和 `metadata.generateName`。
+ 这包括在同一表达式中对 `spec` 和 `status` 的字段进行选择:
+ ```yaml
+ ...
+ openAPIV3Schema:
+ type: object
+ x-kubernetes-validations:
+ - rule: "self.status.availableReplicas >= self.spec.minReplicas"
+ properties:
+ spec:
+ type: object
+ properties:
+ minReplicas:
+ type: integer
+ ...
+ status:
+ type: object
+ properties:
+ availableReplicas:
+ type: integer
+ ```
+
+
+- 如果规则的作用域是具有属性的对象,那么可以通过 `self.field` 对该对象的可访问属性进行字段选择,
+ 而字段存在与否可以通过 `has(self.field)` 来检查。
+ 在 CEL 表达式中,Null 值的字段被视为不存在的字段。
+
+ ```yaml
+ ...
+ openAPIV3Schema:
+ type: object
+ properties:
+ spec:
+ type: object
+ x-kubernetes-validations:
+ - rule: "has(self.foo)"
+ properties:
+ ...
+ foo:
+ type: integer
+ ```
+
+
+- 如果规则的作用域是一个带有 additionalProperties 的对象(即map),那么 map 的值
+ 可以通过 `self[mapKey]` 访问,map 的包含性可以通过 `mapKey in self` 检查,
+ map 中的所有条目可以通过 CEL 宏和函数如 `self.all(...)` 访问。
+ ```yaml
+ ...
+ openAPIV3Schema:
+ type: object
+ properties:
+ spec:
+ type: object
+ x-kubernetes-validations:
+ - rule: "self['xyz'].foo > 0"
+ additionalProperties:
+ ...
+ type: object
+ properties:
+ foo:
+ type: integer
+ ```
+
+
+- 如果规则的作用域是 array,则 array 的元素可以通过 `self[i]` 访问,也可以通过宏和函数访问。
+ ```yaml
+ ...
+ openAPIV3Schema:
+ type: object
+ properties:
+ ...
+ foo:
+ type: array
+ x-kubernetes-validations:
+ - rule: "size(self) == 1"
+ items:
+ type: string
+ ```
+
+
+- 如果规则的作用域为标量,则 `self` 将绑定到标量值。
+ ```yaml
+ ...
+ openAPIV3Schema:
+ type: object
+ properties:
+ spec:
+ type: object
+ properties:
+ ...
+ foo:
+ type: integer
+ x-kubernetes-validations:
+ - rule: "self > 0"
+ ```
+
+例子:
+
+| 规则作用域字段类型 | 规则示例 |
+| -----------------------| -----------------------|
+| 根对象 | `self.status.actual <= self.spec.maxDesired`|
+| 对象映射 | `self.components['Widget'].priority < 10`|
+| 整数列表 | `self.values.all(value, value >= 0 && value < 100)`|
+| 字符串 | `self.startsWith('kube')`|
+
+
+
+`apiVersion`、`kind``metadata.name` 和 `metadata.generateName` 始终可以从对象的根目录和任何
+带有 `x-kubernetes-embedded-resource` 注解的对象访问。
+其他元数据属性都不可访问。
+
+
+通过 `x-kubernetes-preserve-unknown-fields` 保存在定制资源中的未知数据在 CEL 表达中无法访问。
+这包括:
+ - 使用 `x-kubernetes-preserve-unknown-fields` 的对象模式保留的未知字段值。
+ - 属性模式为"未知类型(Unknown Type)"的对象属性。一个"未知类型"被递归定义为:
+ - 一个没有类型的模式,`x-kubernetes-preserve-unknown-fields` 设置为 true。
+ - 一个数组,其中项目模式为"未知类型"
+ - 一个 additionalProperties 模式为"未知类型"的对象
+
+
+
+只有 `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` 形式的属性名是可访问的。
+当在表达式中访问时,可访问的属性名称会根据以下规则进行转义:
+
+
+| 转义序列 | 属性名称等效为 |
+| ----------------------- | ----------------------|
+| `__underscores__` | `__` |
+| `__dot__` | `.` |
+|`__dash__` | `-` |
+| `__slash__` | `/` |
+| `__{keyword}__` | [CEL 保留关键字](https://github.com/google/cel-spec/blob/v0.6.0/doc/langdef.md#syntax) |
+
+
+注意:CEL 保留关键字需要与要转义的确切属性名匹配(例如,单词 `sprint` 中的 `int` 不会转义)。
+
+
+转义的例子:
+
+
+|属性名 | 转义属性名规则 |
+| ----------------| ----------------------- |
+| namespace | `self.__namespace__ > 0` |
+| x-prop | `self.x__dash__prop > 0` |
+| redact__d | `self.redact__underscores__d > 0` |
+| string | `self.startsWith('kube')` |
+
+
+
+`set` 或 `map` 的 `x-Kubernetes-list-type` 的数组的等值比较会忽略元素顺序,即[1,2] == [2,1]。
+使用 `x-kubernetes-list-type` 对数组进行串联时,使用 List 类型的语义:
+- `set`:`X + Y` 执行一个并集操作,其中 `X` 中所有元素的数组位置被保留,
+ `Y` 中不相交的元素被追加,保留其部分顺序。
+- `map`:`X + Y`执行合并,其中 `X` 中所有键的数组位置被保留,
+ 但当 `X` 和 `Y` 的键集相交时,其值被 `Y` 中的值覆盖。
+ `Y` 中键值不相交的元素被附加,保留其部分顺序。
+
+
+
+以下是 OpenAPIV3 和 CEL 类型之间的声明类型映射:
+
+
+| OpenAPIv3 类型 | CEL 类型 |
+| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| 带有 Properties 的对象 | 对象 / "消息类型" |
+| 带有 AdditionalProperties 的对象 | map |
+| 带有 x-kubernetes-embedded-type 的对象 | 对象 / "消息类型",'apiVersion'、'kind'、'metadata.name' 和 'metadata.generateName' 都隐式包含在模式中 |
+| 带有 x-kubernetes-preserve-unknown-fields 的对象 | 对象 / "消息类型",未知字段无法从 CEL 表达式中访问 |
+| x-kubernetes-int-or-string | 可能是整数或字符串的动态对象,可以用 `type(value)` 来检查类型 |
+| 数组 | list |
+| 带有 x-kubernetes-list-type=map 的数组 | 列表,基于集合等值和唯一键名保证的 map 组成 |
+| 带有 x-kubernetes-list-type=set 的数组 | 列表,基于集合等值和唯一键名保证的 set 组成 |
+| 布尔值 | boolean |
+| 数字 (各种格式) | double |
+| 整数 (各种格式) | int (64) |
+| 'null' | null_type |
+| 字符串 | string |
+| 带有 format=byte (base64 编码)字符串 | bytes |
+| 带有 format=date 字符串 | timestamp (google.protobuf.Timestamp) |
+| 带有 format=datetime 字符串 | timestamp (google.protobuf.Timestamp) |
+| 带有 format=duration 字符串 | duration (google.protobuf.Duration) |
+
+
+参考:[CEL 类型](https://github.com/google/cel-spec/blob/v0.6.0/doc/langdef.md#values),
+[OpenAPI 类型](https://swagger.io/specification/#data-types),
+[Kubernetes 结构化模式](/zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema)。
+
+
+#### 验证函数 {#available-validation-functions}
+
+
+可用的函数包括:
+ - CEL 标准函数,在[标准定义列表](https://github.com/google/cel-spec/blob/v0.7.0/doc/langdef.md#list-of-standard-definitions)中定义
+ - CEL 标准[宏](https://github.com/google/cel-spec/blob/v0.7.0/doc/langdef.md#macros)
+ - CEL [扩展字符串函数库](https://pkg.go.dev/github.com/google/cel-go@v0.11.2/ext#Strings)
+ - Kubernetes [CEL 扩展库](https://pkg.go.dev/k8s.io/apiextensions-apiserver@v0.24.0/pkg/apiserver/schema/cel/library#pkg-functions)
+
+
+#### 转换规则
+
+
+包含引用标识符 `oldSself` 的表达式的规则被隐式视为“转换规则(Transition Rule)”。
+转换规则允许模式作者阻止两个原本有效的状态之间的某些转换。例如:
+
+```yaml
+type: string
+enum: ["low", "medium", "high"]
+x-kubernetes-validations:
+- rule: "!(self == 'high' && oldSelf == 'low') && !(self == 'low' && oldSelf == 'high')"
+ message: cannot transition directly between 'low' and 'high'
+```
+
+
+与其他规则不同,转换规则仅适用于满足以下条件的操作:
+
+
+- 更新现有对象的操作。转换规则从不适用于创建操作。
+
+
+- 旧的值和新的值都存在。仍然可以通过在父节点上放置转换规则来检查值是否已被添加或移除。
+ 转换规则从不应用于定制资源创建。当被放置在可选字段上时,转换规则将不适用于设置或取消设置该字段的更新操作。
+
+
+- 被转换规则验证的模式节点的路径必须解析到一个在旧对象和新对象之间具有可比性的节点。
+ 例如,列表项和它们的后代(`spec.foo[10].bar`)不一定能在现有对象和后来对同一对象的更新之间产生关联。
+
+
+如果一个模式节点包含一个永远不能应用的转换规则,在 CRD 写入时将会产生错误,例如:
+"*path*: update rule *rule* cannot be set on schema because the schema or its parent
+schema is not mergeable"。
+
+
+转换规则只允许在模式的“可关联部分(Correlatable Portions)”中使用。
+如果所有 `array` 父模式都是 `x-kubernetes-list-type=map`类型的,那么该模式的一部分就是可关联的;
+任何 `set` 或者 `atomic` 数组父模式都不支持确定性地将 `self` 与 `oldSelf` 关联起来。
+
+
+这是一些转换规则的例子:
+
+
+{{< table caption="转换规则样例" >}}
+| 用例 | 规则
+| -------- | --------
+| 不可变 | `self.foo == oldSelf.foo`
+| 赋值后禁止修改/删除 | `oldSelf != 'bar' \|\| self == 'bar'` or `!has(oldSelf.field) \|\| has(self.field)`
+| 仅附加的 set | `self.all(element, element in oldSelf)`
+| 如果之前的值为 X,则新值只能为 A 或 B,不能为 Y 或 Z | `oldSelf != 'X' \|\| self in ['A', 'B']`
+| 单调(非递减)计数器 | `self >= oldSelf`
+{{< /table >}}
+
+
+#### 验证函数的资源使用
+
+
+当你创建或更新一个使用验证规则的 CustomResourceDefinition 时,
+API 服务器会检查运行这些验证规则可能产生的影响。
+如果一个规则的执行成本过高,API 服务器会拒绝创建或更新操作,并返回一个错误信息。
+
+运行时也使用类似的系统来观察解释器的行动。如果解释器执行了太多的指令,规则的执行将被停止,并且会产生一个错误。
+
+每个 CustomResourceDefinition 也被允许有一定数量的资源来完成其所有验证规则的执行。
+如果在创建时估计其规则的总和超过了这个限制,那么也会发生验证错误。
+
+
+如果你只指定那些无论输入量有多大都要花费相同时间的规则,你不太可能遇到验证的资源预算问题。
+
+例如,一个断言 `self.foo == 1` 的规则本身不存在因为资源预算组验证而导致被拒绝的风险。
+
+但是,如果 `foo` 是一个字符串,而你定义了一个验证规则 `self.foo.contains("someString")`,
+这个规则需要更长的时间来执行,取决于 `foo` 有多长。
+
+另一个例子是如果 `foo` 是一个数组,而你指定了验证规则 `self.foo.all(x, x > 5)`。
+如果没有给出 `foo` 的长度限制,成本系统总是假设最坏的情况,这将发生在任何可以被迭代的事物上(list、map 等)。
+
+
+因此,通过 `maxItems`,`maxProperties` 和 `maxLength` 进行限制被认为是最佳实践,
+以在验证规则中处理任何内容,以防止在成本估算期间验证错误。例如,给定具有一个规则的模式:
+
+```yaml
+openAPIV3Schema:
+ type: object
+ properties:
+ foo:
+ type: array
+ items:
+ type: string
+ x-kubernetes-validations:
+ - rule: "self.all(x, x.contains('a string'))"
+```
+
+
+API 服务器以验证预算为由拒绝该规则,并显示错误:
+```
+ spec.validation.openAPIV3Schema.properties[spec].properties[foo].x-kubernetes-validations[0].rule: Forbidden:
+ CEL rule exceeded budget by more than 100x (try simplifying the rule, or adding maxItems, maxProperties, and
+ maxLength where arrays, maps, and strings are used)
+```
+
+
+这个拒绝会发生是因为 `self.all` 意味着对 `foo` 中的每一个字符串调用 `contains()`,
+而这又会检查给定的字符串是否包含 `'a string'`。如果没有限制,这是一个非常昂贵的规则。
+
+
+如果你不指定任何验证限制,这个规则的估计成本将超过每条规则的成本限制。
+但如果你在适当的地方添加限制,该规则将被允许:
+
+```yaml
+openAPIV3Schema:
+ type: object
+ properties:
+ foo:
+ type: array
+ maxItems: 25
+ items:
+ type: string
+ maxLength: 10
+ x-kubernetes-validations:
+ - rule: "self.all(x, x.contains('a string'))"
+```
+
+
+成本评估系统除了考虑规则本身的估计成本外,还考虑到规则将被执行的次数。
+例如,下面这个规则的估计成本与前面的例子相同(尽管该规则现在被定义在单个数组项上):
+
+```yaml
+openAPIV3Schema:
+ type: object
+ properties:
+ foo:
+ type: array
+ maxItems: 25
+ items:
+ type: string
+ x-kubernetes-validations:
+ - rule: "self.contains('a string'))"
+ maxLength: 10
+```
+
+
+如果在一个列表内部的一个列表有一个使用 `self.all` 的验证规则,那就会比具有相同规则的非嵌套列表的成本高得多。
+一个在非嵌套列表中被允许的规则可能需要在两个嵌套列表中设置较低的限制才能被允许。
+例如,即使没有设置限制,下面的规则也是允许的:
+
+```yaml
+openAPIV3Schema:
+ type: object
+ properties:
+ foo:
+ type: array
+ items:
+ type: integer
+ x-kubernetes-validations:
+ - rule: "self.all(x, x == 5)"
+```
+
+
+但是同样的规则在下面的模式中(添加了一个嵌套数组)产生了一个验证错误:
+
+```yaml
+openAPIV3Schema:
+ type: object
+ properties:
+ foo:
+ type: array
+ items:
+ type: array
+ items:
+ type: integer
+ x-kubernetes-validations:
+ - rule: "self.all(x, x == 5)"
+```
+
+
+这是因为 `foo` 的每一项本身就是一个数组,而每一个子数组依次调用 `self.all`。
+在使用验证规则的地方,尽可能避免嵌套的列表和字典。
### 以 OpenAPI v2 形式发布合法性检查模式 {#publish-validation-schema-in-openapi-v2}
@@ -1308,9 +2093,7 @@ CustomResourceDefinition 的[结构化的](#specifying-a-structural-schema)、
[OpenAPI v2 规约](/zh/docs/concepts/overview/kubernetes-api/#openapi-and-swagger-definitions)
的一部分发布出来。
-[kubectl](/zh/docs/reference/kubectl/overview) 命令行工具会基于所发布的模式定义来执行
-客户端的合法性检查(`kubectl create` 和 `kubectl apply`),为定制资源的模式定义
-提供解释(`kubectl explain`)。
+[kubectl](/zh/docs/reference/kubectl/) 命令行工具会基于所发布的模式定义来执行客户端的合法性检查(`kubectl create` 和 `kubectl apply`),为定制资源的模式定义提供解释(`kubectl explain`)。
所发布的模式还可被用于其他目的,例如生成客户端或者生成文档。
-此页面展示如何配置和启用 ip-masq-agent。
+此页面展示如何配置和启用 `ip-masq-agent`。
## {{% heading "prerequisites" %}}
@@ -24,9 +24,9 @@ This page shows how to configure and enable the ip-masq-agent.
## IP Masquerade Agent 用户指南
-ip-masq-agent 配置 iptables 规则以隐藏位于集群节点 IP 地址后面的 Pod 的 IP 地址。
+`ip-masq-agent` 配置 iptables 规则以隐藏位于集群节点 IP 地址后面的 Pod 的 IP 地址。
这通常在将流量发送到集群的 Pod
[CIDR](https://zh.wikipedia.org/wiki/%E6%97%A0%E7%B1%BB%E5%88%AB%E5%9F%9F%E9%97%B4%E8%B7%AF%E7%94%B1)
范围之外的目的地时使用。
@@ -96,23 +96,26 @@ The agent configuration file must be written in YAML or JSON syntax, and may con
代理配置文件必须使用 YAML 或 JSON 语法编写,并且可能包含三个可选值:
-* **nonMasqueradeCIDRs:**
+* `nonMasqueradeCIDRs`:
[CIDR](https://zh.wikipedia.org/wiki/%E6%97%A0%E7%B1%BB%E5%88%AB%E5%9F%9F%E9%97%B4%E8%B7%AF%E7%94%B1)
表示法中的字符串列表,用于指定不需伪装的地址范围。
-* **masqLinkLocal:** 布尔值 (true / false),表示是否将流量伪装到
- 本地链路前缀 169.254.0.0/16。默认为 false。
+* `masqLinkLocal`:布尔值 (true/false),表示是否为本地链路前缀 169.254.0.0/16 的流量提供伪装。
+ 默认为 false。
-* **resyncInterval:** 代理尝试从磁盘重新加载配置的时间间隔。
- 例如 '30s',其中 's' 是秒,'ms' 是毫秒等...
+* `resyncInterval`:代理从磁盘重新加载配置的重试时间间隔。
+ 例如 '30s',其中 's' 是秒,'ms' 是毫秒。
-默认情况下,从 Kubernetes 1.7.0 版本开始的 GCE/Google Kubernetes Engine 中,
-如果启用了网络策略,或者你使用的集群 CIDR 不在 10.0.0.0/8 范围内,
-则 ip-masq-agent 将在你的集群中运行。
-如果你在其他环境中运行,则可以将 ip-masq-agent
-[DaemonSet](/zh/docs/concepts/workloads/controllers/daemonset/) 添加到你的集群:
+默认情况下,在 GCE/Google Kubernetes Engine 中,如果启用了网络策略,
+或者你使用的集群 CIDR 不在 10.0.0.0/8 范围内,
+则 `ip-masq-agent` 将在你的集群中运行。
+如果你在其他环境中运行,可以将 `ip-masq-agent`
+[DaemonSet](/zh/docs/concepts/workloads/controllers/daemonset/) 添加到你的集群中。
@@ -172,7 +182,7 @@ More information can be found in the ip-masq-agent documentation [here](https://
-在大多数情况下,默认的规则集应该足够;但是,如果你的群集不是这种情况,则可以创建并应用
+在大多数情况下,默认的规则集应该足够;但是,如果你的集群不是这种情况,则可以创建并应用
[ConfigMap](/zh/docs/tasks/configure-pod-container/configure-pod-configmap/)
来自定义受影响的 IP 范围。
例如,要允许 ip-masq-agent 仅作用于 10.0.0.0/8,你可以在一个名为 “config” 的文件中创建以下
@@ -180,12 +190,12 @@ In most cases, the default set of rules should be sufficient; however, if this i
{{< note >}}
重要的是,该文件之所以被称为 config,因为默认情况下,该文件将被用作
-ip-masq-agent 查找的主键:
+`ip-masq-agent` 查找的主键:
-```
+```yaml
nonMasqueradeCIDRs:
- 10.0.0.0/8
resyncInterval: 60s
@@ -195,22 +205,25 @@ resyncInterval: 60s
-运行以下命令将配置映射添加到你的集群:
+运行以下命令将 ConfigMap 添加到你的集群:
-```
+```shell
kubectl create configmap ip-masq-agent --from-file=config --namespace=kube-system
```
-这将更新位于 */etc/config/ip-masq-agent* 的一个文件,该文件以 *resyncInterval*
+这将更新位于 `/etc/config/ip-masq-agent` 的一个文件,该文件以 `resyncInterval`
为周期定期检查并应用于集群节点。
重新同步间隔到期后,你应该看到你的更改在 iptables 规则中体现:
-```
+```shell
iptables -t nat -L IP-MASQ-AGENT
+```
+
+```none
Chain IP-MASQ-AGENT (1 references)
target prot opt source destination
RETURN all -- anywhere 169.254.0.0/16 /* ip-masq-agent: cluster-local traffic should not be subject to MASQUERADE */ ADDRTYPE match dst-type !LOCAL
@@ -219,13 +232,13 @@ MASQUERADE all -- anywhere anywhere /* ip-masq-agent:
```
默认情况下,本地链路范围 (169.254.0.0/16) 也由 ip-masq agent 处理,
该代理设置适当的 iptables 规则。 要使 ip-masq-agent 忽略本地链路,
-可以在配置映射中将 *masqLinkLocal* 设置为 true。
+可以在 ConfigMap 中将 `masqLinkLocal` 设置为 true。
-```
+```yaml
nonMasqueradeCIDRs:
- 10.0.0.0/8
resyncInterval: 60s
diff --git a/content/zh/docs/tasks/administer-cluster/nodelocaldns.md b/content/zh/docs/tasks/administer-cluster/nodelocaldns.md
index b68fd3ed1e..acb02c6cfc 100644
--- a/content/zh/docs/tasks/administer-cluster/nodelocaldns.md
+++ b/content/zh/docs/tasks/administer-cluster/nodelocaldns.md
@@ -11,7 +11,9 @@ content_type: task
-->
+
{{< feature-state for_k8s_version="v1.18" state="stable" >}}
+
@@ -29,10 +31,17 @@ This page provides an overview of NodeLocal DNSCache feature in Kubernetes.
## 引言
NodeLocal DNSCache 通过在集群节点上作为 DaemonSet 运行 DNS 缓存代理来提高集群 DNS 性能。
-在当今的体系结构中,运行在 ClusterFirst DNS 模式下的 Pod 可以连接到 kube-dns `serviceIP` 进行 DNS 查询。
+在当今的体系结构中,运行在 'ClusterFirst' DNS 模式下的 Pod 可以连接到 kube-dns `serviceIP` 进行 DNS 查询。
通过 kube-proxy 添加的 iptables 规则将其转换为 kube-dns/CoreDNS 端点。
借助这种新架构,Pods 将可以访问在同一节点上运行的 DNS 缓存代理,从而避免 iptables DNAT 规则和连接跟踪。
本地缓存代理将查询 kube-dns 服务以获取集群主机名的缓存缺失(默认为 "`cluster.local`" 后缀)。
@@ -43,22 +52,29 @@ NodeLocal DNSCache 通过在集群节点上作为 DaemonSet 运行 DNS 缓存代
## 动机
* 使用当前的 DNS 体系结构,如果没有本地 kube-dns/CoreDNS 实例,则具有最高 DNS QPS
的 Pod 可能必须延伸到另一个节点。
在这种场景下,拥有本地缓存将有助于改善延迟。
* 跳过 iptables DNAT 和连接跟踪将有助于减少
[conntrack 竞争](https://github.com/kubernetes/kubernetes/issues/56903)
并避免 UDP DNS 条目填满 conntrack 表。
* 从本地缓存代理到 kube-dns 服务的连接可以升级为 TCP 。
TCP conntrack 条目将在连接关闭时被删除,相反 UDP 条目必须超时
@@ -66,14 +82,16 @@ Having a local cache will help improve the latency in such scenarios.
`nf_conntrack_udp_timeout` 是 30 秒)。
* 将 DNS 查询从 UDP 升级到 TCP 将减少由于被丢弃的 UDP 包和 DNS 超时而带来的尾部等待时间;
这类延时通常长达 30 秒(3 次重试 + 10 秒超时)。
由于 nodelocal 缓存监听 UDP DNS 查询,应用不需要变更。
* 在节点级别对 DNS 请求的度量和可见性。
@@ -101,8 +119,14 @@ This is the path followed by DNS Queries after NodeLocal DNSCache is enabled:
## Configuration
-->
## 配置
+
{{< note >}}
@@ -117,32 +141,40 @@ This feature can be enabled using the following steps:
可以使用以下步骤启动此功能:
* 根据示例 [`nodelocaldns.yaml`](https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml)
准备一个清单,把它保存为 `nodelocaldns.yaml`。
+
-* 如果使用 IPv6,在使用 IP:Port 格式的时候需要把 CoreDNS 配置文件里的所有 IPv6 地址用方括号包起来。
+* 如果使用 IPv6,在使用 'IP:Port' 格式的时候需要把 CoreDNS 配置文件里的所有 IPv6 地址用方括号包起来。
如果你使用上述的示例清单,需要把
[配置行 L70](https://github.com/kubernetes/kubernetes/blob/b2ecd1b3a3192fbbe2b9e348e095326f51dc43dd/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml#L70)
- 修改为 `health [__PILLAR__LOCAL__DNS__]:8080`。
+ 修改为: "`health [__PILLAR__LOCAL__DNS__]:8080`"。
+
* 把清单里的变量更改为正确的值:
- ```
+ ```shell
kubedns=`kubectl get svc kube-dns -n kube-system -o jsonpath={.spec.clusterIP}`
domain=
localdns=
@@ -152,15 +184,17 @@ If you are using the sample manifest from the previous point, this will require
NodeLocal DNSCache 选择的本地侦听 IP 地址。
+ `__PILLAR__CLUSTER__DNS__` and `__PILLAR__UPSTREAM__SERVERS__` will be populated by
+ the `node-local-dns` pods.
+ In this mode, the `node-local-dns` pods listen on both the kube-dns service IP
+ as well as ``, so pods can lookup DNS records using either IP address.
+-->
* 如果 kube-proxy 运行在 IPTABLES 模式:
``` bash
@@ -170,44 +204,57 @@ If you are using the sample manifest from the previous point, this will require
node-local-dns Pods 会设置 `__PILLAR__CLUSTER__DNS__` 和 `__PILLAR__UPSTREAM__SERVERS__`。
在此模式下, node-local-dns Pods 会同时侦听 kube-dns 服务的 IP 地址和
`` 的地址,以便 Pods 可以使用其中任何一个 IP 地址来查询 DNS 记录。
-
* 如果 kube-proxy 运行在 IPVS 模式:
``` bash
- sed -i "s/__PILLAR__LOCAL__DNS__/$localdns/g; s/__PILLAR__DNS__DOMAIN__/$domain/g; s/__PILLAR__DNS__SERVER__//g; s/__PILLAR__CLUSTER__DNS__/$kubedns/g" nodelocaldns.yaml
+ sed -i "s/__PILLAR__LOCAL__DNS__/$localdns/g; s/__PILLAR__DNS__DOMAIN__/$domain/g; s/,__PILLAR__DNS__SERVER__//g; s/__PILLAR__CLUSTER__DNS__/$kubedns/g" nodelocaldns.yaml
```
在此模式下,node-local-dns Pods 只会侦听 `` 的地址。
node-local-dns 接口不能绑定 kube-dns 的集群 IP 地址,因为 IPVS 负载均衡
使用的接口已经占用了该地址。
node-local-dns Pods 会设置 `__PILLAR__UPSTREAM__SERVERS__`。
-
+
* 运行 `kubectl create -f nodelocaldns.yaml`
+
* 如果 kube-proxy 运行在 IPVS 模式,需要修改 kubelet 的 `--cluster-dns` 参数
NodeLocal DNSCache 正在侦听的 `` 地址。
否则,不需要修改 `--cluster-dns` 参数,因为 NodeLocal DNSCache 会同时侦听
kube-dns 服务的 IP 地址和 `` 的地址。
-启用后,node-local-dns Pods 将在每个集群节点上的 kube-system 名字空间中运行。
-此 Pod 在缓存模式下运行 [CoreDNS](https://github.com/coredns/coredns) ,
+启用后,`node-local-dns` Pods 将在每个集群节点上的 `kube-system` 名字空间中运行。
+此 Pod 在缓存模式下运行 [CoreDNS](https://github.com/coredns/coredns),
因此每个节点都可以使用不同插件公开的所有 CoreDNS 指标。
如果要禁用该功能,你可以使用 `kubectl delete -f ` 来删除 DaemonSet。
@@ -240,7 +287,9 @@ In those cases, the `kube-dns` ConfigMap can be updated.
## 设置内存限制
@@ -267,13 +316,13 @@ using the `max_concurrent` option in the forward plugin.
你可以在 forward 插件中使用 `max_concurrent` 选项设置并发查询数量上限。
From 48d4308c3d4b5b99f81c58e400e01d4f1a77c1eb Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Tue, 17 May 2022 11:44:54 +0800
Subject: [PATCH 025/245] [zh] Sync README.md with upstream
---
README-zh.md | 200 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 170 insertions(+), 30 deletions(-)
diff --git a/README-zh.md b/README-zh.md
index 700777d7a1..00a7ef1a24 100644
--- a/README-zh.md
+++ b/README-zh.md
@@ -13,7 +13,14 @@ This repository contains the assets required to build the [Kubernetes website an
我们非常高兴您想要参与贡献!
+- [为文档做贡献](#为文档做贡献)
+- [README.md 本地化](#readmemd-本地化)
+
+
@@ -46,7 +53,7 @@ Before you start, install the dependencies. Clone the repository and navigate to
-->
开始前,先安装这些依赖。克隆本仓库并进入对应目录:
-```
+```bash
git clone https://github.com/kubernetes/website.git
cd website
```
@@ -57,7 +64,7 @@ The Kubernetes website uses the [Docsy Hugo theme](https://github.com/google/doc
Kubernetes 网站使用的是 [Docsy Hugo 主题](https://github.com/google/docsy#readme)。 即使你打算在容器中运行网站,我们也强烈建议你通过运行以下命令来引入子模块和其他开发依赖项:
-```
+```bash
# pull in the Docsy submodule
git submodule update --init --recursive --depth 1
```
@@ -72,15 +79,23 @@ To build the site in a container, run the following to build the container image
要在容器中构建网站,请通过以下命令来构建容器镜像并运行:
-```
+```bash
make container-image
make container-serve
```
-启动浏览器,打开 http://localhost:1313 来查看网站。
+如果您看到错误,这可能意味着 hugo 容器没有足够的可用计算资源。
+要解决这个问题,请增加机器([MacOSX](https://docs.docker.com/docker-for-mac/#resources)
+和 [Windows](https://docs.docker.com/docker-for-windows/#resources))上
+Docker 允许的 CPU 和内存使用量。
+
+
+启动浏览器,打开 来查看网站。
当你对源文件作出修改时,Hugo 会更新网站并强制浏览器执行刷新操作。
上述命令会在端口 1313 上启动本地 Hugo 服务器。
-启动浏览器,打开 http://localhost:1313 来查看网站。
+启动浏览器,打开 来查看网站。
当你对源文件作出修改时,Hugo 会更新网站并强制浏览器执行刷新操作。
+
+## 构建 API 参考页面
+
+
+位于 `content/en/docs/reference/kubernetes-api` 的 API 参考页面是根据 Swagger 规范构建的,使用 。
+
+要更新新 Kubernetes 版本的参考页面,请执行以下步骤:
+
+
+1. 拉取 `api-ref-generator` 子模块:
+
+ ```bash
+ git submodule update --init --recursive --depth 1
+ ```
+
+
+2. 更新 Swagger 规范:
+
+ ```bash
+ curl 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json' > api-ref-assets/api/swagger.json
+ ```
+
+
+3. 在 `api-ref-assets/config/` 中,调整文件 `toc.yaml` 和 `fields.yaml` 以反映新版本的变化。
+
+
+4. 接下来,构建页面:
+
+ ```bash
+ make api-reference
+ ```
+
+
+ 您可以通过从容器映像创建和提供站点来在本地测试结果:
+
+ ```bash
+ make container-image
+ make container-serve
+ ```
+
+
+ 在 Web 浏览器中,打开 查看 API 参考。
+
+
+5. 当所有新的更改都反映到配置文件 `toc.yaml` 和 `fields.yaml` 中时,使用新生成的 API 参考页面创建一个 Pull Request。
+
## 故障排除
@@ -135,18 +216,24 @@ If you run `make serve` on macOS and receive the following error:
如果在 macOS 上运行 `make serve` 收到以下错误:
-```
+```bash
ERROR 2020/08/01 19:09:18 Error: listen tcp 127.0.0.1:1313: socket: too many open files
make: *** [serve] Error 1
```
+
试着查看一下当前打开文件数的限制:
`launchctl limit maxfiles`
-然后运行以下命令(参考https://gist.github.com/tombigel/d503800a282fcadbee14b537735d202c):
+
+然后运行以下命令(参考 ):
-```
+```shell
#!/bin/sh
# These are the original gist links, linking to my gists now.
@@ -165,6 +252,9 @@ sudo chown root:wheel /Library/LaunchDaemons/limit.maxproc.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
```
+
这适用于 Catalina 和 Mojave macOS。
# 参与 SIG Docs 工作
@@ -184,20 +275,21 @@ You can also reach the maintainers of this project at:
你也可以通过以下渠道联系本项目的维护人员:
-- [Slack](https://kubernetes.slack.com/messages/sig-docs) [加入Slack](https://slack.k8s.io/)
+- [Slack](https://kubernetes.slack.com/messages/sig-docs)
+ - [获得此 Slack 的邀请](https://slack.k8s.io/)
- [邮件列表](https://groups.google.com/forum/#!forum/kubernetes-sig-docs)
# 为文档做贡献
你也可以点击屏幕右上方区域的 **Fork** 按钮,在你自己的 GitHub
-账号下创建本仓库的拷贝。此拷贝被称作 *fork*。
+账号下创建本仓库的拷贝。此拷贝被称作 _fork_。
你可以在自己的拷贝中任意地修改文档,并在你已准备好将所作修改提交给我们时,
在你自己的拷贝下创建一个拉取请求(Pull Request),以便让我们知道。
@@ -208,7 +300,7 @@ Once your pull request is created, a Kubernetes reviewer will take responsibilit
还要提醒的一点,有时可能会有不止一个 Kubernetes 评审人为你提供反馈意见。
有时候,某个评审人的意见和另一个最初被指派的评审人的意见不同。
@@ -220,17 +312,65 @@ Furthermore, in some cases, one of your reviewers might ask for a technical revi
有关为 Kubernetes 文档做出贡献的更多信息,请参阅:
-* [贡献 Kubernetes 文档](https://kubernetes.io/docs/contribute/)
-* [页面内容类型](https://kubernetes.io/docs/contribute/style/page-content-types/)
-* [文档风格指南](https://kubernetes.io/docs/contribute/style/style-guide/)
-* [本地化 Kubernetes 文档](https://kubernetes.io/docs/contribute/localization/)
+- [贡献 Kubernetes 文档](https://kubernetes.io/docs/contribute/)
+- [页面内容类型](https://kubernetes.io/docs/contribute/style/page-content-types/)
+- [文档风格指南](https://kubernetes.io/docs/contribute/style/style-guide/)
+- [本地化 Kubernetes 文档](https://kubernetes.io/docs/contribute/localization/)
+
+
+### 新贡献者大使
+
+
+如果您在贡献时需要帮助,[新贡献者大使](https://kubernetes.io/docs/contribute/advanced/#serve-as-a-new-contributor-ambassador)是一个很好的联系人。
+这些是 SIG Docs 批准者,其职责包括指导新贡献者并帮助他们完成最初的几个拉取请求。
+联系新贡献者大使的最佳地点是 [Kubernetes Slack](https://slack.k8s.io/)。
+SIG Docs 的当前新贡献者大使:
+
+
+| 姓名 | Slack | GitHub |
+| -------------------------- | -------------------------- | -------------------------- |
+| Arsh Sharma | @arsh | @RinkiyaKeDad |
+
+
+## `README.md` 本地化
+
+
+| 语言 | 语言 |
+| -------------------------- | -------------------------- |
+| [中文](README-zh.md) | [韩语](README-ko.md) |
+| [法语](README-fr.md) | [波兰语](README-pl.md) |
+| [德语](README-de.md) | [葡萄牙语](README-pt.md) |
+| [印地语](README-hi.md) | [俄语](README-ru.md) |
+| [印尼语](README-id.md) | [西班牙语](README-es.md) |
+| [意大利语](README-it.md) | [乌克兰语](README-uk.md) |
+| [日语](README-ja.md) | [越南语](README-vi.md) |
# 中文本地化
@@ -241,19 +381,19 @@ For more information about contributing to the Kubernetes documentation, see:
* [Slack channel](https://kubernetes.slack.com/messages/kubernetes-docs-zh)
-# 行为准则
+## 行为准则
参与 Kubernetes 社区受 [CNCF 行为准则](https://github.com/cncf/foundation/blob/master/code-of-conduct.md) 约束。
-# 感谢!
+## 感谢你
Kubernetes 因为社区的参与而蓬勃发展,感谢您对我们网站和文档的贡献!
From 37add1c3183f8f25f9091f63cbb98e058dad26d3 Mon Sep 17 00:00:00 2001
From: song
Date: Tue, 10 May 2022 16:28:26 +0800
Subject: [PATCH 026/245] [zh] sync tasks/administer-cluster/kubeadm/*.md
Signed-off-by: song
---
.../kubeadm/adding-windows-nodes.md | 145 +++++++++++-------
.../kubeadm/kubeadm-certs.md | 99 ++++++++++--
2 files changed, 179 insertions(+), 65 deletions(-)
diff --git a/content/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md b/content/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md
index 377b5f3956..323dbd5cf0 100644
--- a/content/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md
+++ b/content/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md
@@ -25,7 +25,6 @@ You can use Kubernetes to run a mixture of Linux and Windows nodes, so you can m
混合使用运行于 Linux 上的 Pod 和运行于 Windows 上的 Pod。
本页面展示如何将 Windows 节点注册到你的集群。
-
## {{% heading "prerequisites" %}}
{{< version-check >}}
@@ -36,6 +35,7 @@ If you are using VXLAN/Overlay networking you must have also have [KB4489899](ht
* A Linux-based Kubernetes kubeadm cluster in which you have access to the control plane (see [Creating a single control-plane cluster with kubeadm](/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/)).
-->
+
* 获取 [Windows Server 2019 或更高版本的授权](https://www.microsoft.com/en-us/cloud-platform/windows-server-pricing)
以便配置托管 Windows 容器的 Windows 节点。
如果你在使用 VXLAN/覆盖(Overlay)联网设施,则你还必须安装 [KB4489899](https://support.microsoft.com/help/4489899)。
@@ -275,55 +275,12 @@ Windows 工作节点上具有提升的权限(Administrator)。
{{< /note >}}
{{< tabs name="tab-windows-kubeadm-runtime-installation" >}}
-{{% tab name="Docker EE" %}}
-
-#### 安装 Docker EE
-
-```powershell
-Install-WindowsFeature -Name containers
-```
-
-安装 Docker
-操作指南在 [Install Docker Engine - Enterprise on Windows Servers](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server#install-docker)。
-
-
-#### 安装 wins、kubelet 和 kubeadm
-
- ```PowerShell
- curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
- .\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}}
- ```
-
-
-#### 运行 `kubeadm` 添加节点
-
- 当你在控制面主机上运行 `kubeadm init` 时,输出了一个命令。现在运行这个命令。
- 如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行
- `kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。
-
-{{% /tab %}}
{{% tab name="CRI-containerD" %}}
-
#### 安装 containerD
```powershell
@@ -335,16 +292,12 @@ curl.exe -LO https://github.com/kubernetes-sigs/sig-windows-tools/releases/lates
-要安装特定版本的 containerD,使用参数 -ContainerDVersion指定版本。
+要安装特定版本的 containerD,使用参数 -ContainerDVersion 指定版本。
```powershell
# Example
.\Install-Containerd.ps1 -ContainerDVersion 1.4.1
```
-
-{{< /note >}}
-
-{{< note >}}
@@ -360,12 +313,18 @@ If you're using a different interface rather than Ethernet (i.e. "Ethernet0 2")
-#### 安装 wins,kubelet 和 kubeadm
+#### 安装 wins、kubelet 和 kubeadm
```PowerShell
curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}} -ContainerRuntime containerD
```
+
+从 [cri-tools](https://github.com/kubernetes-sigs/cri-tools) 项目安装 `crtctl`。
+`crictl` 是必需的,kubeadm 使用它与 CRI 端点通信。
#### 运行 `kubeadm` 添加节点
- 使用当你在控制面主机上运行 `kubeadm init` 时得到的命令。
- 如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行
- `kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。
+ 使用当你在控制面主机上运行 `kubeadm init` 时得到的命令。
+ 如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行
+ `kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。
+
+{{% /tab %}}
+
+
+{{% tab name="Docker Engine" %}}
+
+
+
+#### 安装 Docker Engine
+
+安装 `Containers` 功能特性
+
+```powershell
+Install-WindowsFeature -Name containers
+```
+
+
+
+安装 Docker
+
+操作指南在
+[Install Docker Engine - Enterprise on Windows Servers](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server#install-docker)。
+
+
+
+[安装 cri-dockerd](https://github.com/Mirantis/cri-dockerd)。kubelet 可以通过 cri-dockerd
+在 CRI 兼容的节点上与 Docker 通信。
+
{{< note >}}
-If using **CRI-containerD** add `--cri-socket "npipe:////./pipe/containerd-containerd"` to the kubeadm call
+
+Docker Engine 没有实现 [CRI](/zh/docs/concepts/architecture/cri/),
+而 CRI 是容器运行时能够与 Kubernetes 一起工作的要求。
+出于这个原因,必须安装一个额外的服务 [cri-dockerd](https://github.com/Mirantis/cri-dockerd)。
+cri-dockerd 是一个基于原来的内置 Docker Engine 支持的项目,
+而这一支持在 1.24 版本的 kubelet 中[已被移除](/zh/dockershim)。
{{< /note >}}
+
+从 [cri-tools](https://github.com/kubernetes-sigs/cri-tools) 项目安装 `crictl`。
+kubeadm 需要 `crictl` 才能与 CRI 端点通信。
+
+
+#### 安装 wins、kubelet 和 kubeadm
+
+```PowerShell
+curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
+.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}}
+```
+
+#### 运行 `kubeadm` 添加节点
+
+当你在控制面主机上运行 `kubeadm init` 时,输出了一个命令。现在运行这个命令。
+如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行
+`kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。
+
{{% /tab %}}
{{< /tabs >}}
diff --git a/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md b/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md
index a2c9194729..df303140ce 100644
--- a/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md
+++ b/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md
@@ -16,10 +16,13 @@ weight: 10
{{< feature-state for_k8s_version="v1.15" state="stable" >}}
由 [kubeadm](/zh/docs/reference/setup-tools/kubeadm/) 生成的客户端证书在 1 年后到期。
-本页说明如何使用 kubeadm 管理证书续订。
+本页说明如何使用 kubeadm 管理证书续订,同时也涵盖其他与 kubeadm 证书管理相关的说明。
## {{% heading "prerequisites" %}}
@@ -253,7 +256,7 @@ the Pod and the certificate renewal for the component can complete.
所以 kubectl 不能用来删除或重启他们。
要重启静态 Pod 你可以临时将清单文件从 `/etc/kubernetes/manifests/` 移除并等待 20 秒
(参考 [KubeletConfiguration 结构](/docs/reference/config-api/kubelet-config.v1beta1/) 中的`fileCheckFrequency` 值)。
-如果 Pod 不在清单目录里,kubelet将会终止它。
+如果 Pod 不在清单目录里,kubelet 将会终止它。
在另一个 `fileCheckFrequency` 周期之后你可以将文件移回去,为了组件可以完成 kubelet 将重新创建 Pod 和证书更新。
### 设置一个签名者(Signer)
-Kubernetes 证书颁发机构不是开箱即用。
-你可以配置外部签名者,例如
-[cert-manager](https://cert-manager.io/docs/configuration/ca/),
+Kubernetes 证书颁发机构不是开箱即用。你可以配置外部签名者,例如 [cert-manager](https://cert-manager.io/docs/configuration/ca/),
也可以使用内置签名者。
内置签名者是
-[`kube-controller-manager`](/zh/docs/reference/command-line-tools-reference/kube-controller-manager/)
-的一部分。
+[`kube-controller-manager`](/zh/docs/reference/command-line-tools-reference/kube-controller-manager/) 的一部分。
要激活内置签名者,请传递 `--cluster-signing-cert-file` 和 `--cluster-signing-key-file` 参数。
如果你正在创建一个新的集群,你可以使用 kubeadm 的
-[配置文件](/docs/reference/config-api/kubeadm-config.v1beta3/)。
+[配置文件](/zh/docs/reference/config-api/kubeadm-config.v1beta3/)。
```yaml
apiVersion: kubeadm.k8s.io/v1beta3
@@ -570,3 +570,80 @@ CSRs requesting serving certificates for any IP or domain name.
只有完成彻底的检查,才有可能避免有恶意的、能够访问 kubelet 客户端证书的第三方
为任何 IP 或域名请求服务证书。
+
+## 为其他用户生成 kubeconfig 文件 {#kubeconfig-additional-users}
+
+
+在集群创建过程中,kubeadm 对 `admin.conf` 中的证书进行签名时,将其配置为
+`Subject: O = system:masters, CN = kubernetes-admin`。
+[`system:masters`](/zh/docs/reference/access-authn-authz/rbac/#user-facing-roles)
+是一个例外的超级用户组,可以绕过鉴权层(例如 RBAC)。
+强烈建议不要将 `admin.conf` 文件与任何人共享。
+
+
+你要使用 [`kubeadm kubeconfig user`](/zh/docs/reference/setup-tools/kubeadm/kubeadm-kubeconfig)
+命令为其他用户生成 kubeconfig 文件,这个命令支持命令行参数和
+[kubeadm 配置结构](/zh/docs/reference/config-api/kubeadm-config.v1beta3/)。
+以上命令会将 kubeconfig 打印到终端上,也可以使用 `kubeadm kubeconfig user ... > somefile.conf`
+输出到一个文件中。
+
+
+如下 kubeadm 可以 在`--config` 后加的配置文件示例:
+
+```yaml
+# example.yaml
+apiVersion: kubeadm.k8s.io/v1beta3
+kind: ClusterConfiguration
+# kubernetes 将作为 kubeconfig 中集群名称
+clusterName: "kubernetes"
+# some-dns-address:6443 将作为集群 kubeconfig 文件中服务地址(IP 或者 DNS 名称)
+controlPlaneEndpoint: "some-dns-address:6443"
+# 从本地挂载集群的 CA 秘钥和 CA 证书
+certificatesDir: "/etc/kubernetes/pki"
+```
+
+
+确保这些设置与所需的目标集群设置相匹配。可以使用以下命令查看现有集群的设置:
+
+```shell
+kubectl get cm kubeadm-config -n kube-system -o=jsonpath="{.data.ClusterConfiguration}"
+```
+
+
+以下示例将为在 `appdevs` 组的 `johndoe` 用户创建一个有效期为 24 小时的 kubeconfig 文件:
+
+```shell
+kubeadm kubeconfig user --config example.yaml --org appdevs --client-name johndoe --validity-period 24h
+```
+
+
+以下示例将为管理员创建一个有效期有一周的 kubeconfig 文件:
+
+```shell
+kubeadm kubeconfig user --config example.yaml --client-name admin --validity-period 168h
+```
\ No newline at end of file
From 046bbe30922d67f0f9e95821ef92cc03c1b49965 Mon Sep 17 00:00:00 2001
From: "xin.li"
Date: Tue, 17 May 2022 22:21:19 +0800
Subject: [PATCH 027/245] adjust format
Signed-off-by: xin.li
---
content/zh/docs/reference/glossary/network-policy.md | 5 ++++-
content/zh/docs/reference/glossary/pod.md | 2 +-
content/zh/docs/reference/glossary/volume-plugin.md | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/content/zh/docs/reference/glossary/network-policy.md b/content/zh/docs/reference/glossary/network-policy.md
index 10cc5f6b64..864b6760d9 100644
--- a/content/zh/docs/reference/glossary/network-policy.md
+++ b/content/zh/docs/reference/glossary/network-policy.md
@@ -41,4 +41,7 @@ tags:
Network Policies help you declaratively configure which Pods are allowed to connect to each other, which namespaces are allowed to communicate, and more specifically which port numbers to enforce each policy on. `NetworkPolicy` resources use labels to select Pods and define rules which specify what traffic is allowed to the selected Pods. Network Policies are implemented by a supported network plugin provided by a network provider. Be aware that creating a network resource without a controller to implement it will have no effect.
-->
-网络策略帮助您声明式地配置允许哪些 Pod 之间接、哪些命名空间之间允许进行通信,并具体配置了哪些端口号来执行各个策略。`NetworkPolicy` 资源使用标签来选择 Pod,并定义了所选 Pod 可以接受什么样的流量。网络策略由网络提供商提供的并被 Kubernetes 支持的网络插件实现。请注意,当没有控制器实现网络资源时,创建网络资源将不会生效。
+网络策略帮助你声明式地配置允许哪些 Pod 之间、哪些命名空间之间允许进行通信,
+并具体配置了哪些端口号来执行各个策略。`NetworkPolicy` 资源使用标签来选择 Pod,
+并定义了所选 Pod 可以接受什么样的流量。网络策略由网络提供商提供的并被 Kubernetes 支持的网络插件实现。
+请注意,当没有控制器实现网络资源时,创建网络资源将不会生效。
diff --git a/content/zh/docs/reference/glossary/pod.md b/content/zh/docs/reference/glossary/pod.md
index 873ec90e62..eee257a43d 100644
--- a/content/zh/docs/reference/glossary/pod.md
+++ b/content/zh/docs/reference/glossary/pod.md
@@ -4,7 +4,7 @@ id: pod
date: 2018-04-12
full_link: /docs/concepts/workloads/pods/pod-overview/
short_description: >
- Pod 表示您的集群上一组正在运行的容器。
+ Pod 表示你的集群上一组正在运行的容器。
aka:
tags:
diff --git a/content/zh/docs/reference/glossary/volume-plugin.md b/content/zh/docs/reference/glossary/volume-plugin.md
index b04b8d8fbc..1071b04390 100644
--- a/content/zh/docs/reference/glossary/volume-plugin.md
+++ b/content/zh/docs/reference/glossary/volume-plugin.md
@@ -40,7 +40,7 @@ tags:
A Volume Plugin lets you attach and mount storage volumes for use by a {{< glossary_tooltip text="Pod" term_id="pod" >}}. Volume plugins can be _in tree_ or _out of tree_. _In tree_ plugins are part of the Kubernetes code repository and follow its release cycle. _Out of tree_ plugins are developed independently.
-->
-卷插件让您能给 {{< glossary_tooltip text="Pod" term_id="pod" >}} 附加和挂载存储卷。
+卷插件让你能给 {{< glossary_tooltip text="Pod" term_id="pod" >}} 附加和挂载存储卷。
卷插件既可以是 _in tree_ 也可以是 _out of tree_ 。_in tree_ 插件是 Kubernetes 代码库的一部分,
并遵循其发布周期。而 _Out of tree_ 插件则是独立开发的。
From a7c0119910d240af826a59a4749c8bb0aa9ae84e Mon Sep 17 00:00:00 2001
From: "xin.li"
Date: Tue, 17 May 2022 22:33:44 +0800
Subject: [PATCH 028/245] [zh] adjust format
Signed-off-by: xin.li
---
content/zh/docs/reference/glossary/etcd.md | 2 +-
content/zh/docs/reference/glossary/kops.md | 5 +++--
content/zh/docs/reference/glossary/logging.md | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/content/zh/docs/reference/glossary/etcd.md b/content/zh/docs/reference/glossary/etcd.md
index 9dec928b29..a13de28d1a 100644
--- a/content/zh/docs/reference/glossary/etcd.md
+++ b/content/zh/docs/reference/glossary/etcd.md
@@ -40,7 +40,7 @@ If your Kubernetes cluster uses etcd as its backing store, make sure you have a
[back up](/docs/tasks/administer-cluster/configure-upgrade-etcd/#backing-up-an-etcd-cluster) plan
for those data.
-->
-您的 Kubernetes 集群的 etcd 数据库通常需要有个备份计划。
+你的 Kubernetes 集群的 etcd 数据库通常需要有个备份计划。
diff --git a/content/zh/docs/reference/glossary/kops.md b/content/zh/docs/reference/glossary/kops.md
index d3241b763e..1719e2a8a6 100644
--- a/content/zh/docs/reference/glossary/kops.md
+++ b/content/zh/docs/reference/glossary/kops.md
@@ -56,7 +56,7 @@ Support for using kops with GCE and VMware vSphere are in alpha.
* The ability to directly provision, or to generate Terraform manifests
-->
-`kops` 为您的集群提供了:
+`kops` 为你的集群提供了:
* 全自动化安装
* 基于 DNS 的集群标识
@@ -69,4 +69,5 @@ Support for using kops with GCE and VMware vSphere are in alpha.
You can also build your own cluster using {{< glossary_tooltip term_id="kubeadm" >}} as a building block. `kops` builds on the kubeadm work.
-->
-您也可以将自己的集群作为一个构造块,使用 {{< glossary_tooltip term_id="kubeadm" >}} 构造集群。`kops` 是建立在 kubeadm 之上的。
+你也可以将自己的集群作为一个构造块,使用 {{< glossary_tooltip term_id="kubeadm" >}} 构造集群。
+`kops` 是建立在 kubeadm 之上的。
diff --git a/content/zh/docs/reference/glossary/logging.md b/content/zh/docs/reference/glossary/logging.md
index 8a88fe527e..64d8dbd0ac 100644
--- a/content/zh/docs/reference/glossary/logging.md
+++ b/content/zh/docs/reference/glossary/logging.md
@@ -36,4 +36,4 @@ tags:
Application and systems logs can help you understand what is happening inside your cluster. The logs are particularly useful for debugging problems and monitoring cluster activity.
-->
-应用程序和系统日志可以帮助您了解集群内部发生的情况。日志对于调试问题和监视集群活动非常有用。
\ No newline at end of file
+应用程序和系统日志可以帮助你了解集群内部发生的情况。日志对于调试问题和监视集群活动非常有用。
\ No newline at end of file
From e7300a151c20cf4edf30e0b1e88b54c1579b5850 Mon Sep 17 00:00:00 2001
From: Manish Kumar
Date: Tue, 17 May 2022 20:10:27 +0530
Subject: [PATCH 029/245] Register and document annotations on Secret that
relate to ServiceAccount (#32005)
* Registered secret annotation
Signed-off-by: Manish Kumar
* Update content/en/docs/reference/labels-annotations-taints/_index.md
Co-authored-by: Tim Bannister
* Update content/en/docs/reference/labels-annotations-taints/_index.md
Co-authored-by: Tim Bannister
* Updated Secret type
Co-authored-by: Tim Bannister
---
.../labels-annotations-taints/_index.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/content/en/docs/reference/labels-annotations-taints/_index.md b/content/en/docs/reference/labels-annotations-taints/_index.md
index e68cb668d3..6622c63941 100644
--- a/content/en/docs/reference/labels-annotations-taints/_index.md
+++ b/content/en/docs/reference/labels-annotations-taints/_index.md
@@ -334,6 +334,24 @@ Used on: Service
Kubernetes uses this label to differentiate multiple Services. Used currently for `ELB`(Elastic Load Balancer) only.
+### kubernetes.io/service-account.name
+
+Example: `kubernetes.io/service-account.name: "sa-name"`
+
+Used on: Secret
+
+This annotation records the {{< glossary_tooltip term_id="name" text="name">}} of the
+ServiceAccount that the token (stored in the Secret of type `kubernetes.io/service-account-token`) represents.
+
+### kubernetes.io/service-account.uid
+
+Example: `kubernetes.io/service-account.uid: da68f9c6-9d26-11e7-b84e-002dc52800da`
+
+Used on: Secret
+
+This annotation records the {{< glossary_tooltip term_id="uid" text="unique ID" >}} of the
+ServiceAccount that the token (stored in the Secret of type `kubernetes.io/service-account-token`) represents.
+
### endpointslice.kubernetes.io/managed-by {#endpointslicekubernetesiomanaged-by}
Example: `endpointslice.kubernetes.io/managed-by="controller"`
From 1969440f123fdaf1d2994abac24f8a7df0e1d6f4 Mon Sep 17 00:00:00 2001
From: "xin.li"
Date: Tue, 17 May 2022 23:10:19 +0800
Subject: [PATCH 030/245] [zh] adjust format
Signed-off-by: xin.li
---
content/zh/docs/reference/glossary/aggregation-layer.md | 7 ++++---
content/zh/docs/reference/glossary/app-container.md | 2 +-
content/zh/docs/reference/glossary/configmap.md | 2 +-
.../zh/docs/reference/glossary/customresourcedefinition.md | 7 ++++---
content/zh/docs/reference/glossary/disruption.md | 4 ++--
content/zh/docs/reference/glossary/ephemeral-container.md | 4 ++--
6 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/content/zh/docs/reference/glossary/aggregation-layer.md b/content/zh/docs/reference/glossary/aggregation-layer.md
index 9ad14962cf..0d16d12aed 100644
--- a/content/zh/docs/reference/glossary/aggregation-layer.md
+++ b/content/zh/docs/reference/glossary/aggregation-layer.md
@@ -4,7 +4,7 @@ id: aggregation-layer
date: 2018-10-08
full_link: /zh/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/
short_description: >
- 聚合层允许您在自己的集群上安装额外的 Kubernetes 风格的 API。
+ 聚合层允许你在自己的集群上安装额外的 Kubernetes 风格的 API。
aka:
tags:
@@ -36,7 +36,7 @@ tags:
The aggregation layer lets you install additional Kubernetes-style APIs in your cluster.
-->
-聚合层允许您在自己的集群上安装额外的 Kubernetes 风格的 API。
+聚合层允许你在自己的集群上安装额外的 Kubernetes 风格的 API。
@@ -45,4 +45,5 @@ tags:
When you've configured the {{< glossary_tooltip text="Kubernetes API Server" term_id="kube-apiserver" >}} to [support additional APIs](/docs/tasks/extend-kubernetes/configure-aggregation-layer/), you can add `APIService` objects to "claim" a URL path in the Kubernetes API.
-->
-当您配置了 {{< glossary_tooltip text="Kubernetes API Server" term_id="kube-apiserver" >}} 来 [支持额外的 API](/zh/docs/tasks/extend-kubernetes/configure-aggregation-layer/),您就可以在 Kubernetes API 中增加 `APIService` 对象来 "申领(Claim)" 一个 URL 路径。
+当你配置了 {{< glossary_tooltip text="Kubernetes API Server" term_id="kube-apiserver" >}} 来 [支持额外的 API](/zh/docs/tasks/extend-kubernetes/configure-aggregation-layer/),
+你就可以在 Kubernetes API 中增加 `APIService` 对象来 "申领(Claim)" 一个 URL 路径。
diff --git a/content/zh/docs/reference/glossary/app-container.md b/content/zh/docs/reference/glossary/app-container.md
index 3773e1c1b8..3980937a9d 100644
--- a/content/zh/docs/reference/glossary/app-container.md
+++ b/content/zh/docs/reference/glossary/app-container.md
@@ -42,6 +42,6 @@ once the application container has started.
If a pod doesn't have any init containers configured, all the containers in that pod are app containers.
-->
-初始化容器使您可以分离对于{{< glossary_tooltip text="工作负载" term_id="workload" >}}
+初始化容器使你可以分离对于{{< glossary_tooltip text="工作负载" term_id="workload" >}}
整体而言很重要的初始化细节,并且一旦应用容器启动,它不需要继续运行。
如果 pod 没有配置任何初始化容器,则该 pod 中的所有容器都是应用程序容器。
\ No newline at end of file
diff --git a/content/zh/docs/reference/glossary/configmap.md b/content/zh/docs/reference/glossary/configmap.md
index be80c84f61..cc22e9de56 100644
--- a/content/zh/docs/reference/glossary/configmap.md
+++ b/content/zh/docs/reference/glossary/configmap.md
@@ -41,4 +41,4 @@ environment variables, command-line arguments, or as configuration files in a
A ConfigMap allows you to decouple environment-specific configuration from your {{< glossary_tooltip text="container images" term_id="image" >}}, so that your applications are easily portable.
-->
-ConfigMap 将您的环境配置信息和 {{< glossary_tooltip text="容器镜像" term_id="image" >}} 解耦,便于应用配置的修改。
+ConfigMap 将你的环境配置信息和 {{< glossary_tooltip text="容器镜像" term_id="image" >}} 解耦,便于应用配置的修改。
diff --git a/content/zh/docs/reference/glossary/customresourcedefinition.md b/content/zh/docs/reference/glossary/customresourcedefinition.md
index ee0548e78d..c29e02d8c5 100644
--- a/content/zh/docs/reference/glossary/customresourcedefinition.md
+++ b/content/zh/docs/reference/glossary/customresourcedefinition.md
@@ -4,7 +4,7 @@ id: CustomResourceDefinition
date: 2018-04-12
full_link: /zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/
short_description: >
- 通过定制化的代码给您的 Kubernetes API 服务器增加资源对象,而无需编译完整的定制 API 服务器。
+ 通过定制化的代码给你的 Kubernetes API 服务器增加资源对象,而无需编译完整的定制 API 服务器。
aka:
tags:
@@ -33,7 +33,7 @@ tags:
Custom code that defines a resource to add to your Kubernetes API server without building a complete custom server.
-->
- 通过定制化的代码给您的 Kubernetes API 服务器增加资源对象,而无需编译完整的定制 API 服务器。
+ 通过定制化的代码给你的 Kubernetes API 服务器增加资源对象,而无需编译完整的定制 API 服务器。
@@ -41,5 +41,6 @@ tags:
Custom Resource Definitions let you extend the Kubernetes API for your environment if the publicly supported API resources can't meet your needs.
-->
-当 Kubernetes 公开支持的 API 资源不能满足您的需要时,定制资源对象(Custom Resource Definitions)让您可以在您的环境上扩展 Kubernetes API。
+当 Kubernetes 公开支持的 API 资源不能满足你的需要时,
+定制资源对象(Custom Resource Definitions)让你可以在你的环境上扩展 Kubernetes API。
diff --git a/content/zh/docs/reference/glossary/disruption.md b/content/zh/docs/reference/glossary/disruption.md
index 2b59797a39..6cfc0a1809 100644
--- a/content/zh/docs/reference/glossary/disruption.md
+++ b/content/zh/docs/reference/glossary/disruption.md
@@ -41,7 +41,7 @@ Kubernetes terms that an _involuntary disruption_.
See [Disruptions](/docs/concepts/workloads/pods/disruptions/) for more information.
-->
-如果您作为一个集群操作人员,销毁了一个从属于某个应用的 Pod, Kubernetes 视之为 _自愿干扰(Voluntary Disruption)_。如果由于节点故障
-或者影响更大区域故障的断电导致 Pod 离线,kubernetes 视之为 _非愿干扰(Involuntary Disruption)_。
+如果你作为一个集群操作人员,销毁了一个从属于某个应用的 Pod, Kubernetes 视之为**自愿干扰(Voluntary Disruption)**。
+如果由于节点故障 或者影响更大区域故障的断电导致 Pod 离线,kubernetes 视之为**非愿干扰(Involuntary Disruption)**。
更多信息请查阅[Disruptions](/zh/docs/concepts/workloads/pods/disruptions/)
\ No newline at end of file
diff --git a/content/zh/docs/reference/glossary/ephemeral-container.md b/content/zh/docs/reference/glossary/ephemeral-container.md
index d937404797..a317bbfb10 100644
--- a/content/zh/docs/reference/glossary/ephemeral-container.md
+++ b/content/zh/docs/reference/glossary/ephemeral-container.md
@@ -4,12 +4,12 @@ id: ephemeral-container
date: 2019-08-26
full_link: /zh/docs/concepts/workloads/pods/ephemeral-containers/
short_description: >
- 您可以在 Pod 中临时运行的一种容器类型
+ 你可以在 Pod 中临时运行的一种容器类型
aka:
tags:
- fundamental
---
- 您可以在 {{< glossary_tooltip term_id="pod" >}} 中临时运行的一种 {{< glossary_tooltip term_id="container" >}} 类型。
+ 你可以在 {{< glossary_tooltip term_id="pod" >}} 中临时运行的一种 {{< glossary_tooltip term_id="container" >}} 类型。
-本页介绍如何为命名空间中容器和 Pod 使用的 CPU 资源设置最小和最大值。
+本页介绍如何为{{< glossary_tooltip text="命名空间" term_id="namespace" >}}中的容器和 Pod
+设置其所使用的 CPU 资源的最小和最大值。
你可以通过
-[LimitRange](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#limitrange-v1-core)
-对象声明 CPU 的最小和最大值. 如果 Pod 不能满足 LimitRange 的限制,它就不能在命名空间中创建。
+[LimitRange](/docs/reference/kubernetes-api/policy-resources/limit-range-v1/)
+对象声明 CPU 的最小和最大值.
+如果 Pod 不能满足 LimitRange 的限制,就无法在该命名空间中被创建。
## {{% heading "prerequisites" %}}
-{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
+{{< include "task-tutorial-prereqs.md" >}}
-你的集群中每个节点至少要有 1 个 CPU 可用才能运行本任务示例。
+在你的集群里你必须要有创建命名空间的权限。
+
+集群中的每个节点都必须至少有 1.0 个 CPU 可供 Pod 使用。
+
+请阅读 [CPU 的含义](/zh/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu)
+理解 "1 CPU" 在 Kubernetes 中的含义。
@@ -52,11 +69,11 @@ kubectl create namespace constraints-cpu-example
## 创建 LimitRange 和 Pod
-这里给出了 LimitRange 的配置文件:
+以下为 {{< glossary_tooltip text="LimitRange" term_id="limitrange" >}} 的示例清单:
{{< codenew file="admin/resource/cpu-constraints.yaml" >}}
@@ -100,24 +117,25 @@ limits:
```
-现在不管什么时候在 constraints-cpu-example 命名空间中创建容器,Kubernetes 都会执行下面这些步骤:
+现在,每当你在 constraints-mem-example 命名空间中创建 Pod 时,或者某些其他的
+Kubernetes API 客户端创建了等价的 Pod 时,Kubernetes 就会执行下面的步骤:
-* 如果容器没有声明自己的 CPU 请求和限制,将为容器指定默认 CPU 请求和限制。
+* 如果 Pod 中的任何容器未声明自己的 CPU 请求和限制,控制面将为该容器设置默认的 CPU 请求和限制。
-* 核查容器声明的 CPU 请求确保其大于或者等于 200 millicpu。
+* 确保该 Pod 中的每个容器的 CPU 请求至少 200 millicpu。
-* 核查容器声明的 CPU 限制确保其小于或者等于 800 millicpu。
+* 确保该 Pod 中每个容器 CPU 请求不大于 800 millicpu。
-这里给出了包含一个容器的 Pod 的配置文件。
-该容器声明了 500 millicpu 的 CPU 请求和 800 millicpu 的 CPU 限制。
+以下为某个仅包含一个容器的 Pod 的清单。
+该容器声明了 CPU 请求 500 millicpu 和 CPU 限制 800 millicpu 。
这些参数满足了 LimitRange 对象规定的 CPU 最小和最大限制。
{{< codenew file="admin/resource/cpu-constraints-pod.yaml" >}}
@@ -143,16 +161,16 @@ minimum and maximum CPU constraints imposed by the LimitRange.
-创建Pod:
+创建 Pod:
```shell
kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints-pod.yaml --namespace=constraints-cpu-example
```
-确认一下 Pod 中的容器在运行:
+确认 Pod 正在运行,并且其容器处于健康状态:
```shell
kubectl get pod constraints-cpu-demo --namespace=constraints-cpu-example
@@ -168,10 +186,10 @@ kubectl get pod constraints-cpu-demo --output=yaml --namespace=constraints-cpu-e
```
-输出结果表明容器的 CPU 请求为 500 millicpu,CPU 限制为 800 millicpu。
+输出结果显示该 Pod 的容器的 CPU 请求为 500 millicpu,CPU 限制为 800 millicpu。
这些参数满足 LimitRange 规定的限制范围。
```yaml
@@ -214,10 +232,11 @@ kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints-pod-2.ya
```
-输出结果表明 Pod 没有创建成功,因为容器声明的 CPU 限制太大了:
+输出结果表明 Pod 没有创建成功,因为其中定义了一个无法被接受的容器。
+该容器之所以无法被接受是因为其中设定了过高的 CPU 限制值:
```
Error from server (Forbidden): error when creating "examples/admin/resource/cpu-constraints-pod-2.yaml":
@@ -227,12 +246,12 @@ pods "constraints-cpu-demo-2" is forbidden: maximum cpu usage per Container is 8
## 尝试创建一个不满足最小 CPU 请求的 Pod
-这里给出了包含一个容器的 Pod 的配置文件。该容器声明了100 millicpu的 CPU 请求和800 millicpu的 CPU 限制。
+以下为某个只有一个容器的 Pod 的清单。该容器声明了 CPU 请求 100 millicpu 和 CPU 限制 800 millicpu。
{{< codenew file="admin/resource/cpu-constraints-pod-3.yaml" >}}
@@ -246,10 +265,12 @@ kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints-pod-3.ya
```
-输出结果显示 Pod 没有创建成功,因为容器声明的 CPU 请求太小了:
+输出结果显示 Pod 没有创建成功,因为其中定义了一个无法被接受的容器。
+该容器无法被接受的原因是其中所设置的 CPU 请求小于最小值的限制:
```
Error from server (Forbidden): error when creating "examples/admin/resource/cpu-constraints-pod-3.yaml":
@@ -259,12 +280,12 @@ pods "constraints-cpu-demo-4" is forbidden: minimum cpu usage per Container is 2
## 创建一个没有声明 CPU 请求和 CPU 限制的 Pod
-这里给出了包含一个容器的 Pod 的配置文件。该容器没有设定 CPU 请求和 CPU 限制。
+以下为一个只有一个容器的 Pod 的清单。该容器没有声明 CPU 请求,也没有声明 CPU 限制。
{{< codenew file="admin/resource/cpu-constraints-pod-4.yaml" >}}
@@ -287,11 +308,14 @@ kubectl get pod constraints-cpu-demo-4 --namespace=constraints-cpu-example --out
```
-输出结果显示 Pod 的容器有个 800 millicpu 的 CPU 请求和 800 millicpu 的 CPU 限制。
-容器是怎样得到那些值的呢?
+输出结果显示 Pod 的唯一容器的 CPU 请求为 800 millicpu,CPU 限制为 800 millicpu。
+
+容器是怎样获得这些数值的呢?
+
```yaml
resources:
@@ -302,26 +326,27 @@ resources:
```
-因为你的 Container 没有声明自己的 CPU 请求和限制,LimitRange 给它指定了
-[默认的 CPU 请求和限制](/zh/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/)
+因为这一容器没有声明自己的 CPU 请求和限制,
+控制面会根据命名空间中配置 LimitRange
+设置[默认的 CPU 请求和限制](/zh/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/)。
-此时,你的容器可能运行也可能没有运行。
-回想一下,本任务的先决条件是你的节点要有 1 个 CPU。
-如果你的每个节点仅有 1 个 CPU,那么可能没有任何一个节点可以满足 800 millicpu 的 CPU 请求。
-如果你在用的节点恰好有两个 CPU,那么你才可能有足够的 CPU 来满足 800 millicpu 的请求。
+此时,你的 Pod 可能已经运行起来也可能没有运行起来。
+回想一下我们本次任务的先决条件是你的每个节点都至少有 1 CPU。
+如果你的每个节点都只有 1 CPU,那将没有一个节点拥有足够的可分配 CPU 来满足 800 millicpu 的请求。
+如果你在用的节点恰好有 2 CPU,那么有可能有足够的 CPU 来满足 800 millicpu 的请求。
```
kubectl delete pod constraints-cpu-demo-4 --namespace=constraints-cpu-example
diff --git a/content/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md b/content/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md
index e0da942183..203fcc95eb 100644
--- a/content/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md
+++ b/content/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md
@@ -107,8 +107,8 @@ file for the LimitRange, they were created automatically.
Now whenever you define a Pod within the constraints-mem-example namespace, Kubernetes
performs these steps:
-* If any container in that Pod does not specify its own memory request and limit, assign
-the default memory request and limit to that container.
+* If any container in that Pod does not specify its own memory request and limit,
+the control plane assig nthe default memory request and limit to that container.
* Verify that every container in that Pod requests at least 500 MiB of memory.
@@ -121,7 +121,7 @@ minimum and maximum memory constraints imposed by the LimitRange.
-->
现在,每当在 constraints-mem-example 命名空间中创建 Pod 时,Kubernetes 就会执行下面的步骤:
-* 如果 Pod 中的任何容器未声明自己的内存请求和限制,将为该容器设置默认的内存请求和限制。
+* 如果 Pod 中的任何容器未声明自己的内存请求和限制,控制面将为该容器设置默认的内存请求和限制。
* 确保该 Pod 中的每个容器的内存请求至少 500 MiB。
diff --git a/content/zh/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md b/content/zh/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md
index 416b076094..e00f52fbd6 100644
--- a/content/zh/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md
+++ b/content/zh/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md
@@ -2,33 +2,43 @@
title: 为命名空间配置内存和 CPU 配额
content_type: task
weight: 50
+description: >-
+ 为命名空间定义总的 CPU 和内存资源限制。
---
-本文介绍怎样为命名空间设置容器可用的内存和 CPU 总量。你可以通过
-[ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core)
+本文介绍如何为{{< glossary_tooltip text="命名空间" term_id="namespace" >}}下运行的所有 Pod 设置总的内存和 CPU 配额。
+你可以通过使用
+[ResourceQuota](/docs/reference/kubernetes-api/policy-resources/resource-quota-v1/)
对象设置配额.
## {{% heading "prerequisites" %}}
-{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
+{{< include "task-tutorial-prereqs.md" >}}
+在你的集群里你必须要有创建命名空间的权限。
+
集群中每个节点至少有 1 GiB 的内存。
@@ -51,11 +61,11 @@ kubectl create namespace quota-mem-cpu-example
## 创建 ResourceQuota
-这里给出一个 ResourceQuota 对象的配置文件:
+下面是 ResourceQuota 的示例清单:
{{< codenew file="admin/resource/quota-mem-cpu.yaml" >}}
@@ -80,28 +90,33 @@ kubectl get resourcequota mem-cpu-demo --namespace=quota-mem-cpu-example --outpu
ResourceQuota 在 quota-mem-cpu-example 命名空间中设置了如下要求:
-* 每个容器必须有内存请求和限制,以及 CPU 请求和限制。
-* 所有容器的内存请求总和不能超过1 GiB。
-* 所有容器的内存限制总和不能超过2 GiB。
-* 所有容器的 CPU 请求总和不能超过1 cpu。
-* 所有容器的 CPU 限制总和不能超过2 cpu。
+* 在该命名空间中的每个 Pod 的所有容器都必须要有内存请求和限制,以及 CPU 请求和限制。
+* 在该命名空间中所有 Pod 的内存请求总和不能超过 1 GiB。
+* 在该命名空间中所有 Pod 的内存限制总和不能超过 2 GiB。
+* 在该命名空间中所有 Pod 的 CPU 请求总和不能超过 1 cpu。
+* 在该命名空间中所有 Pod 的 CPU 限制总和不能超过 2 cpu。
+请阅读 [CPU 的含义](/zh/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu)
+理解 "1 CPU" 在 Kubernetes 中的含义。
## 创建 Pod
-这里给出 Pod 的配置文件:
+以下是 Pod 的示例清单:
{{< codenew file="admin/resource/quota-mem-cpu-pod.yaml" >}}
@@ -115,11 +130,11 @@ kubectl apply -f https://k8s.io/examples/admin/resource/quota-mem-cpu-pod.yaml -
```
-检查下 Pod 中的容器在运行:
+确认 Pod 正在运行,并且其容器处于健康状态:
-```
+```shell
kubectl get pod quota-mem-cpu-demo --namespace=quota-mem-cpu-example
```
@@ -128,7 +143,7 @@ Once again, view detailed information about the ResourceQuota:
-->
再查看 ResourceQuota 的详情:
-```
+```shell
kubectl get resourcequota mem-cpu-demo --namespace=quota-mem-cpu-example --output=yaml
```
@@ -153,27 +168,38 @@ status:
requests.memory: 600Mi
```
+
+如果有 `jq` 工具的话,你可以通过(使用 [JSONPath](/zh/docs/reference/kubectl/jsonpath/))
+直接查询 `used` 字段的值,并且输出整齐的 JSON 格式。
+
+```shell
+kubectl get resourcequota mem-cpu-demo --namespace=quota-mem-cpu-example -o jsonpath='{ .status.used }' | jq .
+```
+
## 尝试创建第二个 Pod
-这里给出了第二个 Pod 的配置文件:
+以下为第二个 Pod 的清单:
{{< codenew file="admin/resource/quota-mem-cpu-pod-2.yaml" >}}
-配置文件中,你可以看到 Pod 的内存请求为 700 MiB。
-请注意新的内存请求与已经使用的内存请求只和超过了内存请求的配额。
+在清单中,你可以看到 Pod 的内存请求为 700 MiB。
+请注意新的内存请求与已经使用的内存请求之和超过了内存请求的配额:
600 MiB + 700 MiB > 1 GiB。
尝试创建 Pod:
@@ -198,19 +224,20 @@ requested: requests.memory=700Mi,used: requests.memory=600Mi, limited: requests.
## Discussion
As you have seen in this exercise, you can use a ResourceQuota to restrict
-the memory request total for all Containers running in a namespace.
+the memory request total for all Pods running in a namespace.
You can also restrict the totals for memory limit, cpu request, and cpu limit.
-If you want to restrict individual Containers, instead of totals for all Containers, use a
-[LimitRange](/docs/tasks/administer-cluster/memory-constraint-namespace/).
+Instead of managing total resource use within a namespace, you might want to restrict
+individual Pods, or the containers in those Pods. To achieve that kind of limiting, use a
+[LimitRange](/docs/concepts/policy/limit-range/).
-->
## 讨论
-如你在本练习中所见,你可以用 ResourceQuota 限制命名空间中所有容器的内存请求总量。
+如你在本练习中所见,你可以用 ResourceQuota 限制命名空间中所有 Pod 的内存请求总量。
同样你也可以限制内存限制总量、CPU 请求总量、CPU 限制总量。
-如果你想对单个容器而不是所有容器进行限制,就请使用
-[LimitRange](/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/)。
+除了可以管理命名空间资源使用的总和,如果你想限制单个 Pod,或者限制这些 Pod 中的容器资源,
+可以使用 [LimitRange](/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/) 实现这类的功能。
+
-本文主要描述如何配置一个命名空间下可运行的 Pod 个数配额。
-你可以使用
-[ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core)
+本文主要介绍如何在{{< glossary_tooltip text="命名空间" term_id="namespace" >}}中设置可运行 Pod 总数的配额。
+你可以通过使用
+[ResourceQuota](/zh/docs/reference/kubernetes-api/policy-resources/resource-quota-v1/)
对象来配置配额。
## {{% heading "prerequisites" %}}
-{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
+{{< include "task-tutorial-prereqs.md" >}}
+
+
+在你的集群里你必须要有创建命名空间的权限。
@@ -40,11 +55,11 @@ kubectl create namespace quota-pod-example
## 创建 ResourceQuota
-下面是一个 ResourceQuota 的配置文件:
+下面是 ResourceQuota 的示例清单:
{{< codenew file="admin/resource/quota-pod.yaml" >}}
@@ -83,18 +98,20 @@ status:
```
-下面是一个 Deployment 的配置文件:
+下面是一个 {{< glossary_tooltip term_id="deployment" >}} 的示例清单:
{{< codenew file="admin/resource/quota-pod-deployment.yaml" >}}
-在配置文件中,`replicas: 3` 告诉 Kubernetes 尝试创建三个 Pods,且运行相同的应用。
+在清单中,`replicas: 3` 告诉 Kubernetes 尝试创建三个 Pods,
+且运行相同的应用。
创建这个 Deployment:
@@ -113,7 +130,7 @@ kubectl get deployment pod-quota-demo --namespace=quota-pod-example --output=yam
从输出的信息我们可以看到,尽管尝试创建三个 Pod,但是由于配额的限制,只有两个 Pod 能被成功创建。
@@ -125,11 +142,24 @@ spec:
status:
availableReplicas: 2
...
-lastUpdateTime: 2017-07-07T20:57:05Z
+lastUpdateTime: 2021-04-02T20:57:05Z
message: 'unable to create pods: pods "pod-quota-demo-1650323038-" is forbidden:
exceeded quota: pod-demo, requested: pods=1, used: pods=2, limited: pods=2'
```
+
+### 资源的选择
+在此任务中,你定义了一个限制 Pod 总数的 ResourceQuota,
+你也可以限制其他类型对象的总数。例如,
+你可以限制在一个命名空间中可以创建的 {{< glossary_tooltip text="CronJobs" term_id="cronjob" >}} 的数量。
+
-除了 kubectl 和 dashboard 之外,您可以使用其他工具来可视化和管理 Kubernetes 对象。一组通用的标签可以让多个工具之间相互操作,用所有工具都能理解的通用方式描述对象。
+除了 kubectl 和 dashboard 之外,你可以使用其他工具来可视化和管理 Kubernetes 对象。
+一组通用的标签可以让多个工具之间相互操作,用所有工具都能理解的通用方式描述对象。
-使用 MySQL `StatefulSet` 和 `Service`,您会注意到有关 MySQL 和 Wordpress 的信息,包括更广泛的应用程序。
+使用 MySQL `StatefulSet` 和 `Service`,你会注意到有关 MySQL 和 Wordpress 的信息,包括更广泛的应用程序。
diff --git a/content/zh/docs/concepts/scheduling-eviction/taint-and-toleration.md b/content/zh/docs/concepts/scheduling-eviction/taint-and-toleration.md
index 03722ea469..1e02d72fdd 100644
--- a/content/zh/docs/concepts/scheduling-eviction/taint-and-toleration.md
+++ b/content/zh/docs/concepts/scheduling-eviction/taint-and-toleration.md
@@ -272,7 +272,7 @@ onto nodes labeled with `dedicated=groupName`.
然后给这组用户的 Pod 添加一个相对应的 toleration(通过编写一个自定义的
[准入控制器](/zh/docs/reference/access-authn-authz/admission-controllers/),很容易就能做到)。
拥有上述容忍度的 Pod 就能够被分配到上述专用节点,同时也能够被分配到集群中的其它节点。
- 如果你希望这些 Pod 只能被分配到上述专用节点,那么您还需要给这些专用节点另外添加一个和上述
+ 如果你希望这些 Pod 只能被分配到上述专用节点,那么你还需要给这些专用节点另外添加一个和上述
污点类似的 label (例如:`dedicated=groupName`),同时 还要在上述准入控制器中给 Pod
增加节点亲和性要求上述 Pod 只能被分配到添加了 `dedicated=groupName` 标签的节点上。
diff --git a/content/zh/docs/concepts/workloads/controllers/daemonset.md b/content/zh/docs/concepts/workloads/controllers/daemonset.md
index d8acb65797..fb248e9b2f 100644
--- a/content/zh/docs/concepts/workloads/controllers/daemonset.md
+++ b/content/zh/docs/concepts/workloads/controllers/daemonset.md
@@ -242,7 +242,7 @@ taken into account before selecting the target host). The DaemonSet controller o
performs these operations when creating or modifying DaemonSet pods, and no
changes are made to the `spec.template` of the DaemonSet.
-->
-`ScheduleDaemonSetPods` 允许您使用默认调度器而不是 DaemonSet 控制器来调度 DaemonSets,
+`ScheduleDaemonSetPods` 允许你使用默认调度器而不是 DaemonSet 控制器来调度 DaemonSets,
方法是将 `NodeAffinity` 条件而不是 `.spec.nodeName` 条件添加到 DaemonSet Pods。
默认调度器接下来将 Pod 绑定到目标主机。
如果 DaemonSet Pod 的节点亲和性配置已存在,则被替换
@@ -352,7 +352,7 @@ them according to its `updateStrategy`.
You can [perform a rolling update](/docs/tasks/manage-daemon/update-daemon-set/) on a DaemonSet.
-->
-您可以删除一个 DaemonSet。如果使用 `kubectl` 并指定 `--cascade=orphan` 选项,
+你可以删除一个 DaemonSet。如果使用 `kubectl` 并指定 `--cascade=orphan` 选项,
则 Pod 将被保留在节点上。接下来如果创建使用相同选择算符的新 DaemonSet,
新的 DaemonSet 会收养已有的 Pod。
如果有 Pod 需要被替换,DaemonSet 会根据其 `updateStrategy` 来替换。
diff --git a/content/zh/docs/concepts/workloads/controllers/ttlafterfinished.md b/content/zh/docs/concepts/workloads/controllers/ttlafterfinished.md
index 0d02b7a04b..352ddaf83d 100644
--- a/content/zh/docs/concepts/workloads/controllers/ttlafterfinished.md
+++ b/content/zh/docs/concepts/workloads/controllers/ttlafterfinished.md
@@ -94,7 +94,7 @@ returns a successful API response.
请注意,在创建 Job 或已经执行结束后,仍可以修改其 TTL 周期,例如 Job 的
`.spec.ttlSecondsAfterFinished` 字段。
-但是一旦 Job 变为可被删除状态(当其 TTL 已过期时),即使您通过 API 增加其 TTL
+但是一旦 Job 变为可被删除状态(当其 TTL 已过期时),即使你通过 API 增加其 TTL
时长得到了成功的响应,系统也不保证 Job 将被保留。
+
+
+`apiVersion: scheduling.k8s.io/v1`
+
+`import "k8s.io/api/scheduling/v1"`
+
+
+## PriorityClass {#PriorityClass}
+
+
+PriorityClass 定义了从优先级类名到优先级数值的映射。
+该值可以是任何有效的整数。
+
+
+
+
+- **apiVersion**: scheduling.k8s.io/v1
+
+
+- **kind**: PriorityClass
+
+
+- **metadata** (}}">ObjectMeta)
+
+ 标准对象的元数据。
+ 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+
+
+- **value** (int32),必需
+
+ 此优先级的值。这是 Pod 在其 Pod 规约中有此类名称时收到的实际优先级。
+
+
+- **description** (string)
+
+ description 是一个任意字符串,通常提供有关何时应使用此优先级的指南。
+
+
+- **globalDefault** (boolean)
+
+ globalDefault 指定是否应将此 PriorityClass 视为没有任何优先级类的 pod 的默认优先级。
+ 只有一个 PriorityClass 可以标记为 `globalDefault`。
+ 但是,如果存在多个 PriorityClasses 且其 `globalDefault` 字段设置为 true,
+ 则将使用此类全局默认 PriorityClasses 的最小值作为默认优先级。
+
+
+- **preemptionPolicy** (string)
+
+ PreemptionPolicy 是抢占优先级较低的 Pod 的策略。
+ 可选值:Never、PreemptLowerPriority。
+ 如果未设置,则默认为 PreemptLowerPriority。
+
+
+## PriorityClassList {#PriorityClassList}
+
+PriorityClassList 是优先级类的集合。
+
+
+
+
+- **apiVersion**: scheduling.k8s.io/v1
+
+
+- **kind**: PriorityClassList
+
+
+- **metadata** (}}">ListMeta)
+
+ 标准列表元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+
+
+- **items** ([]}}">PriorityClass),必需
+
+ items 是 PriorityClasses 的列表
+
+
+## 操作 {#Operations}
+
+
+
+
+### `get` 读取特定的 PriorityClass
+
+
+#### HTTP 请求
+
+GET /apis/scheduling.k8s.io/v1/priorityclasses/{name}
+
+
+#### 参数
+
+
+- **name** (*路径参数*): string,必需
+
+ PriorityClass 名称
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">PriorityClass): OK
+
+401: Unauthorized
+
+
+### `list` 列出或观察 PriorityClass类的对象
+
+
+#### HTTP 请求
+
+GET /apis/scheduling.k8s.io/v1/priorityclasses
+
+
+#### 参数
+
+
+- **allowWatchBookmarks** (*查询参数*): boolean
+
+ }}">allowWatchBookmarks
+
+
+- **continue** (*查询参数*): string
+
+ }}">continue
+
+
+- **fieldSelector** (*查询参数*): string
+
+ }}">fieldSelector
+
+
+- **labelSelector** (*查询参数*): string
+
+ }}">labelSelector
+
+
+- **limit** (*查询参数*): integer
+
+ }}">limit
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+- **resourceVersion** (*查询参数*): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (*查询参数*): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (*查询参数*): integer
+
+ }}">timeoutSeconds
+
+
+- **watch** (*查询参数*): boolean
+
+ }}">watch
+
+
+#### 响应
+
+200 (}}">PriorityClassList): OK
+
+401: Unauthorized
+
+
+### `create` 创建一个 PriorityClass
+
+
+#### HTTP 请求
+
+POST /apis/scheduling.k8s.io/v1/priorityclasses
+
+
+#### 参数
+
+
+- **body**: }}">PriorityClass,必需
+
+
+- **dryRun** (*查询参数*): string
+
+ }}">dryRun
+
+
+- **fieldManager** (*查询参数*): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (*查询参数*): string
+
+ }}">fieldValidation
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">PriorityClass): OK
+
+201 (}}">PriorityClass): Created
+
+202 (}}">PriorityClass): Accepted
+
+401: Unauthorized
+
+
+### `update` 替换指定的 PriorityClass
+
+
+#### HTTP 请求
+
+PUT /apis/scheduling.k8s.io/v1/priorityclasses/{name}
+
+
+#### 参数
+
+
+- **name** (*路径参数*): string,必需
+
+ PriorityClass 名称
+
+
+- **body**: }}">PriorityClass,必需
+
+
+- **dryRun** (*查询参数*): string
+
+ }}">dryRun
+
+
+- **fieldManager** (*查询参数*): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (*查询参数*): string
+
+ }}">fieldValidation
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+
+#### 响应
+
+200 (}}">PriorityClass): OK
+
+201 (}}">PriorityClass): Created
+
+401: Unauthorized
+
+
+
+### `patch` 部分更新特定的 PriorityClass
+
+
+#### HTTP 请求
+
+PATCH /apis/scheduling.k8s.io/v1/priorityclasses/{name}
+
+
+#### 参数
+
+
+- **name** (*路径参数*): string,必须
+
+ PriorityClass 名称
+
+
+- **body**: }}">Patch,必需
+
+
+- **dryRun** (*查询参数*): string
+
+ }}">dryRun
+
+
+- **fieldManager** (*查询参数*): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (*查询参数*): string
+
+ }}">fieldValidation
+
+
+- **force** (*查询参数*): boolean
+
+ }}">force
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">PriorityClass): OK
+
+201 (}}">PriorityClass): Created
+
+401: Unauthorized
+
+
+### `delete` 删除一个 PriorityClass
+
+
+#### HTTP 请求
+
+DELETE /apis/scheduling.k8s.io/v1/priorityclasses/{name}
+
+
+#### 参数
+
+
+- **name** (*路径参数*): string,必需
+
+ PriorityClass 名称。
+
+
+- **body**: }}">DeleteOptions
+
+
+- **dryRun** (*查询参数*): string
+
+ }}">dryRun
+
+
+- **gracePeriodSeconds** (*查询参数*): integer
+
+ }}">gracePeriodSeconds
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+- **propagationPolicy** (*查询参数*): string
+
+ }}">propagationPolicy
+
+
+#### 响应
+
+200 (}}">Status): OK
+
+202 (}}">Status): Accepted
+
+401: Unauthorized
+
+
+### `deletecollection` 删除 PriorityClass 集合
+
+
+#### HTTP 请求
+
+DELETE /apis/scheduling.k8s.io/v1/priorityclasses
+
+
+#### 参数
+
+
+- **body**: }}">DeleteOptions
+
+
+- **continue** (*查询参数*): string
+
+ }}">continue
+
+
+- **dryRun** (*查询参数*): string
+
+ }}">dryRun
+
+
+- **fieldSelector** (*查询参数*): string
+
+ }}">fieldSelector
+
+
+- **gracePeriodSeconds** (*查询参数*): integer
+
+ }}">gracePeriodSeconds
+
+
+- **labelSelector** (*查询参数*): string
+
+ }}">labelSelector
+
+
+- **limit** (*查询参数*): integer
+
+ }}">limit
+
+
+- **pretty** (*查询参数*): string
+
+ }}">pretty
+
+
+- **propagationPolicy** (*查询参数*): string
+
+ }}">propagationPolicy
+
+
+- **resourceVersion** (*查询参数*): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (*查询参数*): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (*查询参数*): integer
+
+ }}">timeoutSeconds
+
+
+#### 响应
+
+200 (}}">Status): OK
+
+401: Unauthorized
+
From d625ba8472d6cf9aa101ea12cf87127c531897c7 Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Tue, 17 May 2022 15:25:21 +0800
Subject: [PATCH 034/245] [zh] Sync Wikimedia case-study
---
content/zh/case-studies/wikimedia/index.html | 248 ++++++++++--------
.../wikimedia/wikimedia_featured.svg | 1 +
2 files changed, 140 insertions(+), 109 deletions(-)
create mode 100644 content/zh/case-studies/wikimedia/wikimedia_featured.svg
diff --git a/content/zh/case-studies/wikimedia/index.html b/content/zh/case-studies/wikimedia/index.html
index ab6452bfc3..8800c5f19e 100644
--- a/content/zh/case-studies/wikimedia/index.html
+++ b/content/zh/case-studies/wikimedia/index.html
@@ -1,118 +1,148 @@
---
title: 案例研究:Wikimedia
-
-class: gridPage
+case_study_styles: true
cid: caseStudies
+
+new_case_study_styles: true
+heading_title_text: Wikimedia
+use_gradient_overlay: true
+subheading: >
+ 利用 Kubernetes 构建工具提升世界的维基
+case_study_details:
+ - 公司: Wikimedia
+ - 地点: 加州旧金山
---
+
-
-
-
-
-
-
+
+
+
+"Wikimedia Tool Labs is vital for making sure wikis all around the world work as well as they possibly can. Because it's grown organically for almost 10 years, it has become an extremely challenging environment and difficult to maintain. It's like a big ball of mud — you really can't see through it. With Kubernetes, we're simplifying the environment and making it easier for developers to build the tools that make wikis run better."
+{{< /case-studies/quote >}}
+-->
+{{< case-studies/quote author="Yuvi Panda, Wikimedia 基金会和 Wikimedia 工具实验室的运维工程师">}}
-
-
-
@@ -1637,7 +1533,7 @@ If true, SO_REUSEADDR will be used when binding the port. This allows binding to
If true, SO_REUSEPORT will be used when binding the port, which allows more than one instance to bind on the same address and port. [default=false]
-->
如果为 true,则在绑定端口时将使用 SO_REUSEPORT,
-这允许多个实例在同一地址和端口上进行绑定。
+这允许多个实例在同一地址和端口上进行绑定。[默认值=false]。
@@ -1722,7 +1618,7 @@ The file path to a pod definition used as a template for HostPath persistent vol
对 NFS 卷执行回收利用时,用作模版的 Pod 定义文件所在路径。
@@ -1759,7 +1655,8 @@ The period for syncing persistent volumes and persistent volume claims
+List of client certificate common names to allow to provide usernames in headers specified by --requestheader-username-headers. If empty, any client certificate validated by the authorities in --requestheader-client-ca-file is allowed.
+-->
标志值是客户端证书中的 Common Names 列表。其中所列的名称可以通过
--requestheader-username-headers 所设置的 HTTP 头部来提供用户名。
如果此标志值为空表,则被 --requestheader-client-ca-file
@@ -1921,42 +1818,6 @@ The previous version for which you want to show hidden metrics. Only the previou
-
-
--skip-headers
-
-
-
-
-若此标志为 true,则在日志消息中避免写入头部前缀信息。
-
-
-
-
-
--skip-log-headers
-
-
-
-
-若此标志为 true,则在写入日志文件时避免写入头部信息。
-
-
-
-
-
--stderrthreshold severity 默认值:2
-
-
-
-
-等于或大于此阈值的日志信息会被写入到标准错误输出(stderr)。
-
-
-
--terminated-pod-gc-threshold int32 默认值:12500
@@ -1992,11 +1853,11 @@ File containing the default x509 Certificate for HTTPS. (CA cert, if any, concat
集群中 Pod 的 CIDR 范围。配置后,将从该范围之外发送到服务集群 IP
-的流量被伪装,从 Pod 发送到外部 LoadBalancer IP 的流量将被重定向
-到相应的集群 IP。
+的流量被伪装,从 Pod 发送到外部 LoadBalancer IP
+的流量将被重定向到相应的集群 IP。
+对于双协议栈集群,接受一个逗号分隔的列表,
+每个 IP 协议族(IPv4 和 IPv6)至少包含一个 CIDR。
+如果配置文件由 --config 指定,则忽略此参数。
@@ -238,13 +242,42 @@ Idle timeout for established TCP connections (0 to leave as-is)
+
+
--default-not-ready-toleration-seconds int 默认值:300
+
+
+
+
+对污点 NotReady:NoExecute 的容忍时长(以秒计)。
+默认情况下这一容忍度会被添加到尚未具有此容忍度的每个 pod 中。
+
+
+
+
+
--default-unreachable-toleration-seconds int 默认值:300
+
+
+
+
+对污点 Unreachable:NoExecute 的容忍时长(以秒计)
+默认情况下这一容忍度会被添加到尚未具有此容忍度的每个 pod 中。
+
diff --git a/content/zh/docs/reference/using-api/deprecation-guide.md b/content/zh/docs/reference/using-api/deprecation-guide.md
index 7b5ed5b7b9..f088f3453a 100644
--- a/content/zh/docs/reference/using-api/deprecation-guide.md
+++ b/content/zh/docs/reference/using-api/deprecation-guide.md
@@ -373,14 +373,14 @@ The **authentication.k8s.io/v1beta1** API version of TokenReview is no longer se
#### SubjectAccessReview resources {#subjectaccessreview-resources-v122}
**authorization.k8s.io/v1beta1** API 版本的 LocalSubjectAccessReview、
-SelfSubjectAccessReview、SubjectAccessReview 不在 v1.22 版本中继续提供。
+SelfSubjectAccessReview、SubjectAccessReview、SelfSubjectRulesReview 不在 v1.22 版本中继续提供。
* 迁移清单和 API 客户端使用 **authorization.k8s.io/v1** API 版本,此 API 从
v1.6 版本开始可用;
@@ -762,4 +762,3 @@ resource, check the Kubernetes [API reference](/docs/reference/kubernetes-api/).
-->
注意这种操作生成的结果中可能使用的默认值并不理想。
要进一步了解某个特定资源,可查阅 Kubernetes [API 参考](/zh/docs/reference/kubernetes-api/)。
-
From c992c4c04f912008ab5cbbcc6a0f546053b67a07 Mon Sep 17 00:00:00 2001
From: Qiming Teng
Date: Wed, 18 May 2022 14:20:20 +0800
Subject: [PATCH 036/245] Add imagepolicy.v1alpha1 API
---
content/en/docs/reference/_index.md | 2 +
.../admission-controllers.md | 27 ++-
.../config-api/imagepolicy.v1alpha1.md | 168 ++++++++++++++++++
3 files changed, 183 insertions(+), 14 deletions(-)
create mode 100644 content/en/docs/reference/config-api/imagepolicy.v1alpha1.md
diff --git a/content/en/docs/reference/_index.md b/content/en/docs/reference/_index.md
index c4e217af2a..403b84f7c2 100644
--- a/content/en/docs/reference/_index.md
+++ b/content/en/docs/reference/_index.md
@@ -77,6 +77,7 @@ operator to use or manage a cluster.
* [kube-apiserver configuration (v1alpha1)](/docs/reference/config-api/apiserver-config.v1alpha1/)
* [kube-apiserver configuration (v1)](/docs/reference/config-api/apiserver-config.v1/)
* [kube-apiserver encryption (v1)](/docs/reference/config-api/apiserver-encryption.v1/)
+* [kube-apiserver event rate limit (v1alpha1)](/docs/reference/config-api/apiserver-eventratelimit.v1/)
* [kubelet configuration (v1alpha1)](/docs/reference/config-api/kubelet-config.v1alpha1/) and
[kubelet configuration (v1beta1)](/docs/reference/config-api/kubelet-config.v1beta1/)
* [kubelet credential providers (v1alpha1)](/docs/reference/config-api/kubelet-credentialprovider.v1alpha1/)
@@ -88,6 +89,7 @@ operator to use or manage a cluster.
* [Client authentication API (v1beta1)](/docs/reference/config-api/client-authentication.v1beta1/) and
[Client authentication API (v1)](/docs/reference/config-api/client-authentication.v1/)
* [WebhookAdmission configuration (v1)](/docs/reference/config-api/apiserver-webhookadmission.v1/)
+* [ImagePolicy API (v1alpha1)](/docs/reference/config-api/imagepolicy.v1alpha1/)
## Config API for kubeadm
diff --git a/content/en/docs/reference/access-authn-authz/admission-controllers.md b/content/en/docs/reference/access-authn-authz/admission-controllers.md
index e37059784c..e2a3d63e62 100644
--- a/content/en/docs/reference/access-authn-authz/admission-controllers.md
+++ b/content/en/docs/reference/access-authn-authz/admission-controllers.md
@@ -356,19 +356,21 @@ users:
For additional HTTP configuration, refer to the
[kubeconfig](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) documentation.
-#### Request Payloads
+#### Request payloads
When faced with an admission decision, the API Server POSTs a JSON serialized
`imagepolicy.k8s.io/v1alpha1` `ImageReview` object describing the action.
This object contains fields describing the containers being admitted, as well as
any pod annotations that match `*.image-policy.k8s.io/*`.
-Note that webhook API objects are subject to the same versioning compatibility rules
+{{ note }}
+The webhook API objects are subject to the same versioning compatibility rules
as other Kubernetes API objects. Implementers should be aware of looser compatibility
-promises for alpha objects and check the "apiVersion" field of the request to
+promises for alpha objects and check the `apiVersion` field of the request to
ensure correct deserialization.
Additionally, the API Server must enable the `imagepolicy.k8s.io/v1alpha1` API extensions
group (`--runtime-config=imagepolicy.k8s.io/v1alpha1=true`).
+{{ /note }}
An example request body:
@@ -420,8 +422,8 @@ To disallow access, the service would return:
}
```
-For further documentation refer to the `imagepolicy.v1alpha1` API objects and
-`plugin/pkg/admission/imagepolicy/admission.go`.
+For further documentation refer to the
+[`imagepolicy.v1alpha1` API](/docs/reference/config-api/imagepolicy.v1alpha1/).
#### Extending with Annotations
@@ -432,9 +434,9 @@ accept different information.
Examples of information you might put here are:
- * request to "break glass" to override a policy, in case of emergency.
- * a ticket number from a ticket system that documents the break-glass request
- * provide a hint to the policy server as to the imageID of the image being provided, to save it a lookup
+* request to "break glass" to override a policy, in case of emergency.
+* a ticket number from a ticket system that documents the break-glass request
+* provide a hint to the policy server as to the imageID of the image being provided, to save it a lookup
In any case, the annotations are provided by the user and are not validated by Kubernetes in any way.
@@ -469,8 +471,7 @@ webhooks or validating admission controllers will permit the request to finish.
If you disable the MutatingAdmissionWebhook, you must also disable the
`MutatingWebhookConfiguration` object in the `admissionregistration.k8s.io/v1`
-group/version via the `--runtime-config` flag (both are on by default in
-versions >= 1.9).
+group/version via the `--runtime-config` flag, both are on by default.
#### Use caution when authoring and installing mutating webhooks
@@ -599,7 +600,7 @@ Starting from 1.11, this admission controller is disabled by default.
This admission controller defaults and limits what node selectors may be used within a namespace
by reading a namespace annotation and a global configuration.
-#### Configuration File Format
+#### Configuration file format
`PodNodeSelector` uses a configuration file to set options for the behavior of the backend.
Note that the configuration file format will move to a versioned file in a future release.
@@ -649,9 +650,7 @@ This admission controller has the following behavior:
3. Evaluate the pod's node selector against the namespace node selector for conflicts. Conflicts
result in rejection.
4. Evaluate the pod's node selector against the namespace-specific allowed selector defined the
- plugin configuration file.
-
-Conflicts result in rejection.
+ plugin configuration file. Conflicts result in rejection.
{{< note >}}
PodNodeSelector allows forcing pods to run on specifically labeled nodes. Also see the PodTolerationRestriction
diff --git a/content/en/docs/reference/config-api/imagepolicy.v1alpha1.md b/content/en/docs/reference/config-api/imagepolicy.v1alpha1.md
new file mode 100644
index 0000000000..f420623559
--- /dev/null
+++ b/content/en/docs/reference/config-api/imagepolicy.v1alpha1.md
@@ -0,0 +1,168 @@
+---
+title: Image Policy API (v1alpha1)
+content_type: tool-reference
+package: imagepolicy.k8s.io/v1alpha1
+auto_generated: true
+---
+
+
+## Resource Types
+
+
+- [ImageReview](#imagepolicy-k8s-io-v1alpha1-ImageReview)
+
+
+
+## `ImageReview` {#imagepolicy-k8s-io-v1alpha1-ImageReview}
+
+
+
+
ImageReview checks if the set of images in a pod are allowed.
Containers is a list of a subset of the information in each container of the Pod being created.
+
+
+
annotations
+map[string]string
+
+
+
Annotations is a list of key-value pairs extracted from the Pod's annotations.
+It only includes keys which match the pattern *.image-policy.k8s.io/*.
+It is up to each webhook backend to determine how to interpret these annotations, if at all.
+
+
+
namespace
+string
+
+
+
Namespace is the namespace the pod is being created in.
ImageReviewStatus is the result of the review for the pod creation request.
+
+
+
+
Field
Description
+
+
+
+
allowed[Required]
+bool
+
+
+
Allowed indicates that all images were allowed to be run.
+
+
+
reason
+string
+
+
+
Reason should be empty unless Allowed is false in which case it
+may contain a short description of what is wrong. Kubernetes
+may truncate excessively long errors when displaying to the user.
+
+
+
auditAnnotations
+map[string]string
+
+
+
AuditAnnotations will be added to the attributes object of the
+admission controller request using 'AddAnnotation'. The keys should
+be prefix-less (i.e., the admission controller will add an
+appropriate prefix).
+
+
+
+
+
\ No newline at end of file
From 9b3cfc95a1f2633efeace29ba3e427a7dcfcd7ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krzysztof=20D=C4=85browski?=
Date: Wed, 18 May 2022 08:39:28 +0200
Subject: [PATCH 037/245] Volume Populators: fix feature gate name
---
content/en/blog/_posts/2022-05-16-volume-populators-beta.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/blog/_posts/2022-05-16-volume-populators-beta.md b/content/en/blog/_posts/2022-05-16-volume-populators-beta.md
index 06e81608c2..4558f07eae 100644
--- a/content/en/blog/_posts/2022-05-16-volume-populators-beta.md
+++ b/content/en/blog/_posts/2022-05-16-volume-populators-beta.md
@@ -8,7 +8,7 @@ slug: volume-populators-beta
**Author:**
Ben Swartzlander (NetApp)
-The volume populators feature is now two releases old and entering beta! The `AnyVolumeDataSouce` feature
+The volume populators feature is now two releases old and entering beta! The `AnyVolumeDataSource` feature
gate defaults to enabled in Kubernetes v1.24, which means that users can specify any custom resource
as the data source of a PVC.
From a7ce430bddc10ed7eaa421296db884ef83920ef8 Mon Sep 17 00:00:00 2001
From: lishuai-hw <100905494+lishuai-hw@users.noreply.github.com>
Date: Wed, 18 May 2022 14:44:53 +0800
Subject: [PATCH 038/245] translate this page into Chinese:
https://kubernetes.io/blog/2022/03/31/ready-for-dockershim-removal/ (#33762)
* translate this page into Chinese: https://kubernetes.io/blog/2022/01/10/meet-our-contributors-india-ep-01/
* translate this page into Chinese (add one space before/after English words): https://kubernetes.io/blog/2022/01/10/meet-our-contributors-india-ep-01/
* translate this page into Chinese (add one space before/after English words): https://kubernetes.io/blog/2022/01/10/meet-our-contributors-india-ep-01/
* ISSUE: https://github.com/kubernetes/website/issues/33627
Chinese translation docs: https://kubernetes.io/blog/2022/05/06/storage-capacity-ga/
* ISSUE: https://github.com/kubernetes/website/issues/33627
Chinese translation docs: https://kubernetes.io/blog/2022/05/06/storage-capacity-ga/. According to other member's suggestion, modify the translation.
* ISSUE: https://github.com/kubernetes/website/issues/33754
This page does not have Chinese docs: https://kubernetes.io/blog/2022/03/31/ready-for-dockershim-removal/
Add Chinese translation docs in website Kubernetes Blog.
ISSUE: https://github.com/kubernetes/website/issues/33754
This page does not have Chinese docs: https://kubernetes.io/blog/2022/03/31/ready-for-dockershim-removal/
Add Chinese translation docs in website Kubernetes Blog.
---
...2022-03-31-ready-for-dockershim-removal.md | 111 ++++++++++++++++++
1 file changed, 111 insertions(+)
create mode 100644 content/zh/blog/_posts/2022-03-31-ready-for-dockershim-removal.md
diff --git a/content/zh/blog/_posts/2022-03-31-ready-for-dockershim-removal.md b/content/zh/blog/_posts/2022-03-31-ready-for-dockershim-removal.md
new file mode 100644
index 0000000000..d5b6d10ae5
--- /dev/null
+++ b/content/zh/blog/_posts/2022-03-31-ready-for-dockershim-removal.md
@@ -0,0 +1,111 @@
+---
+layout: blog
+title: "你的集群准备好使用 v1.24 版本了吗?"
+date: 2022-03-31
+slug: ready-for-dockershim-removal
+---
+
+
+
+**作者:** Kat Cosgrove
+
+
+
+早在 2020 年 12 月,Kubernetes 就宣布[弃用 Dockershim](/zh/blog/2020/12/02/dont-panic-kubernetes-and-docker/)。
+在 Kubernetes 中,dockershim 是一个软件 shim,
+它允许你将整个 Docker 引擎用作 Kubernetes 中的容器运行时。
+在即将发布的 v1.24 版本中,我们将移除 Dockershim -
+在宣布弃用之后到彻底移除这段时间内,我们至少预留了一年的时间继续支持此功能,
+这符合相关的[项目策略](/zh/docs/reference/using-api/deprecation-policy/)。
+如果你是集群操作员,则该指南包含你在此版本中需要了解的实际情况。
+另外还包括你需要做些什么来确保你的集群不会崩溃!
+
+
+## 首先,这对你有影响吗?
+
+
+如果你正在管理自己的集群或不确定此删除是否会影响到你,
+请保持安全状态并[检查你对 Docker Engine 是否有依赖](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-removal-affects-you/)。
+请注意,使用 Docker Desktop 构建应用程序容器并不算是集群对 Docker 有依赖。
+Docker 创建的容器镜像符合 [Open Container Initiative (OCI)](https://opencontainers.org/) 规范,
+而 OCI 是 Linux 基金会的一种治理架构,负责围绕容器格式和运行时定义行业标准。
+这些镜像可以在 Kubernetes 支持的任何容器运行时上正常工作。
+
+
+如果你使用的是云服务提供商管理的 Kubernetes 服务,
+并且你确定没有更改过容器运行时,那么你可能不需要做任何事情。
+Amazon EKS、Azure AKS 和 Google GKE 现在都默认使用 containerd,
+但如果你的集群中有任何自定义的节点,你要确保它们不需要被更新。
+要检查节点的运行时,请参考[查明节点上所使用的容器运行时](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use/)。
+
+
+无论你是在管理自己的集群还是使用云服务提供商管理的 Kubernetes 服务,
+你可能都需要[迁移依赖 Docker Engine 的遥测或安全代理](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/)。
+
+
+## 我对 Docker 有依赖。现在该怎么办?
+
+
+如果你的 Kubernetes 集群对 Docker Engine 有依赖,
+并且你打算升级到 Kubernetes v1.24 版本(出于安全和类似原因,你最终应该这样做),
+你需要将容器运行时从 Docker Engine 更改为其他方式或使用 [cri-dockerd](https://github.com/Mirantis/cri-dockerd)。
+由于 [containerd](https://containerd.io/) 是一个已经毕业的 CNCF 项目,
+并且是 Docker 本身的运行时,因此用它作为容器运行时的替代方式是一个安全的选择。
+幸运的是,Kubernetes 项目已经以 containerd 为例,
+提供了[更改节点容器运行时](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd/)的过程文档。
+切换到其它支持的运行时的操作指令与此类似。
+
+
+## 我想升级 Kubernetes,并且我需要保持与 Docker 作为运行时的兼容性。我有哪些选择?
+
+
+别担心,你不会被冷落,也不必冒着安全风险继续使用旧版本的 Kubernetes。
+Mirantis 和 Docker 已经联合发布并正在维护 dockershim 的替代品。
+这种替代品称为 [cri-dockerd](https://github.com/Mirantis/cri-dockerd)。
+如果你确实需要保持与 Docker 作为运行时的兼容性,请按照项目文档中的说明安装 cri-dockerd。
+
+
+## 这样就可以了吗?
+
+
+
+是的。只要你深入了解此版本所做的变更和你自己集群的详细信息,
+并确保与你的开发团队进行清晰的沟通,它的不确定性就会降到最低。
+你可能需要对集群、应用程序代码或脚本进行一些更改,但所有这些要求都已经有说明指导。
+从使用 Docker Engine 作为运行时,切换到使用[其他任何一种支持的容器运行时](/zh/docs/setup/production-environment/container-runtimes/),
+这意味着移除了中间层的组件,因为 dockershim 的作用是访问 Docker 本身使用的容器运行时。
+从实际角度长远来看,这种移除对你和 Kubernetes 维护者都更有好处。
+
+
+如果你仍有疑问,请先查看[弃用 Dockershim 的常见问题](/zh/blog/2022/02/17/dockershim-faq/)。
From c9d2ffe716d7cfbeffa81c5b8c2212706bc6d804 Mon Sep 17 00:00:00 2001
From: Michael
Date: Wed, 18 May 2022 12:16:34 +0800
Subject: [PATCH 039/245] good first issues about link and consistency
---
.../common-definitions/delete-options.md | 12 +++++-----
.../common-definitions/label-selector.md | 23 +++++++++++--------
2 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/content/zh/docs/reference/kubernetes-api/common-definitions/delete-options.md b/content/zh/docs/reference/kubernetes-api/common-definitions/delete-options.md
index a4bd2e0405..0ffff678d3 100644
--- a/content/zh/docs/reference/kubernetes-api/common-definitions/delete-options.md
+++ b/content/zh/docs/reference/kubernetes-api/common-definitions/delete-options.md
@@ -4,8 +4,8 @@ api_metadata:
import: "k8s.io/apimachinery/pkg/apis/meta/v1"
kind: "DeleteOptions"
content_type: "api_reference"
-description: "删除 API 对象时可能会提供删除选项。"
-title: "删除选项"
+description: "删除 API 对象时可以提供 DeleteOptions。"
+title: "DeleteOptions"
weight: 1
auto_generated: true
---
@@ -25,7 +25,7 @@ auto_generated: true
`import "k8s.io/apimachinery/pkg/apis/meta/v1"`
-删除 API 对象时可能会提供 DeleteOptions。
+删除 API 对象时可以提供 DeleteOptions。
@@ -39,7 +39,7 @@ auto_generated: true
`APIVersion` 定义对象表示的版本化模式。
服务器应将已识别的模式转换为最新的内部值,并可能拒绝无法识别的值。
- 更多信息:https ://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+
标签选择器是对一组资源的标签查询。
-`matchLabels` 和 `matchExpressions` 的结果按逻辑与的关系组合。一个 `empty` 标签选择器匹配所有对象。一个 `null` 标签选择器不匹配任何对象。
+`matchLabels` 和 `matchExpressions` 的结果按逻辑与的关系组合。
+一个 `empty` 标签选择器匹配所有对象。一个 `null` 标签选择器不匹配任何对象。
@@ -42,7 +45,7 @@ weight: 2
- **matchExpressions** ([]LabelSelectorRequirement)
- `matchExpressions` 是 `LabelSelectorRequirement` 的列表,这些需求结果按逻辑与的关系来计算。
+ `matchExpressions` 是标签选择器要求的列表,这些要求的结果按逻辑与的关系来计算。
*标签选择器要求是包含值、键和关联键和值的运算符的选择器。*
@@ -55,9 +58,9 @@ weight: 2
- **matchExpressions.key** (string), 必填
- *补丁策略: 按照键 `key` 合并*
+ *补丁策略:按照键 `key` 合并*
- `key` 是选择器应用的标签键.
+ `key` 是选择器应用的标签键。
+
+
+生成供 API 服务器连接 kubelet 的证书
-
-生成供 API 服务器连接 kubelet 的证书,并将其保存到 apiserver-kubelet-client.cert 和 apiserver-kubelet-client.key 文件中。
+生成供 API 服务器连接 kubelet 的证书,并将其保存到 apiserver-kubelet-client.crt 和 apiserver-kubelet-client.key 文件中。
-存储证书的路径。
+
存储证书的路径。
@@ -63,9 +77,9 @@ The path where to save and store the certificates.
From 56e597ced4cd5ec7310ca5522131347f2850ba6d Mon Sep 17 00:00:00 2001
From: Quan Tian
Date: Wed, 18 May 2022 11:59:07 +0800
Subject: [PATCH 045/245] Fix links about apiserver proxy
* The link in access-cluster.md is stale
* service name segment of apiserver proxy must have trailing colon when
schema is specified
* Replace apiserver address with a reserved documentation IP address
Signed-off-by: Quan Tian
---
.../access-cluster-services.md | 20 +++++++++----------
.../access-cluster.md | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/content/en/docs/tasks/access-application-cluster/access-cluster-services.md b/content/en/docs/tasks/access-application-cluster/access-cluster-services.md
index 262071094c..456662692e 100644
--- a/content/en/docs/tasks/access-application-cluster/access-cluster-services.md
+++ b/content/en/docs/tasks/access-application-cluster/access-cluster-services.md
@@ -64,17 +64,17 @@ kubectl cluster-info
The output is similar to this:
```
-Kubernetes master is running at https://104.197.5.247
-elasticsearch-logging is running at https://104.197.5.247/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy
-kibana-logging is running at https://104.197.5.247/api/v1/namespaces/kube-system/services/kibana-logging/proxy
-kube-dns is running at https://104.197.5.247/api/v1/namespaces/kube-system/services/kube-dns/proxy
-grafana is running at https://104.197.5.247/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
-heapster is running at https://104.197.5.247/api/v1/namespaces/kube-system/services/monitoring-heapster/proxy
+Kubernetes master is running at https://192.0.2.1
+elasticsearch-logging is running at https://192.0.2.1/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy
+kibana-logging is running at https://192.0.2.1/api/v1/namespaces/kube-system/services/kibana-logging/proxy
+kube-dns is running at https://192.0.2.1/api/v1/namespaces/kube-system/services/kube-dns/proxy
+grafana is running at https://192.0.2.1/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
+heapster is running at https://192.0.2.1/api/v1/namespaces/kube-system/services/monitoring-heapster/proxy
```
This shows the proxy-verb URL for accessing each service.
For example, this cluster has cluster-level logging enabled (using Elasticsearch), which can be reached
-at `https://104.197.5.247/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/` if suitable credentials are passed, or through a kubectl proxy at, for example:
+at `https://192.0.2.1/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/` if suitable credentials are passed, or through a kubectl proxy at, for example:
`http://localhost:8080/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/`.
{{< note >}}
@@ -104,13 +104,13 @@ The supported formats for the `` segment of the URL are:
* To access the Elasticsearch service endpoint `_search?q=user:kimchy`, you would use:
```
- http://104.197.5.247/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/_search?q=user:kimchy
+ http://192.0.2.1/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/_search?q=user:kimchy
```
* To access the Elasticsearch cluster health information `_cluster/health?pretty=true`, you would use:
```
- https://104.197.5.247/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/_cluster/health?pretty=true
+ https://192.0.2.1/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy/_cluster/health?pretty=true
```
The health information is similar to this:
@@ -133,7 +133,7 @@ The supported formats for the `` segment of the URL are:
* To access the *https* Elasticsearch service health information `_cluster/health?pretty=true`, you would use:
```
- https://104.197.5.247/api/v1/namespaces/kube-system/services/https:elasticsearch-logging/proxy/_cluster/health?pretty=true
+ https://192.0.2.1/api/v1/namespaces/kube-system/services/https:elasticsearch-logging:/proxy/_cluster/health?pretty=true
```
#### Using web browsers to access services running on the cluster
diff --git a/content/en/docs/tasks/access-application-cluster/access-cluster.md b/content/en/docs/tasks/access-application-cluster/access-cluster.md
index aae96d3e96..f20fe407e8 100644
--- a/content/en/docs/tasks/access-application-cluster/access-cluster.md
+++ b/content/en/docs/tasks/access-application-cluster/access-cluster.md
@@ -233,7 +233,7 @@ There are several different proxies you may encounter when using Kubernetes:
- locates apiserver
- adds authentication headers
-1. The [apiserver proxy](#discovering-builtin-services):
+1. The [apiserver proxy](/docs/tasks/access-application-cluster/access-cluster-services/#discovering-builtin-services):
- is a bastion built into the apiserver
- connects a user outside of the cluster to cluster IPs which otherwise might not be reachable
From e720b00698a033cb124a2a6320a57bee71852cb7 Mon Sep 17 00:00:00 2001
From: huangminjie
Date: Wed, 18 May 2022 23:14:16 +0800
Subject: [PATCH 046/245] [zh] sync v1.24 kubeadm-20
---
.../kubeadm/generated/kubeadm_config.md | 34 +++++++++---
.../generated/kubeadm_config_migrate.md | 44 ++++++++++-----
.../kubeadm/generated/kubeadm_join_phase.md | 27 ++++++++--
..._phase_control-plane-join_update-status.md | 53 ++++++++++++++-----
4 files changed, 120 insertions(+), 38 deletions(-)
diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config.md
index 3d15456c8d..b45cb94f1c 100644
--- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config.md
+++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config.md
@@ -1,3 +1,18 @@
+
+
+
+管理持久化在 ConfigMap 中的 kubeadm 集群的配置
-config 操作的帮助命令
+
+
@@ -353,9 +380,9 @@ Use this token for both discovery-token and tls-bootstrap-token when those value
-[实验] 指向 '真实' 宿主机根文件系统的路径。
+
[实验] 指向 '真实' 宿主机根文件系统的路径。
From 64d998e2974c6f7cdbb7d70f3edbe44495869442 Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Wed, 18 May 2022 23:26:36 +0800
Subject: [PATCH 051/245] [zh] Adjust kubeadm-certs.md format
---
.../kubeadm/kubeadm-certs.md | 155 +++++++++---------
1 file changed, 77 insertions(+), 78 deletions(-)
diff --git a/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md b/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md
index df303140ce..2004388301 100644
--- a/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md
+++ b/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md
@@ -15,11 +15,10 @@ weight: 10
{{< feature-state for_k8s_version="v1.15" state="stable" >}}
-
由 [kubeadm](/zh/docs/reference/setup-tools/kubeadm/) 生成的客户端证书在 1 年后到期。
本页说明如何使用 kubeadm 管理证书续订,同时也涵盖其他与 kubeadm 证书管理相关的说明。
@@ -42,16 +41,16 @@ You can override this behavior by providing your own certificates.
## 使用自定义的证书 {#custom-certificates}
-默认情况下, kubeadm 会生成运行一个集群所需的全部证书。
+默认情况下,kubeadm 会生成运行一个集群所需的全部证书。
你可以通过提供你自己的证书来改变这个行为策略。
-如果要这样做, 你必须将证书文件放置在通过 `--cert-dir` 命令行参数或者 kubeadm 配置中的
-`CertificatesDir` 配置项指明的目录中。默认的值是 `/etc/kubernetes/pki`。
+如果要这样做,你必须将证书文件放置在通过 `--cert-dir` 命令行参数或者 kubeadm 配置中的
+`certificatesDir` 配置项指明的目录中。默认的值是 `/etc/kubernetes/pki`。
如果在运行 `kubeadm init` 之前存在给定的证书和私钥对,kubeadm 将不会重写它们。
-例如,这意味着您可以将现有的 CA 复制到 `/etc/kubernetes/pki/ca.crt` 和
+例如,这意味着你可以将现有的 CA 复制到 `/etc/kubernetes/pki/ca.crt` 和
`/etc/kubernetes/pki/ca.key` 中,而 kubeadm 将使用此 CA 对其余证书进行签名。
## 外部 CA 模式 {#external-ca-mode}
@@ -83,7 +83,7 @@ this condition and activates the "External CA" mode. kubeadm will proceed withou
Instead, run the controller-manager standalone with `--controllers=csrsigner` and
point to the CA certificate and key.
-->
-否则, kubeadm 将独立运行 controller-manager,附加一个
+否则,kubeadm 将独立运行 controller-manager,附加一个
`--controllers=csrsigner` 的参数,并且指明 CA 证书和密钥。
[PKI 证书和要求](/zh/docs/setup/best-practices/certificates/)包括集群使用外部 CA 的设置指南。
-
-## 检查证书是否过期
+## 检查证书是否过期 {#check-certificate-expiration}
你可以使用 `check-expiration` 子命令来检查证书何时过期
@@ -105,8 +105,8 @@ You can use the `check-expiration` subcommand to check when certificates expire:
kubeadm certs check-expiration
```
-
输出类似于以下内容:
@@ -129,17 +129,17 @@ etcd-ca Dec 28, 2029 23:36 UTC 9y no
front-proxy-ca Dec 28, 2029 23:36 UTC 9y no
```
-
-该命令显示 `/etc/kubernetes/pki` 文件夹中的客户端证书以及
-kubeadm(`admin.conf`, `controller-manager.conf` 和 `scheduler.conf`)
+该命令显示 `/etc/kubernetes/pki` 文件夹中的客户端证书以及
+kubeadm(`admin.conf`、`controller-manager.conf` 和 `scheduler.conf`)
使用的 KUBECONFIG 文件中嵌入的客户端证书的到期时间/剩余时间。
-
-另外, kubeadm 会通知用户证书是否由外部管理;
+另外,kubeadm 会通知用户证书是否由外部管理;
在这种情况下,用户应该小心的手动/使用其他工具来管理证书更新。
{{< note >}}
上面的列表中没有包含 `kubelet.conf`,因为 kubeadm 将 kubelet 配置为
-[自动更新证书](/docs/tasks/tls/certificate-rotation/)。
+[自动更新证书](/zh/docs/tasks/tls/certificate-rotation/)。
轮换的证书位于目录 `/var/lib/kubelet/pki`。
要修复过期的 kubelet 客户端证书,请参阅
[kubelet 客户端证书轮换失败](/zh/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/#kubelet-client-cert)。
@@ -183,35 +183,35 @@ client-key: /var/lib/kubelet/pki/kubelet-client-current.pem
```
{{< /warning >}}
-
-## 自动更新证书
+## 自动更新证书 {#automatic-certificate-renewal}
-`kubeadm` 会在控制面
+kubeadm 会在控制面
[升级](/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/)
的时候更新所有证书。
-
这个功能旨在解决最简单的用例;如果你对此类证书的更新没有特殊要求,
并且定期执行 Kubernetes 版本升级(每次升级之间的间隔时间少于 1 年),
则 kubeadm 将确保你的集群保持最新状态并保持合理的安全性。
-
{{< note >}}
最佳的做法是经常升级集群以确保安全。
{{< /note >}}
-
如果你对证书更新有更复杂的需求,则可通过将 `--certificate-renewal=false` 传递给
`kubeadm upgrade apply` 或者 `kubeadm upgrade node`,从而选择不采用默认行为。
@@ -227,16 +227,16 @@ kubeadm 在 1.17 版本之前有一个[缺陷](https://github.com/kubernetes/kub
在这种情况下,你需要显式地设置 `--certificate-renewal=true`。
{{< /warning >}}
-
-## 手动更新证书
+## 手动更新证书 {#manual-certificate-renewal}
你能随时通过 `kubeadm certs renew` 命令手动更新你的证书。
-
-此命令用 CA (或者 front-proxy-CA )证书和存储在 `/etc/kubernetes/pki` 中的密钥执行更新。
+此命令用 CA(或者 front-proxy-CA )证书和存储在 `/etc/kubernetes/pki` 中的密钥执行更新。
执行完此命令之后你需要重启控制面 Pods。因为动态证书重载目前还不被所有组件和证书支持,所有这项操作是必须的。
[静态 Pods](/zh/docs/tasks/configure-pod-container/static-pod/) 是被本地 kubelet 而不是 API Server 管理,
所以 kubectl 不能用来删除或重启他们。
要重启静态 Pod 你可以临时将清单文件从 `/etc/kubernetes/manifests/` 移除并等待 20 秒
-(参考 [KubeletConfiguration 结构](/docs/reference/config-api/kubelet-config.v1beta1/) 中的`fileCheckFrequency` 值)。
+(参考 [KubeletConfiguration 结构](/zh/docs/reference/config-api/kubelet-config.v1beta1/) 中的`fileCheckFrequency` 值)。
如果 Pod 不在清单目录里,kubelet 将会终止它。
在另一个 `fileCheckFrequency` 周期之后你可以将文件移回去,为了组件可以完成 kubelet 将重新创建 Pod 和证书更新。
-
{{< warning >}}
如果你运行了一个 HA 集群,这个命令需要在所有控制面板节点上执行。
{{< /warning >}}
-
{{< note >}}
-`certs renew` 使用现有的证书作为属性 (Common Name、Organization、SAN 等) 的权威来源,
-而不是 kubeadm-config ConfigMap 。强烈建议使它们保持同步。
+`certs renew` 使用现有的证书作为属性(Common Name、Organization、SAN 等)的权威来源,
+而不是 kubeadm-config ConfigMap。强烈建议使它们保持同步。
{{< /note >}}
-`kubeadm certs renew`提供以下选项:
+`kubeadm certs renew` 提供以下选项:
Kubernetes 证书通常在一年后到期。
-
@@ -297,14 +296,14 @@ Kubernetes 证书通常在一年后到期。
-## 用 Kubernetes 证书 API 更新证书
+## 用 Kubernetes 证书 API 更新证书 {#renew-certificates-with-the-kubernetes-certificates-api}
本节提供有关如何使用 Kubernetes 证书 API 执行手动证书更新的更多详细信息。
-
{{< caution >}}
这些是针对需要将其组织的证书基础结构集成到 kubeadm 构建的集群中的用户的高级主题。
@@ -317,10 +316,10 @@ These are advanced topics for users who need to integrate their organization's c
The Kubernetes Certificate Authority does not work out of the box.
You can configure an external signer such as [cert-manager](https://cert-manager.io/docs/configuration/ca/), or you can use the built-in signer.
The built-in signer is part of [`kube-controller-manager`](/docs/reference/command-line-tools-reference/kube-controller-manager/).
-To activate the build-in signer, you must pass the `--cluster-signing-cert-file` and `--cluster-signing-key-file` flags.
+To activate the built-in signer, you must pass the `--cluster-signing-cert-file` and `--cluster-signing-key-file` flags.
-->
-### 设置一个签名者(Signer)
+### 设置一个签名者(Signer) {#set-up-a-signer}
Kubernetes 证书颁发机构不是开箱即用。你可以配置外部签名者,例如 [cert-manager](https://cert-manager.io/docs/configuration/ca/),
也可以使用内置签名者。
@@ -343,10 +342,10 @@ controllerManager:
cluster-signing-key-file: /etc/kubernetes/pki/ca.key
```
-
-### 创建证书签名请求 (CSR)
+### 创建证书签名请求 (CSR) {#create-certificate-signing-requests-csr}
-## 通过外部 CA 更新证书
+## 通过外部 CA 更新证书 {#renew-certificates-with-external-ca}
本节提供有关如何使用外部 CA 执行手动更新证书的更多详细信息。
@@ -372,8 +371,8 @@ In kubeadm terms, any certificate that would normally be signed by an on-disk CA
CSR 表示向 CA 请求客户的签名证书。
在 kubeadm 术语中,通常由磁盘 CA 签名的任何证书都可以作为 CSR 生成。但是,CA 不能作为 CSR 生成。
-
-### 创建证书签名请求 (CSR)
+### 创建证书签名请求 (CSR) {#create-certificate-signing-requests-csr-1}
你可以通过 `kubeadm certs renew --csr-only` 命令创建证书签名请求。
CSR 和随附的私钥都在输出中给出。
你可以传入一个带有 `--csr-dir` 的目录,将 CRS 输出到指定位置。
-如果未指定 `--csr-dir` ,则使用默认证书目录(`/etc/kubernetes/pki`)。
+如果未指定 `--csr-dir`,则使用默认证书目录(`/etc/kubernetes/pki`)。
使用首选方法对证书签名后,必须将证书和私钥复制到 PKI 目录(默认为 `/etc/kubernetes/pki` )。
@@ -431,7 +430,7 @@ Kubeadm does not support rotation or replacement of CA certificates out of the b
For more information about manual rotation or replacement of CA, see [manual rotation of CA certificates](/docs/tasks/tls/manual-rotation-of-ca-certificates/).
-->
-## 证书机构(CA)轮换 {#certificate-authority-rotation}
+## 证书机构(CA)轮换 {#certificate-authority-rotation}
kubeadm 并不直接支持对 CA 证书的轮换或者替换。
@@ -449,9 +448,9 @@ kubelet cannot be secured with TLS.
To configure the kubelets in a new kubeadm cluster to obtain properly signed serving
certificates you must pass the following minimal configuration to `kubeadm init`:
-->
-## 启用已签名的 kubelet 服务证书 {#kubelet-serving-certs}
+## 启用已签名的 kubelet 服务证书 {#kubelet-serving-certs}
-默认情况下,kubeadm 所部署的 kubelet 服务证书是自签名(Self-Signed))。
+默认情况下,kubeadm 所部署的 kubelet 服务证书是自签名(Self-Signed)。
这意味着从 [metrics-server](https://github.com/kubernetes-sigs/metrics-server)
这类外部服务发起向 kubelet 的链接时无法使用 TLS 来完成保护。
@@ -501,7 +500,7 @@ These CSRs can be viewed using:
字段 `serverTLSBootstrap` 将允许启动引导 kubelet 的服务证书,方式
是从 `certificates.k8s.io` API 处读取。这种方式的一种局限在于这些
证书的 CSR(证书签名请求)不能被 kube-controller-manager 中默认的
-签名组件
+签名组件
[`kubernetes.io/kubelet-serving`](/zh/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers)
批准。需要用户或者第三方控制器来执行此操作。
@@ -554,7 +553,7 @@ the node identity with an out of band mechanism.
也可以使用第三方定制的控制器:
-- [kubelet-rubber-stamp](https://github.com/kontena/kubelet-rubber-stamp)
+- [kubelet-csr-approver](https://github.com/postfinance/kubelet-csr-approver)
除非既能够验证 CSR 中的 CommonName,也能检查请求的 IP 和域名,
这类控制器还算不得安全的机制。
@@ -573,7 +572,7 @@ CSRs requesting serving certificates for any IP or domain name.
-## 为其他用户生成 kubeconfig 文件 {#kubeconfig-additional-users}
+## 为其他用户生成 kubeconfig 文件 {#kubeconfig-additional-users}
你要使用 [`kubeadm kubeconfig user`](/zh/docs/reference/setup-tools/kubeadm/kubeadm-kubeconfig)
-命令为其他用户生成 kubeconfig 文件,这个命令支持命令行参数和
+命令为其他用户生成 kubeconfig 文件,这个命令支持命令行参数和
[kubeadm 配置结构](/zh/docs/reference/config-api/kubeadm-config.v1beta3/)。
以上命令会将 kubeconfig 打印到终端上,也可以使用 `kubeadm kubeconfig user ... > somefile.conf`
输出到一个文件中。
@@ -605,7 +604,7 @@ using `kubeadm kubeconfig user ... > somefile.conf`.
-如下 kubeadm 可以 在`--config` 后加的配置文件示例:
+如下 kubeadm 可以在 `--config` 后加的配置文件示例:
```yaml
# example.yaml
From 892da026613721cad3b5cd6a6161f9324f7ff21b Mon Sep 17 00:00:00 2001
From: Arhell
Date: Thu, 19 May 2022 02:16:52 +0300
Subject: [PATCH 052/245] [fr] updated
configure-liveness-readiness-startup-probes.md
---
.../configure-liveness-readiness-startup-probes.md | 2 +-
content/fr/examples/pods/probe/exec-liveness.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/fr/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md b/content/fr/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md
index 5902ca926d..2aa904144f 100644
--- a/content/fr/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md
+++ b/content/fr/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md
@@ -37,7 +37,7 @@ Le champ `periodSeconds` spécifie que le Kubelet doit effectuer un check de liv
Au démarrage, le conteneur exécute cette commande :
```shell
-/bin/sh -c "touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600"
+/bin/sh -c "touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 600"
```
Pour les 30 premières secondes de la vie du conteneur, il y a un fichier `/tmp/healthy`.
diff --git a/content/fr/examples/pods/probe/exec-liveness.yaml b/content/fr/examples/pods/probe/exec-liveness.yaml
index 07bf75f85c..6a9c9b3213 100644
--- a/content/fr/examples/pods/probe/exec-liveness.yaml
+++ b/content/fr/examples/pods/probe/exec-liveness.yaml
@@ -11,7 +11,7 @@ spec:
args:
- /bin/sh
- -c
- - touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
+ - touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 600
livenessProbe:
exec:
command:
From 434476d7ca5eb3556bb96dcce91e39200f9c316b Mon Sep 17 00:00:00 2001
From: "xin.li"
Date: Wed, 18 May 2022 21:49:49 +0800
Subject: [PATCH 053/245] [zh] adjust format in community
Signed-off-by: xin.li
---
content/zh/community/code-of-conduct.md | 4 ++--
.../community/static/cncf-code-of-conduct.md | 21 +++++++++++++------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/content/zh/community/code-of-conduct.md b/content/zh/community/code-of-conduct.md
index 98d8156770..e5942dc439 100644
--- a/content/zh/community/code-of-conduct.md
+++ b/content/zh/community/code-of-conduct.md
@@ -24,7 +24,7 @@ Kubernetes 遵循
CNCF 行为规范。
CNCF 社区规范文本如下链接
commit 0ce4694。
-如果您发现这个 CNCF 社区规范文本已经过时,请
+如果你发现这个 CNCF 社区规范文本已经过时,请
提交 issue。
@@ -35,7 +35,7 @@ the [Kubernetes Code of Conduct Committee](https://github.com/kubernetes/communi
Your anonymity will be protected. -->
如果你在活动、会议、Slack 或是其它场合发现有任何违反行为规范的行为,请联系[Kubernetes 行为规范委员会](https://github.com/kubernetes/community/tree/master/committee-code-of-conduct)。
-我们会确保您的匿名性。
+我们会确保你的匿名性。
diff --git a/content/zh/community/static/cncf-code-of-conduct.md b/content/zh/community/static/cncf-code-of-conduct.md
index 0c63979e3e..dde18750ea 100644
--- a/content/zh/community/static/cncf-code-of-conduct.md
+++ b/content/zh/community/static/cncf-code-of-conduct.md
@@ -4,9 +4,11 @@
### 贡献者行为准则
-作为这个项目的贡献者和维护者,为了建立一个开放和受欢迎的社区,我们保证尊重所有通过报告问题、发布功能请求、更新文档、提交拉取请求或补丁以及其他活动做出贡献的人员。
+作为这个项目的贡献者和维护者,为了建立一个开放和受欢迎的社区,
+我们保证尊重所有通过报告问题、发布功能请求、更新文档、提交拉取请求或补丁以及其他活动做出贡献的人员。
-我们致力于让参与此项目的每个人都不受骚扰,无论其经验水平、性别、性别认同和表达、性取向、残疾、个人外貌、体型、人种、种族、年龄、宗教或国籍等。
+我们致力于让参与此项目的每个人都不受骚扰,
+无论其经验水平、性别、性别认同和表达、性取向、残疾、个人外貌、体型、人种、种族、年龄、宗教或国籍等。
不可接受的参与者行为包括:
@@ -17,14 +19,21 @@
- 未经明确许可,发布他人的私人信息,比如地址或电子邮箱
- 其他不道德或不专业的行为
-项目维护者有权利和责任删除、编辑或拒绝评论、提交、代码、维基编辑、问题和其他不符合本行为准则的贡献。通过采用本行为准则,项目维护者承诺将这些原则公平且一致地应用到这个项目管理的各个方面。不遵守或不执行行为准则的项目维护者可能被永久地从项目团队中移除。
+项目维护者有权利和责任删除、编辑或拒绝评论、提交、代码、维基编辑、问题和其他不符合本行为准则的贡献。
+通过采用本行为准则,项目维护者承诺将这些原则公平且一致地应用到这个项目管理的各个方面。
+不遵守或不执行行为准则的项目维护者可能被永久地从项目团队中移除。
当个人代表项目或其社区时,本行为准则适用于项目空间和公共空间。
-如需举报侮辱、骚扰或其他不可接受的行为,您可发送邮件至 联系 [Kubernetes行为守则委员会](https://github.com/kubernetes/community/tree/master/committee-code-of-conduct)。其他事务请联系CNCF项目维护专员,或发送邮件至 联系我们的调解员Mishi Choudhary。
+如需举报侮辱、骚扰或其他不可接受的行为,
+你可发送邮件至 联系
+[Kubernetes行为守则委员会](https://github.com/kubernetes/community/tree/master/committee-code-of-conduct)。
+其他事务请联系CNCF项目维护专员,或发送邮件至 联系我们的调解员Mishi Choudhary。
-本行为准则改编自《贡献者契约》( https://contributor-covenant.org )1.2.0 版本,可在 https://contributor-covenant.org/version/1/2/0/ 查看。
+本行为准则改编自《贡献者契约》( https://contributor-covenant.org )1.2.0 版本,
+可在 https://contributor-covenant.org/version/1/2/0/ 查看。
### CNCF 活动行为准则
-云原生计算基金会(CNCF)活动受 Linux 基金会《[行为准则](https://events.linuxfoundation.org/code-of-conduct/)》管辖,该行为准则可在活动页面获得。其旨在与上述政策兼容,且包括更多关于事件回应的细节。
\ No newline at end of file
+云原生计算基金会(CNCF)活动受 Linux 基金会《[行为准则](https://events.linuxfoundation.org/code-of-conduct/)》管辖,
+该行为准则可在活动页面获得。其旨在与上述政策兼容,且包括更多关于事件回应的细节。
\ No newline at end of file
From 294484fb2b59a102094405111bdc6a979042fe8a Mon Sep 17 00:00:00 2001
From: "xin.li"
Date: Wed, 18 May 2022 22:26:00 +0800
Subject: [PATCH 054/245] [zh] adjust
Signed-off-by: xin.li
---
.../mysql-wordpress-persistent-volume.md | 77 ++++++++-----------
1 file changed, 30 insertions(+), 47 deletions(-)
diff --git a/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md b/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md
index d0c6dc26ea..1ab68871e4 100644
--- a/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md
+++ b/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md
@@ -23,36 +23,35 @@ card:
-
-本示例描述了如何通过 Minikube 在 Kubernetes 上安装 WordPress 和 MySQL。这两个应用都使用 PersistentVolumes 和 PersistentVolumeClaims 保存数据。
-
+本示例描述了如何通过 Minikube 在 Kubernetes 上安装 WordPress 和 MySQL。
+这两个应用都使用 PersistentVolumes 和 PersistentVolumeClaims 保存数据。
-
-[PersistentVolume](/zh/docs/concepts/storage/persistent-volumes/)(PV)是一块集群里由管理员手动提供,或 kubernetes 通过 [StorageClass](/zh/docs/concepts/storage/storage-classes) 动态创建的存储。
-[PersistentVolumeClaim](/zh/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)(PVC)是一个满足对 PV 存储需要的请求。PersistentVolumes 和 PersistentVolumeClaims 是独立于 Pod 生命周期而在 Pod 重启,重新调度甚至删除过程中保存数据。
+-->
+[PersistentVolume](/zh/docs/concepts/storage/persistent-volumes/)(PV)是一块集群里由管理员手动提供,
+或 kubernetes 通过 [StorageClass](/zh/docs/concepts/storage/storage-classes) 动态创建的存储。
+[PersistentVolumeClaim](/zh/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
+是用户对存储的请求,该请求可由某个 PV 来满足。
+PersistentVolumes 和 PersistentVolumeClaims 独立于 Pod 生命周期而存在,
+在 Pod 重启,重新调度甚至删除过程中保存数据。
{{< warning >}}
-
-这种部署并不适合生产场景,它使用单实例 WordPress 和 MySQL Pods。考虑使用 [WordPress Helm Chart](https://github.com/kubernetes/charts/tree/master/stable/wordpress) 在生产场景中部署 WordPress。
+这种部署并不适合生产场景,它使用单实例 WordPress 和 MySQL Pods。
+在生产场景中,请考虑使用 [WordPress Helm Chart](https://github.com/kubernetes/charts/tree/master/stable/wordpress)
+部署 WordPress。
{{< /warning >}}
{{< note >}}
-
-
本教程中提供的文件使用 GA Deployment API,并且特定于 kubernetes 1.9 或更高版本。如果你希望将本教程与 Kubernetes 的早期版本一起使用,请相应地更新 API 版本,或参考本教程的早期版本。
{{< /note >}}
-
-
## {{% heading "objectives" %}}
-
* 创建 PersistentVolumeClaims 和 PersistentVolumes
* 创建 `kustomization.yaml` 使用
* Secret 生成器
@@ -73,11 +71,8 @@ This tutorial shows you how to deploy a WordPress site and a MySQL database usin
* 应用整个 kustomization 目录 `kubectl apply -k ./`
* 清理
-
-
## {{% heading "prerequisites" %}}
-
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
-
此例在`kubectl` 1.14 或者更高版本有效。
下载下面的配置文件:
@@ -98,16 +92,12 @@ Download the following configuration files:
2. [wordpress-deployment.yaml](/examples/application/wordpress/wordpress-deployment.yaml)
-
-
-
## 创建 PersistentVolumeClaims 和 PersistentVolumes
-
-MySQL 和 Wordpress 都需要一个 PersistentVolume 来存储数据。他们的 PersistentVolumeClaims 将在部署步骤中创建。
+MySQL 和 Wordpress 都需要一个 PersistentVolume 来存储数据。
+他们的 PersistentVolumeClaims 将在部署步骤中创建。
-许多集群环境都安装了默认的 StorageClass。如果在 PersistentVolumeClaim 中未指定 StorageClass,则使用集群的默认 StorageClass。
+许多集群环境都安装了默认的 StorageClass。如果在 PersistentVolumeClaim 中未指定 StorageClass,
+则使用集群的默认 StorageClass。
创建 PersistentVolumeClaim 时,将根据 StorageClass 配置动态设置 PersistentVolume。
@@ -126,33 +118,34 @@ MySQL 和 Wordpress 都需要一个 PersistentVolume 来存储数据。他们的
In local clusters, the default StorageClass uses the `hostPath` provisioner. `hostPath` volumes are only suitable for development and testing. With `hostPath` volumes, your data lives in `/tmp` on the node the Pod is scheduled onto and does not move between nodes. If a Pod dies and gets scheduled to another node in the cluster, or the node is rebooted, the data is lost.
-->
-在本地集群中,默认的 StorageClass 使用`hostPath`供应器。 `hostPath`卷仅适用于开发和测试。使用 `hostPath` 卷,你的数据位于 Pod 调度到的节点上的`/tmp`中,并且不会在节点之间移动。如果 Pod 死亡并被调度到群集中的另一个节点,或者该节点重新启动,则数据将丢失。
+在本地集群中,默认的 StorageClass 使用`hostPath`供应器。 `hostPath`卷仅适用于开发和测试。
+使用 `hostPath` 卷,你的数据位于 Pod 调度到的节点上的`/tmp`中,并且不会在节点之间移动。
+如果 Pod 死亡并被调度到集群中的另一个节点,或者该节点重新启动,则数据将丢失。
{{< /warning >}}
{{< note >}}
-
-如果要建立需要使用`hostPath`设置程序的集群,则必须在 controller-manager 组件中设置`--enable-hostpath-provisioner`标志。
+如果要建立需要使用`hostPath`设置程序的集群,
+则必须在 controller-manager 组件中设置`--enable-hostpath-provisioner`标志。
{{< /note >}}
{{< note >}}
-如果你已经有运行在 Google Kubernetes Engine 的集群,请参考 [this guide](https://cloud.google.com/kubernetes-engine/docs/tutorials/persistent-disk)。
+如果你已经有运行在 Google Kubernetes Engine 的集群,
+请参考[此指南](https://cloud.google.com/kubernetes-engine/docs/tutorials/persistent-disk)。
{{< /note >}}
-
## 创建 kustomization.yaml
-
### 创建 Secret 生成器
+[Secret](/zh/docs/concepts/configuration/secret/) 是存储诸如密码或密钥之类的敏感数据的对象。
+从 1.14 开始,`kubectl`支持使用 kustomization 文件管理 Kubernetes 对象。
+你可以通过`kustomization.yaml`中的生成器创建一个 Secret。
-A [Secret](/zh/docs/concepts/configuration/secret/) 是存储诸如密码或密钥之类的敏感数据的对象。从 1.14 开始,`kubectl`支持使用 kustomization 文件管理 Kubernetes 对象。你可以通过`kustomization.yaml`中的生成器创建一个 Secret。
-
-通过以下命令在`kustomization.yaml`中添加一个 Secret 生成器。你需要用你要使用的密码替换`YOUR_PASSWORD`。
+通过以下命令在`kustomization.yaml`中添加一个 Secret 生成器。
+你需要用你要使用的密码替换`YOUR_PASSWORD`。
```shell
cat <./kustomization.yaml
@@ -177,14 +172,13 @@ EOF
-
## 补充 MySQL 和 WordPress 的资源配置
-
-以下 manifest 文件描述了单实例 MySQL 部署。MySQL 容器将 PersistentVolume 挂载在`/var/lib/mysql`。 `MYSQL_ROOT_PASSWORD`环境变量设置来自 Secret 的数据库密码。
+以下 manifest 文件描述了单实例 MySQL 部署。MySQL 容器将 PersistentVolume 挂载在`/var/lib/mysql`。
+`MYSQL_ROOT_PASSWORD`环境变量设置来自 Secret 的数据库密码。
{{< codenew file="application/wordpress/mysql-deployment.yaml" >}}
@@ -194,7 +188,6 @@ PersistentVolume at `/var/www/html` for website data files. The `WORDPRESS_DB_HO
the name of the MySQL Service defined above, and WordPress will access the database by Service. The
`WORDPRESS_DB_PASSWORD` environment variable sets the database password from the Secret kustomize generated.
-->
-
以下 manifest 文件描述了单实例 WordPress 部署。WordPress 容器将网站数据文件位于`/var/www/html`的 PersistentVolume。`WORDPRESS_DB_HOST`环境变量集上面定义的 MySQL Service 的名称,WordPress 将通过 Service 访问数据库。`WORDPRESS_DB_PASSWORD`环境变量设置从 Secret kustomize 生成的数据库密码。
{{< codenew file="application/wordpress/wordpress-deployment.yaml" >}}
@@ -243,11 +236,9 @@ the name of the MySQL Service defined above, and WordPress will access the datab
EOF
```
-
-
## 应用和验证
-
-
`kustomization.yaml`包含用于部署 WordPress 网站的所有资源以及 MySQL 数据库。你可以通过以下方式应用目录
```shell
kubectl apply -k ./
@@ -434,8 +423,6 @@ kubectl apply -k ./

-
-
{{< warning >}}
-
* 进一步了解[自省与调试](/zh/docs/tasks/debug/debug-application/debug-running-pod/)
* 进一步了解 [Job](/zh/docs/concepts/workloads/controllers/jobs-run-to-completion/)
* 进一步了解[端口转发](/zh/docs/tasks/access-application-cluster/port-forward-access-application-cluster/)
From 7e791d163f6c923d2f7470c879f82d2ccbbef81a Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Thu, 19 May 2022 10:51:35 +0800
Subject: [PATCH 055/245] [zh] Fix permission for node-selector-requirement.md
---
.../node-selector-requirement.md | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
mode change 100755 => 100644 content/zh/docs/reference/kubernetes-api/common-definitions/node-selector-requirement.md
diff --git a/content/zh/docs/reference/kubernetes-api/common-definitions/node-selector-requirement.md b/content/zh/docs/reference/kubernetes-api/common-definitions/node-selector-requirement.md
old mode 100755
new mode 100644
index c21053016d..018672655d
--- a/content/zh/docs/reference/kubernetes-api/common-definitions/node-selector-requirement.md
+++ b/content/zh/docs/reference/kubernetes-api/common-definitions/node-selector-requirement.md
@@ -10,7 +10,6 @@ weight: 5
auto_generated: true
---
+
+
+
+
`import "k8s.io/api/core/v1"`
@@ -35,7 +46,7 @@ A node selector requirement is a selector that contains values, a key, and an op
- **key** (string), 必选
From 3d2670abf6a484bf0e191ffd7151ad062cdd10d5 Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Thu, 19 May 2022 12:55:20 +0800
Subject: [PATCH 056/245] [zh] Sync localization.md
---
content/zh/docs/contribute/localization.md | 226 +++++++++++----------
1 file changed, 117 insertions(+), 109 deletions(-)
diff --git a/content/zh/docs/contribute/localization.md b/content/zh/docs/contribute/localization.md
index 5c70568251..47d56e6163 100644
--- a/content/zh/docs/contribute/localization.md
+++ b/content/zh/docs/contribute/localization.md
@@ -7,7 +7,7 @@ card:
weight: 50
title: 翻译文档
---
-
-
此页面描述如何为其他语言的文档提供
[本地化](https://blog.mozilla.org/l10n/2011/12/14/i18n-vs-l10n-whats-the-diff/)版本。
-
-## 为现有的本地化做出贡献
+## 为现有的本地化做出贡献 {#contribute-to-an-existing-localization}
你可以帮助添加或改进现有本地化的内容。在 [Kubernetes Slack](https://slack.k8s.io/) 中,
你能找到每个本地化的频道。还有一个通用的
@@ -44,7 +44,7 @@ You can help add or improve content to an existing localization. In [Kubernetes
你可以在这里打个招呼。
{{< note >}}
-
-### 找到两个字母的语言代码
+### 找到两个字母的语言代码 {#find-your-two-letter-language-code}
首先,有关本地化的两个字母的语言代码,请参考
[ISO 639-1 标准](https://www.loc.gov/standards/iso639-2/php/code_list.php)。
@@ -85,9 +85,12 @@ git clone https://github.com//website
cd website
```
+
网站内容目录包括每种语言的子目录。你想要助力的本地化位于 `content/` 中。
-
-## 开始新的本地化
+## 开始新的本地化 {#start-a-new-localization}
如果你希望将 Kubernetes 文档本地化为一种新语言,你需要执行以下操作。
@@ -137,7 +140,7 @@ it's up to you to translate it and keep existing localized content current.
所有本地化团队都必须能够自我维持。
Kubernetes 网站很乐意托管你的作品,但要由你来翻译它并使现有的本地化内容保持最新。
-
-### 找到社区
+### 找到社区 {#find-community}
让 Kubernetes SIG Docs 知道你有兴趣创建本地化!
加入 [SIG Docs Slack 频道](https://kubernetes.slack.com/messages/sig-docs)
和 [SIG Docs Localizations Slack 频道](https://kubernetes.slack.com/messages/sig-docs-localizations)。
其他本地化团队很乐意帮助你入门并回答你的任何问题。
-
-### 加入到 Kubernetes GitHub 组织
+### 加入到 Kubernetes GitHub 组织 {#join-the-kubernetes-github-organization}
提交本地化 PR 后,你可以成为 Kubernetes GitHub 组织的成员。
团队中的每个人都需要在 `kubernetes/org` 仓库中创建自己的
[组织成员申请](https://github.com/kubernetes/org/issues/new/choose)。
-
### 在 GitHub 中添加你的本地化团队 {#add-your-localization-team-in-github}
@@ -217,24 +221,24 @@ The `@kubernetes/sig-docs-**-reviews` team automates review assignment for new P
`@kubernetes/sig-docs-**-owners` 成员可以批准更改对应本地化目录 `/content/**/` 中内容的 PR,并仅限这类 PR。
-`@kubernetes/sig-docs-**-reviews` 团队被自动分派新 PR 的审阅任务。
+对于每个本地化,`@kubernetes/sig-docs-**-reviews` 团队被自动分派新 PR 的审阅任务。
-
`@kubernetes/website-maintainers` 成员可以创建新的本地化分支来协调翻译工作。
`@kubernetes/website-milestone-maintainers` 成员可以使用 `/milestone`
[Prow 命令](https://prow.k8s.io/command-help)为 issues 或 PR 设定里程碑。
-
-
### 配置工作流程 {#configure-the-workflow}
@@ -246,16 +250,14 @@ For an example of adding a label, see the PR for adding the [Italian language la
你还可以在 `kubernetes/community` 仓库中为你的本地化创建一个 Slack 频道。
有关添加 Slack 频道的示例,请参见[为印尼语和葡萄牙语添加频道](https://github.com/kubernetes/community/pull/3605)的 PR。
-
-## 最低要求内容 {#minimum-required-content}
-
-### 修改站点配置
+### 修改站点配置 {#configure-the-workflow}
Kubernetes 网站使用 Hugo 作为其 Web 框架。网站的 Hugo 配置位于
[`config.toml`](https://github.com/kubernetes/website/tree/main/config.toml)文件中。
@@ -275,7 +277,7 @@ weight = 8
```
`languageName` 的值将列在语言选择栏中。
将 `languageName` 赋值为“本地脚本中的语言名称(拉丁脚本中的语言名称)”。
@@ -284,21 +286,21 @@ The value for `languageName` will be listed in language selection bar. Assign "l
将 `languageNameLatinScript` 赋值为“拉丁脚本中的语言名称”。
例如,`languageNameLatinScript ="Korean"`。
-
为你的语言块分配一个 `weight` 参数时,找到权重最高的语言块并将其加 1。
有关 Hugo 多语言支持的更多信息,请参阅"[多语言模式](https://gohugo.io/content-management/multilingual/)"。
-
-### 添加一个新的本地化目录
+### 添加一个新的本地化目录 {#add-a-new-localization-directory}
将特定语言的子目录添加到仓库中的
[`content`](https://github.com/kubernetes/website/tree/main/content) 文件夹下。
@@ -308,7 +310,7 @@ Add a language-specific subdirectory to the [`content`](https://github.com/kuber
mkdir content/de
```
-
-### 本地化社区行为准则
+### 本地化社区行为准则 {#localize-the-community-code-of-conduct}
在 [`cncf/foundation`](https://github.com/cncf/foundation/tree/master/code-of-conduct-languages)
仓库提交 PR,添加你所用语言版本的行为准则。
-->
-
-### 设置 OWNERS 文件
+### 设置 OWNERS 文件 {#setting-up-the-owners-files}
要设置每个对本地化做出贡献用户的角色,请在特定于语言的子目录内创建一个 `OWNERS` 文件,其中:
@@ -362,10 +364,10 @@ To set the roles of each user contributing to the localization, create an `OWNER
- **labels**: 可以自动应用于 PR 的 GitHub 标签列表,在本例中为
[配置工作流程](#configure-the-workflow)中创建的语言标签。
-
有关 `OWNERS` 文件的更多信息,请访问[go.k8s.io/owners](https://go.k8s.io/owners)。
@@ -386,12 +388,12 @@ approvers:
labels:
- language/es
-```
+```
-
添加了特定语言的 OWNERS 文件之后,使用新的 Kubernetes 本地化团队、
`sig-docs-**-owners` 和 `sig-docs-**-reviews` 列表更新
@@ -421,7 +423,7 @@ For each team, add the list of GitHub users requested in [Add your localization
- remyleone
```
-
-### 添加本地化的 README 文件
+### 添加本地化的 README 文件 {#add-a-localized-readme-file}
为了指导其他本地化贡献者,请在 [k/website](https://github.com/kubernetes/website/)
的根目录添加一个新的 [`README-**.md`](https://help.github.com/articles/about-readmes/),
@@ -461,14 +463,14 @@ Provide guidance to localization contributors in the localized `README-**.md` fi
- 本地化项目的联系人
- 任何特定于本地化的信息
-
创建本地化的 README 文件后,请在英语版文件 `README.md` 中添加指向该文件的链接,
并给出英文形式的联系信息。你可以提供 GitHub ID、电子邮件地址、
[Slack 频道](https://slack.com/)或其他联系方式。你还必须提供指向本地化的社区行为准则的链接。
-
-### 启动你的新本地化
+### 启动你的新本地化 {#add-a-localized-readme-file}
一旦本地化满足工作流程和最小输出的要求,SIG Docs 将:
@@ -484,20 +486,25 @@ Once a localization meets requirements for workflow and minimum output, SIG Docs
- 通过[云原生计算基金会](https://www.cncf.io/about/)(CNCF)渠道,
包括 [Kubernetes 博客](https://kubernetes.io/blog/),来宣传本地化的可用性。
-
## 翻译文档 {#translating-content}
本地化*所有* Kubernetes 文档是一项艰巨的任务。从小做起,循序渐进。
+
+### 最低要求内容 {#minimum-required-content}
+
所有本地化至少必须包括:
-
翻译后的文档必须保存在自己的 `content/**/` 子目录中,否则将遵循与英文源相同的 URL 路径。
例如,要准备将 [Kubernetes 基础](/zh/docs/tutorials/kubernetes-basics/) 教程翻译为德语,
@@ -525,24 +533,24 @@ mkdir -p content/de/docs/tutorials
cp content/en/docs/tutorials/kubernetes-basics.md content/de/docs/tutorials/kubernetes-basics.md
```
-
翻译工具可以加快翻译过程。例如,某些编辑器提供了用于快速翻译文本的插件。
-
{{< caution >}}
-机器生成的翻译不能达到最低质量标准,需要进行大量人工审查才能达到该标准。
+机器生成的翻译本身是不够的,本地化需要广泛的人工审核才能满足最低质量标准。
{{< /caution >}}
-
为了确保语法和含义的准确性,本地化团队的成员应在发布之前仔细检查所有由机器生成的翻译。
-
-### 源文件
+### 源文件 {#source-files}
本地化必须基于本地化团队所针对的特定发行版本中的英文文件。
每个本地化团队可以决定要针对哪个发行版本,在下文中称作目标版本(target version)。)
@@ -580,27 +588,27 @@ The `master` branch holds content for the current release `{{< latest-version >}
发行团队会在下一个发行版本 v{{< skew nextMinorVersion >}} 出现之前创建
`{{< release-branch >}}` 分支。
-
### i18n/ 中的网站字符串 {#site-strings-in-i18n}
本地化必须在新的语言特定文件中包含
-[`data/i18n/en/en.toml`](https://github.com/kubernetes/website/blob/master/i18n/en.toml)
+[`data/i18n/en/en.toml`](https://github.com/kubernetes/website/blob/main/data/i18n/en/en.toml)
的内容。以德语为例:`data/i18n/de/de.toml`。
-将新的本地化文件添加到 `i18n/`。例如德语 (`de`):
+将新的本地化文件和目录添加到 `data/i18n/`。例如德语 (`de`):
```bash
mkdir -p data/i18n/de
cp data/i18n/en/en.toml data/i18n/de/de.toml
```
-
本地化网站字符串允许你自定义网站范围的文本和特性:例如,每个页面页脚中的合法版权文本。
-
-### 特定语言的样式指南和词汇表
+### 特定语言的样式指南和词汇表 {#language-specific-style-guide-and-glossary}
一些语言团队有自己的特定语言样式指南和词汇表。
例如,请参见[中文本地化指南](/zh/docs/contribute/localization_zh/)。
@@ -637,23 +645,23 @@ Per CNCF policy, the localization teams must upload their meetings to the SIG Do
-->
-### 特定语言的 Zoom 会议
+### 特定语言的 Zoom 会议 {#language-specific-zoom-meetings}
-如果本地化项目需要单独的会议时间,
-请联系 SIG Docs 联合主席或技术主管以创建新的重复 Zoom 会议和日历邀请。
+如果本地化项目需要单独的会议时间,
+请联系 SIG Docs 联合主席或技术主管以创建新的重复 Zoom 会议和日历邀请。
仅当团队维持在足够大的规模并需要单独的会议时才需要这样做。
根据 CNCF 政策,本地化团队必须将他们的会议上传到 SIG Docs YouTube 播放列表。
SIG Docs 联合主席或技术主管可以帮助完成该过程,直到 SIG Docs 实现自动化。
-
### 分支策略 {#branching-strategy}
@@ -662,10 +670,10 @@ To collaborate on a localization branch:
在本地化分支上协作需要:
-
2. 个人贡献者基于本地化分支创建新的特性分支
@@ -703,13 +711,13 @@ To collaborate on a localization branch:
4. 批准人会定期发起并批准新的 PR,将本地化分支合并到其源分支。
在批准 PR 之前,请确保先 squash commits。
-
根据需要重复步骤 1-4,直到完成本地化工作。例如,随后的德语本地化分支将是:
`dev-1.12-de.2`、`dev-1.12-de.3`,等等。
-
+-->
在团队每个里程碑的开始时段,创建一个 issue 来比较先前的本地化分支
和当前的本地化分支之间的上游变化很有帮助。
现在有两个脚本用来比较上游的变化。
@@ -751,13 +759,13 @@ While only approvers can open a new localization branch and merge pull requests,
虽然只有批准人才能创建新的本地化分支并合并 PR,任何人都可以
为新的本地化分支提交一个拉取请求(PR)。不需要特殊权限。
-
有关基于派生或直接从仓库开展工作的更多信息,请参见 ["派生和克隆"](#fork-and-clone-the-repo)。
-
From c813ce259c8bcad3c62c79f810af32cdf746b218 Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Thu, 19 May 2022 14:34:00 +0800
Subject: [PATCH 057/245] [zh] Sync dockshim article
---
.../blog/_posts/2020-12-02-dockershim-faq.md | 38 ++-
.../2022-02-17-updated-dockershim-faq.md | 255 ++++++++++--------
2 files changed, 167 insertions(+), 126 deletions(-)
diff --git a/content/zh/blog/_posts/2020-12-02-dockershim-faq.md b/content/zh/blog/_posts/2020-12-02-dockershim-faq.md
index 6df3d35086..49e9471153 100644
--- a/content/zh/blog/_posts/2020-12-02-dockershim-faq.md
+++ b/content/zh/blog/_posts/2020-12-02-dockershim-faq.md
@@ -3,14 +3,12 @@ layout: blog
title: "弃用 Dockershim 的常见问题"
date: 2020-12-02
slug: dockershim-faq
-aliases: [ '/zh/dockershim' ]
---
Dockershim 向来都是一个临时解决方案(因此得名:shim)。
你可以进一步阅读
-[移除 Kubernetes 增强方案 Dockershim][drkep]
+[移除 Dockershim 这一 Kubernetes 增强方案][drkep]
以了解相关的社区讨论和计划。
+### 从 Kubernetes 中移除后我还能使用 dockershim 吗? {#can-i-still-use-dockershim-after-it-is-removed-from-kubernetes}
+
+
+更新:Mirantis 和 Docker [已承诺][mirantis]在 dockershim 从 Kubernetes
+中删除后对其进行维护。
+
+[mirantis]: https://www.mirantis.com/blog/mirantis-to-take-over-support-of-kubernetes-dockershim-2/
+
+
@@ -163,11 +178,11 @@ related projects follow a similar pattern as well, demonstrating the stability a
usability of other container runtimes. As an example, OpenShift 4.x has been
using the [CRI-O] runtime in production since June 2019.
-->
-此外,[kind](https://kind.sigs.k8s.io/) 项目使用 containerd 已经有年头了,
+此外,[kind] 项目使用 containerd 已经有年头了,
并且在这个场景中,稳定性还明显得到提升。
Kind 和 containerd 每天都会做多次协调,以验证对 Kubernetes 代码库的所有更改。
其他相关项目也遵循同样的模式,从而展示了其他容器运行时的稳定性和可用性。
-例如,OpenShift 4.x 从 2019 年 6 月以来,就一直在生产环境中使用 [CRI-O](https://cri-o.io/) 运行时。
+例如,OpenShift 4.x 从 2019 年 6 月以来,就一直在生产环境中使用 [CRI-O] 运行时。
@@ -300,7 +320,7 @@ Kubernetes documentation on [Container Runtimes]
-### 我还有问题怎么办?{#what-if-I-have-more-question}
+### 我还有问题怎么办?{#what-if-I-have-more-questions}
如果你使用了一个有供应商支持的 Kubernetes 发行版,你可以咨询供应商他们产品的升级计划。
-对于最终用户的问题,请把问题发到我们的最终用户社区的论坛:https://discuss.kubernetes.io/。
+对于最终用户的问题,请把问题发到我们的最终用户社区的[论坛](https://discuss.kubernetes.io/)。
-**本文是针对2020年末发布的[弃用 Dockershim 的常见问题](/zh/blog/2020/12/02/dockershim-faq/)的博客更新。**
+**本文是针对 2020 年末发布的[弃用 Dockershim 的常见问题](/zh/blog/2020/12/02/dockershim-faq/)的博客更新。
+本文包括 Kubernetes v1.24 版本的更新。**
+
+---
+本文介绍了一些关于从 Kubernetes 中移除 _dockershim_ 的常见问题。
+该移除最初是作为 Kubernetes v1.20
+版本的一部分[宣布](/zh/blog/2020/12/08/kubernetes-1-20-release-announcement/)的。
+Kubernetes 在 [v1.24 版](/releases/#release-v1-24)移除了 dockershim。
+
+
-本文回顾了自 Kubernetes v1.20 版本[宣布](/zh/blog/2020/12/08/kubernetes-1-20-release-announcement/)弃用
-Dockershim 以来所引发的一些常见问题。关于弃用细节以及这些细节背后的含义,请参考博文
+关于细节请参考博文
[别慌: Kubernetes 和 Docker](/zh/blog/2020/12/02/dont-panic-kubernetes-and-docker/)。
-你还可以查阅:[检查弃用 Dockershim 对你的影响](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/)这篇文章,
-以确定弃用 dockershim 会对你或你的组织带来多大的影响。
+要确定移除 dockershim 是否会对你或你的组织的影响,可以查阅:
+[检查弃用 Dockershim 对你的影响](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/)
+这篇文章。
-随着 Kubernetes 1.24 版本的发布迫在眉睫,我们一直在努力尝试使其能够平稳升级顺利过渡。
+在 Kubernetes 1.24 发布之前的几个月和几天里,Kubernetes
+贡献者努力试图让这个过渡顺利进行。
-- 我们已经写了一篇博文,详细说明了我们的[承诺和后续操作](/blog/2022/01/07/kubernetes-is-moving-on-from-dockershim/)。
-- 我们我们相信可以无障碍的迁移到其他[容器运行时](/zh/docs/setup/production-environment/container-runtimes/#container-runtimes)。
-- 我们撰写了 [dockershim 迁移指南](/docs/tasks/administer-cluster/migrating-from-dockershim/)供你参考。
-- 我们还创建了一个页面来列出[有关 dockershim 移除和使用 CRI 兼容运行时的文章](/zh/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes/)。
+- 一篇详细说明[承诺和后续操作](/blog/2022/01/07/kubernetes-is-moving-on-from-dockershim/)的博文。
+- 检查是否存在迁移到其他 [容器运行时](/zh/docs/setup/production-environment/container-runtimes/#container-runtimes) 的主要障碍。
+- 添加 [从 dockershim 迁移](/docs/tasks/administer-cluster/migrating-from-dockershim/)的指南。
+- 创建了一个[有关 dockershim 移除和使用 CRI 兼容运行时的列表](/zh/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes/)。
该列表包括一些已经提到的文档,还涵盖了选定的外部资源(包括供应商指南)。
-### 为什么会从 Kubernetes 中移除 dockershim ?
+### 为什么会从 Kubernetes 中移除 dockershim ? {#why-was-the-dockershim-removed-from-kubernetes}
此外,在较新的 CRI 运行时中实现了与 dockershim 不兼容的功能,例如 cgroups v2 和用户命名空间。
-取消对 dockershim 的支持将加速这些领域的发展。
+从 Kubernetes 中移除 dockershim 允许在这些领域进行进一步的开发。
+
+
+### Docker 和容器一样吗? {#are-docker-and-containers-the-same-thing}
+
+
+Docker 普及了 Linux 容器模式,并在开发底层技术方面发挥了重要作用,但是 Linux
+中的容器已经存在了很长时间,容器生态系统已经发展到比 Docker 广泛得多。
+OCI 和 CRI 等标准帮助许多工具在我们的生态系统中发展壮大,其中一些替代了 Docker
+的某些方面,而另一些则增强了现有功能。
+
+
+### 我现有的容器镜像是否仍然有效? {#will-my-existing-container-images-still-work}
+
+
+是的,从 `docker build` 生成的镜像将适用于所有 CRI 实现,
+现有的所有镜像仍将完全相同。
+
+
+#### 私有镜像呢? {#what-about-private-images}
+
+
+当然可以,所有 CRI 运行时都支持在 Kubernetes 中使用的相同的 pull secrets
+配置,无论是通过 PodSpec 还是 ServiceAccount。
-### 在 Kubernetes 1.23 版本中还可以使用 Docker Engine 吗?
+### 在 Kubernetes 1.23 版本中还可以使用 Docker Engine 吗? {#can-i-still-use-docker-engine-in-kubernetes-1-23}
可以使用,在 1.20 版本中唯一的改动是,如果使用 Docker Engine,
在 [kubelet](/zh/docs/reference/command-line-tools-reference/kubelet/)
启动时会打印一个警告日志。
-你将在 1.23 版本及以前版本看到此警告。dockershim 将在 Kubernetes 1.24 版本中移除 。
+你将在 1.23 版本及以前版本看到此警告,dockershim 已在 Kubernetes 1.24 版本中移除 。
-### 什么时候移除 dockershim ?
+如果你运行的是 Kubernetes v1.24 或更高版本,请参阅
+[我仍然可以使用 Docker Engine 作为我的容器运行时吗?](#can-i-still-use-docker-engine-as-my-container-runtime)
+(如果你使用任何支持 dockershim 的版本,可以随时切换离开;从版本 v1.24
+开始,因为 Kubernetes 不再包含 dockershim,你**必须**切换)。
-考虑到此变更带来的影响,我们使用了一个加长的废弃时间表。
-dockershim 计划在 Kubernetes v1.24 中进行移除,
-参见 [Kubernetes 移除 Dockershim 增强方案](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2221-remove-dockershim)。
-Kubernetes 项目将与供应商和其他生态系统组织密切合作,以确保平稳过渡,并将依据事态的发展评估后续事项。
+### 我应该用哪个 CRI 实现? {#which-cri-implementation-should-i-use}
-### 我还可以使用 Docker Engine 作为我的容器运行时吗?
+这是一个复杂的问题,依赖于许多因素。
+如果你正在使用 Docker Engine,迁移到 containerd
+应该是一个相对容易地转换,并将获得更好的性能和更少的开销。
+然而,我们鼓励你探索 [CNCF landscape] 提供的所有选项,做出更适合你的选择。
+
+[CNCF landscape]: https://landscape.cncf.io/card-mode?category=container-runtime&grouping=category
+
+
+#### 我还可以使用 Docker Engine 作为我的容器运行时吗? {#can-i-still-use-docker-engine-as-my-container-runtime}
-### 我现有的容器镜像还能正常工作吗?
+你可以安装 `cri-dockerd` 并使用它将 kubelet 连接到 Docker Engine。
+阅读[将 Docker Engine 节点从 dockershim 迁移到 cri-dockerd](/docs/tasks/administer-cluster/migrating-from-dockershim/migrate-dockershim-dockerd/)
+以了解更多信息。
-
-当然可以,`docker build` 创建的镜像适用于任何 CRI 实现。
-所有你的现有镜像将和往常一样工作。
-
-
-### 私有镜像呢?
-
-
-当然可以。所有 CRI 运行时均支持在 Kubernetes 中相同的拉取(pull)Secret 配置,
-无论是通过 PodSpec 还是 ServiceAccount。
-
-
-### Docker 和容器是一回事吗?
-
-
-Docker 普及了 Linux 容器模式,并在开发底层技术方面发挥了重要作用,
-但是 Linux 中的容器已经存在了很长时间。容器的生态相比于 Docker 具有更宽广的领域。
-OCI 和 CRI 等标准帮助许多工具在我们的生态系统中发展壮大,
-其中一些替代了 Docker 的某些方面,而另一些则增强了现有功能。
-### 现在是否有在生产系统中使用其他运行时的例子?
+### 现在是否有在生产系统中使用其他运行时的例子? {#are-there-examples-of-folks-using-other-runtimes-in-production-today}
-### 人们总在谈论 OCI,它是什么?
+### 人们总在谈论 OCI,它是什么? {#people-keep-referencing-oci-what-is-that}
-### 我应该用哪个 CRI 实现?
-
-
-这是一个复杂的问题,依赖于许多因素。
-如果你正在使用 Docker,迁移到 containerd 应该是一个相对容易地转换,并将获得更好的性能和更少的开销。
-然而,我们鼓励你探索 [CNCF landscape](https://landscape.cncf.io/card-mode?category=container-runtime&grouping=category)
-提供的所有选项,做出更适合你的选择。
-### 当切换 CRI 实现时,应该注意什么?
+### 当切换 CRI 实现时,应该注意什么? {#what-should-i-look-out-for-when-changing-cri-implementations}
- 日志配置
- 运行时的资源限制
-- 调用 docker 或通过其控制套接字使用 docker 的节点配置脚本
-- 需要访问 docker 命令或控制套接字的 kubectl 插件
+- 调用 docker 或通过其控制套接字使用 Docker Engine 的节点配置脚本
+- 需要 `docker` 命令或 Docker Engine 控制套接字的 `kubectl` 插件
- 需要直接访问 Docker Engine 的 Kubernetes 工具(例如:已弃用的 'kube-imagepuller' 工具)
- `registry-mirrors` 和不安全注册表等功能的配置
- 保障 Docker Engine 可用、且运行在 Kubernetes 之外的脚本或守护进程(例如:监视或安全代理)
@@ -304,7 +324,7 @@ common things to consider when migrating are:
@@ -314,8 +334,9 @@ runtime where possible.
另外还有一个需要关注的点,那就是当创建镜像时,系统维护或嵌入容器方面的任务将无法工作。
@@ -345,15 +366,15 @@ Kubernetes documentation on [Container Runtimes].
-### 我还有其他问题怎么办?
+### 我还有其他问题怎么办? {#what-if-i-have-more-questions}
如果你使用了供应商支持的 Kubernetes 发行版,你可以咨询供应商他们产品的升级计划。
-对于最终用户的问题,请把问题发到我们的最终用户社区的论坛:https://discuss.kubernetes.io/。
+对于最终用户的问题,请把问题发到我们的最终用户社区的[论坛](https://discuss.kubernetes.io/)。
-### 是否有任何工具可以帮助我找到正在使用的 dockershim
+### 是否有任何工具可以帮助我找到正在使用的 dockershim? {#is-there-any-tooling-that-can-help-me-find-dockershim-in-use}
是的! [Docker Socket 检测器 (DDS)][dds] 是一个 kubectl 插件,
你可以安装它用于检查你的集群。 DDS 可以检测运行中的 Kubernetes
-工作负载是否将 Docker 引擎套接字 (`docker.sock`) 作为卷挂载。
+工作负载是否将 Docker Engine 套接字 (`docker.sock`) 作为卷挂载。
在 DDS 项目的 [README][dds] 中查找更多详细信息和使用方法。
[dds]: https://github.com/aws-containers/kubectl-detector-for-docker-socket
@@ -391,7 +412,7 @@ Find more details and usage patterns in the DDS project's [README][dds].
-### 我可以加入吗?
+### 我可以加入吗? {#can-i-have-a-hug}
-按照设计,Kubernetes 对 pod 执行相关的很多方面进行了抽象,使得用户不必关心。
+按照设计,Kubernetes 对 Pod 执行相关的很多方面进行了抽象,使得用户不必关心。
然而,为了正常运行,有些工作负载要求在延迟和/或性能方面有更强的保证。
为此,kubelet 提供方法来实现更复杂的负载放置策略,同时保持抽象,避免显式的放置指令。
@@ -62,12 +62,16 @@ management policies to determine some placement preferences on the node.
### 配置
-CPU 管理策略通过 kubelet 参数 `--cpu-manager-policy` 来指定。支持两种策略:
+CPU 管理策略通过 kubelet 参数 `--cpu-manager-policy`
+或 [KubeletConfiguration](/zh/docs/reference/config-api/kubelet-config.v1beta1/)
+中的 `cpuManagerPolicy` 字段来指定。
+支持两种策略:
* `none`: 默认策略,表示现有的调度行为。
-* `static`: 允许为节点上具有某些资源特征的 pod 赋予增强的 CPU 亲和性和独占性。
+* `static`: 允许为节点上具有某些资源特征的 Pod 赋予增强的 CPU 亲和性和独占性。
Static 策略的行为可以使用 `--cpu-manager-policy-options` 参数来微调。
该参数采用一个逗号分隔的 `key=value` 策略选项列表。
+此特性可以通过 `CPUManagerPolicyOptions` 特性门控来完全禁用。
+
+
+策略选项分为两组:alpha 质量(默认隐藏)和 beta 质量(默认可见)。
+这些组分别由 `CPUManagerPolicyAlphaOptions` 和 `CPUManagerPolicyBetaOptions` 特性门控来管控。
+不同于 Kubernetes 标准,这里是由这些特性门控来管控选项组,因为为每个单独选项都添加一个特性门控过于繁琐。
+
+
+### 更改 CPU 管理器策略
+
+由于 CPU 管理器策略只能在 kubelet 生成新 Pod 时应用,所以简单地从 "none" 更改为 "static"
+将不会对现有的 Pod 起作用。
+因此,为了正确更改节点上的 CPU 管理器策略,请执行以下步骤:
+
+
+1. [腾空](/zh/docs/tasks/administer-cluster/safely-drain-node)节点。
+2. 停止 kubelet。
+3. 删除旧的 CPU 管理器状态文件。该文件的路径默认为 `/var/lib/kubelet/cpu_manager_state`。
+ 这将清除 CPUManager 维护的状态,以便新策略设置的 cpu-sets 不会与之冲突。
+4. 编辑 kubelet 配置以将 CPU 管理器策略更改为所需的值。
+5. 启动 kubelet。
+
+
+对需要更改其 CPU 管理器策略的每个节点重复此过程。
+跳过此过程将导致 kubelet crashlooping 并出现以下错误:
+
+```
+could not restore state from checkpoint: configured policy "static" differs from state checkpoint policy "none", please drain this node and delete the CPU manager checkpoint file "/var/lib/kubelet/cpu_manager_state" before restarting Kubelet
+```
-该策略管理一个共享 CPU 资源池,最初,该资源池包含节点上所有的 CPU 资源。可用
-的独占性 CPU 资源数量等于节点的 CPU 总量减去通过 `--kube-reserved` 或 `--system-reserved` 参数保留的 CPU 。从1.17版本开始,CPU保留列表可以通过 kublet 的 '--reserved-cpus' 参数显式地设置。
-通过 '--reserved-cpus' 指定的显式CPU列表优先于使用 '--kube-reserved' 和 '--system-reserved' 参数指定的保留CPU。 通过这些参数预留的 CPU 是以整数方式,按物理内
-核 ID 升序从初始共享池获取的。 共享池是 `BestEffort` 和 `Burstable` pod 运行
-的 CPU 集合。`Guaranteed` pod 中的容器,如果声明了非整数值的 CPU `requests` ,也将运行在共享池的 CPU 上。只有 `Guaranteed` pod 中,指定了整数型 CPU `requests` 的容器,才会被分配独占 CPU 资源。
+此策略管理一个 CPU 共享池,该共享池最初包含节点上所有的 CPU 资源。
+可独占性 CPU 资源数量等于节点的 CPU 总量减去通过 kubelet `--kube-reserved` 或 `--system-reserved`
+参数保留的 CPU 资源。
+从 1.17 版本开始,可以通过 kubelet `--reserved-cpus` 参数显式地指定 CPU 预留列表。
+由 `--reserved-cpus` 指定的显式 CPU 列表优先于由 `--kube-reserved` 和 `--system-reserved`
+指定的 CPU 预留。
+通过这些参数预留的 CPU 是以整数方式,按物理核心 ID 升序从初始共享池获取的。
+共享池是 `BestEffort` 和 `Burstable` Pod 运行的 CPU 集合。
+`Guaranteed` Pod 中的容器,如果声明了非整数值的 CPU `requests`,也将运行在共享池的 CPU 上。
+只有 `Guaranteed` Pod 中,指定了整数型 CPU `requests` 的容器,才会被分配独占 CPU 资源。
-该 pod 属于 `Burstable` QoS 类型,因为其资源 `requests` 不等于 `limits`。
+该 Pod 属于 `Burstable` QoS 类型,因为其资源 `requests` 不等于 `limits`。
所以该容器运行在共享 CPU 池中。
```yaml
@@ -322,19 +388,35 @@ equal to one. The `nginx` container is granted 2 exclusive CPUs.
#### Static 策略选项
-如果使用 `full-pcpus-only` 策略选项,static 策略总是会分配完整的物理核心。
-你可以通过在 CPUManager 策略选项里加上 `full-pcups-only=true` 来启用该选项。
+你可以使用以下特性门控根据成熟度级别打开或关闭选项组:
+* `CPUManagerPolicyBetaOptions` 默认启用。禁用以隐藏 beta 级选项。
+* `CPUManagerPolicyAlphaOptions` 默认禁用。启用以显示 alpha 级选项。
+你仍然必须使用 `CPUManagerPolicyOptions` kubelet 选项启用每个选项。
+
+静态 `CPUManager` 策略存在以下策略选项:
+* `full-pcpus-only`(beta,默认可见)
+* `distribute-cpus-across-numa`(alpha,默认隐藏)
+
+如果使用 `full-pcpus-only` 策略选项,static 策略总是会分配完整的物理核心。
默认情况下,如果不使用该选项,static 策略会使用拓扑感知最适合的分配方法来分配 CPU。
在启用了 SMT 的系统上,此策略所分配是与硬件线程对应的、独立的虚拟核。
这会导致不同的容器共享相同的物理核心,该行为进而会导致
@@ -344,5 +426,47 @@ With the option enabled, the pod will be admitted by the kubelet only if the CPU
can be fulfilled by allocating full physical cores.
If the pod does not pass the admission, it will be put in Failed state with the message `SMTAlignmentError`.
-->
-启用该选项之后,只有当一个 Pod 里所有容器的 CPU 请求都能够分配到完整的物理核心时,kubelet 才会接受该 Pod。
-如果 Pod 没有被准入,它会被置于 Failed 状态,错误消息是 `SMTAlignmentError`。
\ No newline at end of file
+启用该选项之后,只有当一个 Pod 里所有容器的 CPU 请求都能够分配到完整的物理核心时,
+kubelet 才会接受该 Pod。
+如果 Pod 没有被准入,它会被置于 Failed 状态,错误消息是 `SMTAlignmentError`。
+
+
+如果使用 `distribute-cpus-across-numa` 策略选项,
+在需要多个 NUMA 节点来满足分配的情况下,
+static 策略会在 NUMA 节点上平均分配 CPU。
+默认情况下,`CPUManager` 会将 CPU 分配到一个 NUMA 节点上,直到它被填满,
+剩余的 CPU 会简单地溢出到下一个 NUMA 节点。
+这会导致依赖于同步屏障(以及类似的同步原语)的并行代码出现不期望的瓶颈,
+因为此类代码的运行速度往往取决于最慢的工作线程
+(由于至少一个 NUMA 节点存在可用 CPU 较少的情况,因此速度变慢)。
+通过在 NUMA 节点上平均分配 CPU,
+应用程序开发人员可以更轻松地确保没有某个工作线程单独受到 NUMA 影响,
+从而提高这些类型应用程序的整体性能。
+
+
+可以通过将 `full-pcups-only=true` 添加到 CPUManager 策略选项来启用 `full-pcpus-only` 选项。
+同样地,可以通过将 `distribute-cpus-across-numa=true`
+添加到 CPUManager 策略选项来启用 `distribute-cpus-across-numa` 选项。
+当两者都设置时,它们是“累加的”,因为 CPU 将分布在 NUMA 节点的 full-pcpus 块中,
+而不是单个核心。
From 1ec1d50c4994fda47f800f715a93523333b622b2 Mon Sep 17 00:00:00 2001
From: Patrick Ohly
Date: Wed, 30 Mar 2022 19:10:47 +0200
Subject: [PATCH 059/245] contextual logging blog post
This is a copy of
https://github.com/kubernetes/contributor-site/blob/11c75c25cfb0aa1f50686e40f4a64e8ccfbb8a44/content/en/blog/2022/2022-05-25-contextual-logging.md
with the canonical URL added to the header.
---
.../2022-05-25-contextual-logging/index.md | 251 ++++++++++++++++++
1 file changed, 251 insertions(+)
create mode 100644 content/en/blog/_posts/2022-05-25-contextual-logging/index.md
diff --git a/content/en/blog/_posts/2022-05-25-contextual-logging/index.md b/content/en/blog/_posts/2022-05-25-contextual-logging/index.md
new file mode 100644
index 0000000000..2d5ef5c4c7
--- /dev/null
+++ b/content/en/blog/_posts/2022-05-25-contextual-logging/index.md
@@ -0,0 +1,251 @@
+---
+layout: blog
+title: "Contextual Logging in Kubernetes 1.24"
+date: 2022-05-25
+slug: contextual-logging
+canonicalUrl: https://kubernetes.dev/blog/2022/05/25/contextual-logging/
+---
+
+ **Authors:** Patrick Ohly (Intel)
+
+The [Structured Logging Working
+Group](https://github.com/kubernetes/community/blob/master/wg-structured-logging/README.md)
+has added new capabilities to the logging infrastructure in Kubernetes
+1.24. This blog post explains how developers can take advantage of those to
+make log output more useful and how they can get involved with improving Kubernetes.
+
+## Structured logging
+
+The goal of [structured
+logging](https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1602-structured-logging/README.md)
+is to replace C-style formatting and the resulting opaque log strings with log
+entries that have a well-defined syntax for storing message and parameters
+separately, for example as a JSON struct.
+
+When using the traditional klog text output format for structured log calls,
+strings were originally printed with `\n` escape sequences, except when
+embedded inside a struct. For structs, log entries could still span multiple
+lines, with no clean way to split the log stream into individual entries:
+
+```
+I1112 14:06:35.783529 328441 structured_logging.go:51] "using InfoS" longData={Name:long Data:Multiple
+lines
+with quite a bit
+of text. internal:0}
+I1112 14:06:35.783549 328441 structured_logging.go:52] "using InfoS with\nthe message across multiple lines" int=1 stringData="long: Multiple\nlines\nwith quite a bit\nof text." str="another value"
+```
+
+Now, the `<` and `>` markers along with indentation are used to ensure that splitting at a
+klog header at the start of a line is reliable and the resulting output is human-readable:
+
+```
+I1126 10:31:50.378204 121736 structured_logging.go:59] "using InfoS" longData=<
+ {Name:long Data:Multiple
+ lines
+ with quite a bit
+ of text. internal:0}
+ >
+I1126 10:31:50.378228 121736 structured_logging.go:60] "using InfoS with\nthe message across multiple lines" int=1 stringData=<
+ long: Multiple
+ lines
+ with quite a bit
+ of text.
+ > str="another value"
+```
+
+Note that the log message itself is printed with quoting. It is meant to be a
+fixed string that identifies a log entry, so newlines should be avoided there.
+
+Before Kubernetes 1.24, some log calls in kube-scheduler still used `klog.Info`
+for multi-line strings to avoid the unreadable output. Now all log calls have
+been updated to support structured logging.
+
+## Contextual logging
+
+[Contextual logging](https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/3077-contextual-logging/README.md)
+is based on the [go-logr API](https://github.com/go-logr/logr#a-minimal-logging-api-for-go). The key
+idea is that libraries are passed a logger instance by their caller and use
+that for logging instead of accessing a global logger. The binary decides about
+the logging implementation, not the libraries. The go-logr API is designed
+around structured logging and supports attaching additional information to a
+logger.
+
+This enables additional use cases:
+
+- The caller can attach additional information to a logger:
+ - [`WithName`](https://pkg.go.dev/github.com/go-logr/logr#Logger.WithName) adds a prefix
+ - [`WithValues`](https://pkg.go.dev/github.com/go-logr/logr#Logger.WithValues) adds key/value pairs
+
+ When passing this extended logger into a function and a function uses it
+ instead of the global logger, the additional information is
+ then included in all log entries, without having to modify the code that
+ generates the log entries. This is useful in highly parallel applications
+ where it can become hard to identify all log entries for a certain operation
+ because the output from different operations gets interleaved.
+
+- When running unit tests, log output can be associated with the current test.
+ Then when a test fails, only the log output of the failed test gets shown
+ by `go test`. That output can also be more verbose by default because it
+ will not get shown for successful tests. Tests can be run in parallel
+ without interleaving their output.
+
+One of the design decisions for contextual logging was to allow attaching a
+logger as value to a `context.Context`. Since the logger encapsulates all
+aspects of the intended logging for the call, it is *part* of the context and
+not just *using* it. A practical advantage is that many APIs already have a
+`ctx` parameter or adding one has additional advantages, like being able to get
+rid of `context.TODO()` calls inside the functions.
+
+Another decision was to not break compatibility with klog v2:
+
+- Libraries that use the traditional klog logging calls in a binary that has
+ set up contextual logging will work and log through the logging backend
+ chosen by the binary. However, such log output will not include the
+ additional information and will not work well in unit tests, so libraries
+ should be modified to support contextual logging. The [migration guide](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md)
+ for structured logging has been extended to also cover contextual logging.
+
+- When a library supports contextual logging and retrieves a logger from its
+ context, it will still work in a binary that does not initialize contextual
+ logging because it will get a logger that logs through klog.
+
+In Kubernetes 1.24, contextual logging is a new alpha feature with
+`ContextualLogging` as feature gate. When disabled (the default), the new klog
+API calls for contextual logging (see below) become no-ops to avoid performance
+or functional regressions.
+
+No Kubernetes component has been converted yet. An [example program](https://github.com/kubernetes/kubernetes/blob/v1.24.0-beta.0/staging/src/k8s.io/component-base/logs/example/cmd/logger.go)
+in the Kubernetes repository demonstrates how to enable contextual logging in a
+binary and how the output depends on the binary's parameters:
+
+```console
+$ cd $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/component-base/logs/example/cmd/
+$ go run . --help
+...
+ --feature-gates mapStringBool A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:
+ AllAlpha=true|false (ALPHA - default=false)
+ AllBeta=true|false (BETA - default=false)
+ ContextualLogging=true|false (ALPHA - default=false)
+$ go run . --feature-gates ContextualLogging=true
+...
+I0404 18:00:02.916429 451895 logger.go:94] "example/myname: runtime" foo="bar" duration="1m0s"
+I0404 18:00:02.916447 451895 logger.go:95] "example: another runtime" foo="bar" duration="1m0s"
+```
+
+The `example` prefix and `foo="bar"` were added by the caller of the function
+which logs the `runtime` message and `duration="1m0s"` value.
+
+The sample code for klog includes an
+[example](https://github.com/kubernetes/klog/blob/v2.60.1/ktesting/example/example_test.go)
+for a unit test with per-test output.
+
+## klog enhancements
+
+### Contextual logging API
+
+The following calls manage the lookup of a logger:
+
+[`FromContext`](https://pkg.go.dev/k8s.io/klog/v2#FromContext)
+: from a `context` parameter, with fallback to the global logger
+
+[`Background`](https://pkg.go.dev/k8s.io/klog/v2#Background)
+: the global fallback, with no intention to support contextual logging
+
+[`TODO`](https://pkg.go.dev/k8s.io/klog/v2#TODO)
+: the global fallback, but only as a temporary solution until the function gets extended to accept
+ a logger through its parameters
+
+[`SetLoggerWithOptions`](https://pkg.go.dev/k8s.io/klog/v2#SetLoggerWithOptions)
+: changes the fallback logger; when called with [`ContextualLogger(true)`](https://pkg.go.dev/k8s.io/klog/v2#ContextualLogger),
+ the logger is ready to be called directly, in which case logging will be done
+ without going through klog
+
+To support the feature gate mechanism in Kubernetes, klog has wrapper calls for
+the corresponding go-logr calls and a global boolean controlling their behavior:
+
+- [`LoggerWithName`](https://pkg.go.dev/k8s.io/klog/v2#LoggerWithName)
+- [`LoggerWithValues`](https://pkg.go.dev/k8s.io/klog/v2#LoggerWithValues)
+- [`NewContext`](https://pkg.go.dev/k8s.io/klog/v2#NewContext)
+- [`EnableContextualLogging`](https://pkg.go.dev/k8s.io/klog/v2#EnableContextualLogging)
+
+Usage of those functions in Kubernetes code is enforced with a linter
+check. The klog default for contextual logging is to enable the functionality
+because it is considered stable in klog. It is only in Kubernetes binaries
+where that default gets overridden and (in some binaries) controlled via the
+`--feature-gate` parameter.
+
+### ktesting logger
+
+The new [ktesting](https://pkg.go.dev/k8s.io/klog/v2@v2.60.1/ktesting) package
+implements logging through `testing.T` using klog's text output format. It has
+a [single API call](https://pkg.go.dev/k8s.io/klog/v2@v2.60.1/ktesting#NewTestContext) for
+instrumenting a test case and [support for command line flags](https://pkg.go.dev/k8s.io/klog/v2@v2.60.1/ktesting/init).
+
+### klogr
+
+[`klog/klogr`](https://pkg.go.dev/k8s.io/klog/v2@v2.60.1/klogr) continues to be
+supported and it's default behavior is unchanged: it formats structured log
+entries using its own, custom format and prints the result via klog.
+
+However, this usage is discouraged because that format is neither
+machine-readable (in contrast to real JSON output as produced by zapr, the
+go-logr implementation used by Kubernetes) nor human-friendly (in contrast to
+the klog text format).
+
+Instead, a klogr instance should be created with
+[`WithFormat(FormatKlog)`](https://pkg.go.dev/k8s.io/klog/v2@v2.60.1/klogr#WithFormat)
+which chooses the klog text format. A simpler construction method with the same
+result is the new
+[`klog.NewKlogr`](https://pkg.go.dev/k8s.io/klog/v2#NewKlogr). That is the
+logger that klog returns as fallback when nothing else is configured.
+
+### Reusable output test
+
+A lot of go-logr implementations have very similar unit tests where they check
+the result of certain log calls. If a developer didn't know about certain
+caveats like for example a `String` function that panics when called, then it
+is likely that both the handling of such caveats and the unit test are missing.
+
+[`klog.test`](https://pkg.go.dev/k8s.io/klog/v2@v2.60.1/test) is a reusable set
+of test cases that can be applied to a go-logr implementation.
+
+### Output flushing
+
+klog used to start a goroutine unconditionally during `init` which flushed
+buffered data at a hard-coded interval. Now that goroutine is only started on
+demand (i.e. when writing to files with buffering) and can be controlled with
+[`StopFlushDaemon`](https://pkg.go.dev/k8s.io/klog/v2#StopFlushDaemon) and
+[`StartFlushDaemon`](https://pkg.go.dev/k8s.io/klog/v2#StartFlushDaemon).
+
+When a go-logr implementation buffers data, flushing that data can be
+integrated into [`klog.Flush`](https://pkg.go.dev/k8s.io/klog/v2#Flush) by
+registering the logger with the
+[`FlushLogger`](https://pkg.go.dev/k8s.io/klog/v2#FlushLogger) option.
+
+### Various other changes
+
+For a description of all other enhancements see in the [release notes](https://github.com/kubernetes/klog/releases).
+
+## logcheck
+
+Originally designed as a linter for structured log calls, the
+ [`logcheck`](https://github.com/kubernetes/klog/tree/788efcdee1e9be0bfbe5b076343d447314f2377e/hack/tools/logcheck)
+tool has been enhanced to support also contextual logging and traditional klog
+log calls. These enhanced checks already found bugs in Kubernetes, like calling
+`klog.Info` instead of `klog.Infof` with a format string and parameters.
+
+It can be included as a plugin in a `golangci-lint` invocation, which is how
+[Kubernetes uses it now](https://github.com/kubernetes/kubernetes/commit/17e3c555c5115f8c9176bae10ba45baa04d23a7b),
+or get invoked stand-alone.
+
+We are in the process of [moving the tool](https://github.com/kubernetes/klog/issues/312) into a new repository because it isn't
+really related to klog and its releases should be tracked and tagged properly.
+
+## Next steps
+
+The [Structured Logging WG](https://github.com/kubernetes/community/tree/master/wg-structured-logging)
+is always looking for new contributors. The migration
+away from C-style logging is now going to target structured, contextual logging
+in one step to reduce the overall code churn and number of PRs. Changing log
+calls is good first contribution to Kubernetes and an opportunity to get to
+know code in various different areas.
From 21006412208242601bba1eab3f061c90c7fb028c Mon Sep 17 00:00:00 2001
From: zyy19981018
Date: Thu, 5 May 2022 22:00:20 +0800
Subject: [PATCH 060/245] [zh]update
content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
[zh]update content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
[zh]update content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
---
.../kube-scheduler.md | 505 +++++-------------
1 file changed, 140 insertions(+), 365 deletions(-)
diff --git a/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md b/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
index dbb9eb3cfa..0da24c1f84 100644
--- a/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
+++ b/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
@@ -20,14 +20,14 @@ each Pod in the scheduling queue according to constraints and available
resources. The scheduler then ranks each valid Node and binds the Pod to a
suitable Node. Multiple different schedulers may be used within a cluster;
kube-scheduler is the reference implementation.
-See [scheduling](/docs/concepts/scheduling-eviction/)
+See [scheduling](zh/docs/concepts/scheduling-eviction/)
for more information about scheduling and the kube-scheduler component.
-->
Kubernetes 调度器是一个控制面进程,负责将 Pods 指派到节点上。
调度器基于约束和可用资源为调度队列中每个 Pod 确定其可合法放置的节点。
调度器之后对所有合法的节点进行排序,将 Pod 绑定到一个合适的节点。
在同一个集群中可以使用多个不同的调度器;kube-scheduler 是其参考实现。
-参阅[调度](/zh/docs/concepts/scheduling-eviction/)
+参阅[调度](zh/docs/concepts/scheduling-eviction/)
以获得关于调度和 kube-scheduler 组件的更多信息。
```
@@ -44,42 +44,6 @@ kube-scheduler [flags]
-
@@ -170,9 +185,9 @@ Use this token for both discovery-token and tls-bootstrap-token when those value
-[实验] 指向 '真实' 宿主机根文件系统的路径。
+
[实验] 指向 '真实' 宿主机根文件系统的路径。
From 45a7eb57f974d832878411d1b446d60f2ea0c5cc Mon Sep 17 00:00:00 2001
From: song
Date: Fri, 20 May 2022 00:04:09 +0800
Subject: [PATCH 065/245] fix typo
Signed-off-by: song
---
.../manage-resources/memory-default-namespace.md | 2 +-
content/en/docs/tasks/administer-cluster/reconfigure-kubelet.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md
index 025277127d..1013800e44 100644
--- a/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md
+++ b/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md
@@ -172,7 +172,7 @@ resources:
If your namespace has a memory {{< glossary_tooltip text="resource quota" term_id="resource-quota" >}}
configured,
it is helpful to have a default value in place for memory limit.
-Here are two of the restrictions that a resource quota imposes on a namespace:
+Here are three of the restrictions that a resource quota imposes on a namespace:
* For every Pod that runs in the namespace, the Pod and each of its containers must have a memory limit.
(If you specify a memory limit for every container in a Pod, Kubernetes can infer the Pod-level memory
diff --git a/content/en/docs/tasks/administer-cluster/reconfigure-kubelet.md b/content/en/docs/tasks/administer-cluster/reconfigure-kubelet.md
index 82a501e5d4..e1effd8f05 100644
--- a/content/en/docs/tasks/administer-cluster/reconfigure-kubelet.md
+++ b/content/en/docs/tasks/administer-cluster/reconfigure-kubelet.md
@@ -29,7 +29,7 @@ Please find documentation on this feature in [earlier versions of documentation]
There is no recommended replacement for this feature that works generically
across various Kubernetes distributions. If you are using managed Kubernetes
version, please consult with the vendor hosting Kubernetes for the best
-practices for customizing your Kubernetes. If you are using KubeAdm, refer to
+practices for customizing your Kubernetes. If you are using `kubeadm`, refer to
[Configuring each kubelet in your cluster using kubeadm](/docs/setup/production-environment/tools/kubeadm/kubelet-integration/).
In order to migrate off the Dynamic Kubelet Configuration feature, the
From 03f0d23228304d6dfa58123d9e01d0c2c6c8cffe Mon Sep 17 00:00:00 2001
From: Jordan Liggitt
Date: Thu, 19 May 2022 14:51:51 -0400
Subject: [PATCH 066/245] Clarify privileged Pod Security Standard description
---
content/en/docs/concepts/security/pod-security-standards.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/docs/concepts/security/pod-security-standards.md b/content/en/docs/concepts/security/pod-security-standards.md
index 393468ac74..55ec37f5f7 100644
--- a/content/en/docs/concepts/security/pod-security-standards.md
+++ b/content/en/docs/concepts/security/pod-security-standards.md
@@ -32,7 +32,7 @@ typically aimed at system- and infrastructure-level workloads managed by privile
The Privileged policy is defined by an absence of restrictions. For allow-by-default enforcement
mechanisms (such as gatekeeper), the Privileged policy may be an absence of applied constraints
rather than an instantiated profile. In contrast, for a deny-by-default mechanism (such as Pod
-Security Policy) the Privileged policy should enable all controls (disable all restrictions).
+Security Policy) the Privileged policy should disable all restrictions.
### Baseline
From 3bff833b59355302d983614961e8f9447c605dbb Mon Sep 17 00:00:00 2001
From: Paul Bastide
Date: Thu, 19 May 2022 16:21:30 -0400
Subject: [PATCH 067/245] Update topology-manager.md
Fixes a spelling mistake with co-ordinate
---
content/en/docs/tasks/administer-cluster/topology-manager.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/en/docs/tasks/administer-cluster/topology-manager.md b/content/en/docs/tasks/administer-cluster/topology-manager.md
index e8d2e7c19d..4002537f0c 100644
--- a/content/en/docs/tasks/administer-cluster/topology-manager.md
+++ b/content/en/docs/tasks/administer-cluster/topology-manager.md
@@ -20,7 +20,7 @@ An increasing number of systems leverage a combination of CPUs and hardware acce
In order to extract the best performance, optimizations related to CPU isolation, memory and device locality are required. However, in Kubernetes, these optimizations are handled by a disjoint set of components.
-_Topology Manager_ is a Kubelet component that aims to co-ordinate the set of components that are responsible for these optimizations.
+_Topology Manager_ is a Kubelet component that aims to coordinate the set of components that are responsible for these optimizations.
@@ -267,4 +267,4 @@ Using this information the Topology Manager calculates the optimal hint for the
### Known Limitations
1. The maximum number of NUMA nodes that Topology Manager allows is 8. With more than 8 NUMA nodes there will be a state explosion when trying to enumerate the possible NUMA affinities and generating their hints.
-2. The scheduler is not topology-aware, so it is possible to be scheduled on a node and then fail on the node due to the Topology Manager.
\ No newline at end of file
+2. The scheduler is not topology-aware, so it is possible to be scheduled on a node and then fail on the node due to the Topology Manager.
From 79c01ff06dbff43d56d2c7463be88706e5552945 Mon Sep 17 00:00:00 2001
From: Jordan Liggitt
Date: Thu, 19 May 2022 17:03:39 -0400
Subject: [PATCH 068/245] Update
content/en/docs/concepts/security/pod-security-standards.md
Co-authored-by: Tim Allclair
---
content/en/docs/concepts/security/pod-security-standards.md | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/content/en/docs/concepts/security/pod-security-standards.md b/content/en/docs/concepts/security/pod-security-standards.md
index 55ec37f5f7..c95ded28cd 100644
--- a/content/en/docs/concepts/security/pod-security-standards.md
+++ b/content/en/docs/concepts/security/pod-security-standards.md
@@ -29,9 +29,8 @@ This guide outlines the requirements of each policy.
**The _Privileged_ policy is purposely-open, and entirely unrestricted.** This type of policy is
typically aimed at system- and infrastructure-level workloads managed by privileged, trusted users.
-The Privileged policy is defined by an absence of restrictions. For allow-by-default enforcement
-mechanisms (such as gatekeeper), the Privileged policy may be an absence of applied constraints
-rather than an instantiated profile. In contrast, for a deny-by-default mechanism (such as Pod
+The Privileged policy is defined by an absence of restrictions. Allow-by-default
+mechanisms (such as gatekeeper) may be Privileged by default. In contrast, for a deny-by-default mechanism (such as Pod
Security Policy) the Privileged policy should disable all restrictions.
### Baseline
From 10ae8386ee9dfc0ca06566b52908d1f439a6f8a3 Mon Sep 17 00:00:00 2001
From: Qiming Teng
Date: Fri, 20 May 2022 06:37:30 +0800
Subject: [PATCH 069/245] Update kubeadm config API
---
.../reference/config-api/kubeadm-config.v1beta2.md | 14 ++++++++------
.../reference/config-api/kubeadm-config.v1beta3.md | 8 ++++----
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/content/en/docs/reference/config-api/kubeadm-config.v1beta2.md b/content/en/docs/reference/config-api/kubeadm-config.v1beta2.md
index 5d75df5b53..377ac021b6 100644
--- a/content/en/docs/reference/config-api/kubeadm-config.v1beta2.md
+++ b/content/en/docs/reference/config-api/kubeadm-config.v1beta2.md
@@ -143,7 +143,7 @@ configuration types to be used during a kubeadm init run.
tlsBootstrapToken is a token used for TLS bootstrapping.
-If bootstrapToken is set, this field is defaulted to .bootstrapToken.token, but can be overridden. If file is set, this field must be set in case the KubeConfigFile does not
+If bootstrapToken is set, this field is defaulted to .bootstrapToken.token,
+but can be overridden.
+If file is set, this field must be set in case the KubeConfigFile does not
contain any other authentication information.
@@ -1267,7 +1269,7 @@ Defaults to the hostname of the node if not provided.
string
-
criSocket is used to retrieve container runtime information. This information will
+
criSocket is used to retrieve container runtime information. This information will
be annotated to the Node API object, for later re-use.
@@ -1276,9 +1278,9 @@ be annotated to the Node API object, for later re-use.
taints specifies the taints the Node API object should be registered with.
-If this field is unset, i.e. nil, in the kubeadm init process it will be defaulted to
-'node-role.kubernetes.io/master=""'. If you don't want to taint your control-plane node,
-set this field to an empty list, i.e. taints: [] in the YAML file. This field is
+If this field is unset, i.e. nil, in the kubeadm init process it will be defaulted with
+a control-plane taint for control-plane nodes. If you don't want to taint your control-plane
+node, set this field to an empty list, i.e. taints: [], in the YAML file. This field is
solely used for Node registration.
diff --git a/content/en/docs/reference/config-api/kubeadm-config.v1beta3.md b/content/en/docs/reference/config-api/kubeadm-config.v1beta3.md
index ca7ef7c287..75fc7c1ecf 100644
--- a/content/en/docs/reference/config-api/kubeadm-config.v1beta3.md
+++ b/content/en/docs/reference/config-api/kubeadm-config.v1beta3.md
@@ -152,7 +152,7 @@ configuration types to be used during a kubeadm init run.
criSocket:"/var/run/dockershim.sock"taints:- key:"kubeadmNode"
-value:"master"
+value:"someValue"effect:"NoSchedule"kubeletExtraArgs:v:4
@@ -1160,9 +1160,9 @@ This information will be annotated to the Node API object, for later re-use
tains specifies the taints the Node API object should be registered with.
-If this field is unset, i.e. nil, in the kubeadm init process it will be defaulted to
-taints: ["node-role.kubernetes.io/master:""].
-If you don't want to taint your control-plane node, set this field to an empty slice,
+If this field is unset, i.e. nil, in the kubeadm init process it will be defaulted
+with a control-plane taint for control-plane nodes.
+If you don't want to taint your control-plane node, set this field to an empty list,
i.e. taints: [] in the YAML file. This field is solely used for Node registration.
@@ -51,9 +66,9 @@ API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使
-要绑定到 API 服务器的端口。
+
要绑定到 API 服务器的端口。
@@ -68,9 +83,9 @@ Port for the API Server to bind to.
-保存和存储证书的路径。
+
保存和存储证书的路径。
@@ -80,9 +95,9 @@ The path where to save and store the certificates.
-kubeadm 配置文件的路径。
+
kubeadm 配置文件的路径。
@@ -92,9 +107,9 @@ kubeadm 配置文件的路径。
-为控制平面指定一个稳定的 IP 地址或 DNS 名称。
+
为控制平面指定一个稳定的 IP 地址或 DNS 名称。
@@ -104,9 +119,9 @@ Specify a stable IP address or DNS name for the control plane.
-scheduler 操作的帮助命令
+
scheduler 操作的帮助命令
@@ -121,9 +136,9 @@ scheduler 操作的帮助命令
-kubeconfig 文件的保存路径。
+
kubeconfig 文件的保存路径。
@@ -138,9 +153,9 @@ kubeconfig 文件的保存路径。
-为控制平面指定特定的 Kubernetes 版本。
+
为控制平面指定特定的 Kubernetes 版本。
@@ -166,9 +181,9 @@ Choose a specific Kubernetes version for the control plane.
-[实验] 到 '真实' 主机根文件系统的路径。
+
[实验] 到 '真实' 主机根文件系统的路径。
From 7ff439d8f1879c222f9bc8752782c20002e3a129 Mon Sep 17 00:00:00 2001
From: yuli
Date: Fri, 20 May 2022 10:59:50 +0800
Subject: [PATCH 078/245] [zh]Sync reference-14
[zh]Sync reference-14
---
.../docs/reference/using-api/api-concepts.md | 23 +++++++------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/content/zh/docs/reference/using-api/api-concepts.md b/content/zh/docs/reference/using-api/api-concepts.md
index bf31ae7a78..729eefae64 100644
--- a/content/zh/docs/reference/using-api/api-concepts.md
+++ b/content/zh/docs/reference/using-api/api-concepts.md
@@ -1066,8 +1066,6 @@ string, working as an enum, and the only accepted values are:
`All`
: Every stage runs as normal, except for the final storage stage where side effects
are prevented.
-
-For example:
-->
### 发起试运行请求 {#make-a-dry-run-request}
@@ -1140,11 +1138,11 @@ generated fields may differ.
Some values of an object are typically generated before the object is persisted. It is important not to rely upon the values of these fields set by a dry-run request, since these values will likely be different in dry-run mode from when the real request is made. Some of these fields are:
* `name`: if `generateName` is set, `name` will have a unique random name
-* `creationTimestamp`/`deletionTimestamp`: records the time of creation/deletion
-* `UID`: uniquely identifies the object and is randomly generated (non-deterministic)
+* `creationTimestamp` / `deletionTimestamp`: records the time of creation/deletion
+* `UID`: [uniquely identifies](/docs/concepts/overview/working-with-objects/names/#uids) the object and is randomly generated (non-deterministic)
* `resourceVersion`: tracks the persisted version of the object
* Any field set by a mutating admission controller
-* For the `Service` resource: Ports or IPs that kube-apiserver assigns to v1.Service objects
+* For the `Service` resource: Ports or IP addresses that the kube-apiserver assigns to Service objects
-->
### 生成值 {#generated-values}
@@ -1153,11 +1151,12 @@ Some values of an object are typically generated before the object is persisted.
值很可能不同。这类字段有:
* `name`:如果设置了 `generateName` 字段,则 `name` 会获得一个唯一的随机名称
-* `creationTimestamp`/`deletionTimestamp`:记录对象的创建/删除时间
-* `UID`:唯一性标识对象,取值随机生成(非确定性)
+* `creationTimestamp` / `deletionTimestamp`:记录对象的创建/删除时间
+* `UID`:[唯一标识](/zh/docs/concepts/overview/working-with-objects/names/#uids)对象,
+ 取值随机生成(非确定性)
* `resourceVersion`: 跟踪对象的持久化(存储)版本
* 变更性准入控制器所设置的字段
-* 对于 `Service` 资源:`kube-apiserver` 为 `v1.Service` 对象分配的端口和 IP
+* 对于 `Service` 资源:`kube-apiserver` 为 `Service` 对象分配的端口和 IP 地址
{{< table caption="list 操作的 resourceVersionMatch 与分页参数" >}}
From c3dc4d34aeffa72e78e2146c79fd5a56b8d737da Mon Sep 17 00:00:00 2001
From: yuli
Date: Fri, 20 May 2022 21:50:48 +0800
Subject: [PATCH 079/245] [zh]Sync reference-16
---
.../config-api/kubelet-config.v1alpha1.md | 44 +++++++++----------
1 file changed, 21 insertions(+), 23 deletions(-)
diff --git a/content/zh/docs/reference/config-api/kubelet-config.v1alpha1.md b/content/zh/docs/reference/config-api/kubelet-config.v1alpha1.md
index ad7e4908f4..9a62ac5ec6 100644
--- a/content/zh/docs/reference/config-api/kubelet-config.v1alpha1.md
+++ b/content/zh/docs/reference/config-api/kubelet-config.v1alpha1.md
@@ -26,8 +26,6 @@ auto_generated: true
-->
**出现在:**
-- [LoggingConfiguration](#LoggingConfiguration)
-
@@ -41,8 +39,8 @@ FormatOptions 包含为不同类型日志格式提供的选项。
JSONOptions
@@ -218,16 +201,11 @@ Default: 10250
no authentication/authorization.
The port number must be between 1 and 65535, inclusive.
Setting this field to 0 disables the read-only service.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may disrupt components that interact with the Kubelet server.
Default: 0 (disabled)
-->
@@ -241,17 +219,12 @@ if any, concatenated after server cert). If tlsCertFile and
tlsPrivateKeyFile are not provided, a self-signed certificate
and key are generated for the public address and saved to the directory
passed to the Kubelet's --cert-dir flag.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may disrupt components that interact with the Kubelet server.
Default:"quot;
-->
默认值:false
@@ -343,20 +294,12 @@ signing a serving certificate, the Kubelet will request a certificate from
the 'certificates.k8s.io' API. This requires an approver to approve the
certificate signing requests (CSR). The RotateKubeletServerCertificate feature
must be enabled when setting this field.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-disabling it will stop the renewal of Kubelet server certificates, which can
-disrupt components that interact with the Kubelet server in the long term,
-due to certificate expiration.
Default: false
-->
serverTLSBootstrap用来启用服务器证书引导。系统不再使用自签名的服务证书,
kubelet 会调用certificates.k8s.io API 来请求证书。
需要有一个批复人来批准证书签名请求(CSR)。
设置此字段时,RotateKubeletServerCertificate特性必须被启用。
默认值:5
@@ -446,17 +373,11 @@ Default: 5
pulls to burst to this number, while still not exceeding registryPullQPS.
The value must not be a negative number.
Only used if registryPullQPS is greater than 0.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may impact scalability by changing the amount of traffic produced
-by image pulls.
Default: 10
-->
@@ -769,19 +618,12 @@ image garbage collection is always run. The percent is calculated by
dividing this field value by 100, so this field must be between 0 and
100, inclusive. When specified, the value must be greater than
imageGCLowThresholdPercent.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may trigger or delay garbage collection, and may change the image overhead
-on the node.
Default: 85
-->
@@ -795,37 +637,25 @@ image garbage collection is never run. Lowest disk usage to garbage
collect to. The percent is calculated by dividing this field value by 100,
so the field value must be between 0 and 100, inclusive. When specified, the
value must be less than imageGCHighThresholdPercent.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may trigger or delay garbage collection, and may change the image overhead
-on the node.
Default: 80
-->
@@ -854,15 +680,11 @@ Default: ""
all non-kernel processes that are not already in a container. Empty
for no container. Rolling back the flag requires a reboot.
The cgroupRoot must be specified if this field is not empty.
-Dynamic Kubelet Config (deprecated): This field should not be updated without a full node
-reboot. It is safest to keep this value the same as the local config.
Default: "&qout;
-->
@@ -1016,8 +806,6 @@ resources;
of CPU and device resources.
Policies other than "none" require the TopologyManager feature gate to be enabled.
-Dynamic Kubelet Config (deprecated): This field should not be updated without a full node
-reboot. It is safest to keep this value the same as the local config.
Default: "none"
-->
topologyManagerPolicy是要使用的拓扑管理器策略名称。合法值包括:
@@ -1028,8 +816,6 @@ Default: "none"
single-numa-node:kubelet 仅允许在 CPU 和设备资源上对齐到同一 NUMA 节点的 Pod。
@@ -1068,34 +854,25 @@ the minimum percentage of a resource reserved for exclusive use by the
guaranteed QoS tier.
Currently supported resources: "memory"
Requires the QOSReserved feature gate to be enabled.
-Dynamic Kubelet Config (deprecated): This field should not be updated without a full node
-reboot. It is safest to keep this value the same as the local config.
Default: nil
-->
kubeAPIQPS设置与 Kubernetes API 服务器通信时要使用的 QPS(每秒查询数)。
-
当 DynamicKubeletConfig (已弃用,默认为关闭)被启用时,
-如果动态更新了此字段,请考虑这可能因为 kubelet 与 API 服务器之间流量的变化而影响集群扩缩能力。
默认值:5
@@ -1357,16 +1065,10 @@ Default: 5
kubeAPIBurst设置与 Kubernetes API 服务器通信时突发的流量级别。
此字段取值不可以是负数。
-
当 DynamicKubeletConfig (已弃用,默认为关闭)被启用时,
-如果动态更新了此字段,请考虑这可能因为 kubelet 与 API 服务器之间流量的变化而影响集群扩缩能力。
默认值:10
@@ -1379,16 +1081,11 @@ Default: 10
at a time. We recommend ∗not∗ changing the default value on nodes that
run docker daemon with version < 1.9 or an Aufs storage backend.
Issue #10959 has more details.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may impact the performance of image pulls.
Default: true
-->
@@ -1493,10 +1168,6 @@ effectively caps the Pod's terminationGracePeriodSeconds value during soft evict
Note: Due to issue #64530, the behavior has a bug where this value currently just
overrides the grace period during soft eviction, which can increase the grace
period from what is set on the Pod. This bug will be fixed in a future release.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-lowering it decreases the amount of time Pods will have to gracefully clean
-up before being killed during a soft eviction.
Default: 0
-->
evictionMaxPodGracePeriod是指达到软性逐出阈值而引起 Pod 终止时,
@@ -1505,9 +1176,6 @@ Pod 可以获得的terminationGracePeriodSeconds。
注意:由于 Issue #64530 的原因,系统中存在一个缺陷,即此处所设置的值会在软性逐出时覆盖
Pod 的宽限期设置,从而有可能增加 Pod 上原本设置的宽限期限时长。
这个缺陷会在未来版本中修复。
-
当 DynamicKubeletConfig (已弃用,默认为关闭)被启用时,
-如果动态更新了此字段,请考虑缩短此宽限期限值会导致软性逐出期间 Pod
-在被杀死之前用来体面地完成清理工作可用的时间。
默认值:0
@@ -1520,16 +1188,11 @@ Pod 的宽限期设置,从而有可能增加 Pod 上原本设置的宽限期
which describe the minimum amount of a given resource the kubelet will reclaim when
performing a pod eviction while that resource is under pressure.
For example: {"imagefs.available": "2Gi"}.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may change how well eviction can manage resource pressure.
Default: nil
-->
evictionMinimumReclaim是一个映射,定义信号名称与最小回收量数值之间的关系。
最小回收量指的是资源压力较大而执行 Pod 驱逐操作时,kubelet 对给定资源的最小回收量。
例如:{"imagefs.available": "2Gi"}。
@@ -1619,18 +1256,12 @@ kubelet 进入崩溃循环(Crash-Loop)状态。
are present on host.
These rules will serve as utility rules for various components, e.g. kube-proxy.
The rules will be created based on iptablesMasqueradeBit and iptablesDropBit.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-disabling it will prevent the Kubelet from healing locally misconfigured iptables rules.
Default: true
-->
@@ -1643,18 +1274,11 @@ Default: true
Values must be within the range [0, 31]. Must be different from other mark bits.
Warning: Please match the value of the corresponding parameter in kube-proxy.
TODO: clean up IPTablesMasqueradeBit in kube-proxy.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it needs to be coordinated with other components, like kube-proxy, and the update
-will only be effective if MakeIPTablesUtilChains is enabled.
Default: 14
-->
@@ -1803,20 +1395,11 @@ managers are running. Valid values include:
pairs that describe resources reserved for non-kubernetes components.
Currently only cpu and memory are supported.
See http://kubernetes.io/docs/user-guide/compute-resources for more detail.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may not be possible to increase the reserved resources, because this
-requires resizing cgroups. Always look for a NodeAllocatableEnforced event
-after updating this field to ensure that the update was successful.
Default: nil
-->
@@ -1830,21 +1413,12 @@ that describe resources reserved for kubernetes system components.
Currently cpu, memory and local storage for root file system are supported.
See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
for more details.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-it may not be possible to increase the reserved resources, because this
-requires resizing cgroups. Always look for a NodeAllocatableEnforced event
-after updating this field to ensure that the update was successful.
Default: nil
-->
@@ -1945,13 +1511,6 @@ When kube-reserved is in the list, kubeReservedCgroup must be speci
This field is supported only when cgroupsPerQOS is set to true.
Refer to Node Allocatable
for more information.
-If DynamicKubeletConfig (deprecated; default off) is on, when
-dynamically updating this field, consider that
-removing enforcements may reduce the stability of the node. Alternatively, adding
-enforcements may reduce the stability of components which were using more than
-the reserved amount of resources; for example, enforcing kube-reserved may cause
-Kubelets to OOM if it uses more than the reserved resources, and enforcing system-reserved
-may cause system daemons to OOM if they use more than the reserved resources.
Default: ["pods"]
-->
+list when the node is shutting down.
+For example, to allow critical pods 10s to shutdown, priority>=10000 pods 20s to
+shutdown, and all remaining pods 30s to shutdown.
+-->
shutdownGracePeriodByPodPriority设置基于 Pod
相关的优先级类值而确定的体面关闭时间。当 kubelet 收到关闭请求的时候,kubelet
会针对节点上运行的所有 Pod 发起关闭操作,这些关闭操作会根据 Pod 的优先级确定其宽限期限,
@@ -2140,6 +1683,15 @@ list when the node is shutting down.-->
-
@@ -1102,7 +1350,7 @@ It does not allow viewing roles or rolebindings.
This role does not allow viewing Secrets, since reading
the contents of Secrets enables access to ServiceAccount credentials
in the namespace, which would allow API access as any ServiceAccount
-in the namespace (a form of privilege escalation).
+in the namespace (a form of privilege escalation).
-->
此角色不允许查看 Secrets,因为读取 Secret 的内容意味着可以访问名字空间中
ServiceAccount 的凭据信息,进而允许利用名字空间中任何 ServiceAccount 的
@@ -1118,7 +1366,7 @@ ServiceAccount 的凭据信息,进而允许利用名字空间中任何 Service
### 核心组件角色 {#core-component-roles}
-
+
system:kube-scheduler 用户
-
允许访问 {{< glossary_tooltip term_id="kube-scheduler" text="scheduler" >}}
@@ -1148,8 +1396,8 @@ Allows access to the resources required by the {{< glossary_tooltip term_id="kub
system:volume-scheduler
-
system:kube-scheduler 用户
@@ -1161,23 +1409,23 @@ Allows access to the volume resources required by the kube-scheduler component.
@@ -1368,10 +1614,10 @@ Allows read access to control-plane monitoring endpoints
The Kubernetes {{< glossary_tooltip term_id="kube-controller-manager" text="controller manager" >}} runs
{{< glossary_tooltip term_id="controller" text="controllers" >}} that are built in to the Kubernetes
control plane.
-When invoked with `-use-service-account-credentials`, kube-controller-manager starts each controller
+When invoked with `--use-service-account-credentials`, kube-controller-manager starts each controller
using a separate service account.
Corresponding roles exist for each built-in controller, prefixed with `system:controller:`.
-If the controller manager is not started with `-use-service-account-credentials`, it runs all control loops
+If the controller manager is not started with `--use-service-account-credentials`, it runs all control loops
using its own credential, which must be granted all the relevant roles.
These roles include:
-->
@@ -1379,12 +1625,12 @@ These roles include:
Kubernetes {{< glossary_tooltip term_id="kube-controller-manager" text="控制器管理器" >}}
运行内建于 Kubernetes 控制面的{{< glossary_tooltip term_id="controller" text="控制器" >}}。
-当使用 `--use-service-account-credentials` 参数启动时, kube-controller-manager
+当使用 `--use-service-account-credentials` 参数启动时,kube-controller-manager
使用单独的服务账户来启动每个控制器。
每个内置控制器都有相应的、前缀为 `system:controller:` 的角色。
如果控制管理器启动时未设置 `--use-service-account-credentials`,
它使用自己的身份凭据来运行所有的控制器,该身份必须被授予所有相关的角色。
-这些角色包括:
+这些角色包括:
* `system:controller:attachdetach-controller`
* `system:controller:certificate-controller`
@@ -1415,12 +1661,12 @@ Kubernetes {{< glossary_tooltip term_id="kube-controller-manager" text="控制
* `system:controller:ttl-controller`
-## 初始化与预防权限提升
+## 初始化与预防权限提升 {#privilege-escalation-prevention-and-bootstrapping}
RBAC API 会阻止用户通过编辑角色或者角色绑定来提升权限。
由于这一点是在 API 级别实现的,所以在 RBAC 鉴权组件未启用的状态下依然可以正常工作。
@@ -1434,7 +1680,7 @@ You can only create/update a role if at least one of the following things is tru
(cluster-wide for a ClusterRole, within the same namespace or cluster-wide for a Role).
2. You are granted explicit permission to perform the `escalate` verb on the `roles` or `clusterroles` resource in the `rbac.authorization.k8s.io` API group.
-->
-### 对角色创建或更新的限制
+### 对角色创建或更新的限制 {#restrictions-on-role-creation-or-update}
只有在符合下列条件之一的情况下,你才能创建/更新角色:
@@ -1470,7 +1716,7 @@ You can only create/update a role binding if you already have all the permission
For example, if `user-1` does not have the ability to list Secrets cluster-wide, they cannot create a ClusterRoleBinding
to a role that grants that permission. To allow a user to create/update role bindings:
-->
-### 对角色绑定创建或更新的限制
+### 对角色绑定创建或更新的限制 {#restrictions-on-role-binding-creation-or-update}
只有你已经具有了所引用的角色中包含的全部权限时,或者你被授权在所引用的角色上执行 `bind`
动词时,你才可以创建或更新角色绑定。这里的权限与角色绑定的作用域相同。
@@ -1495,6 +1741,37 @@ For example, this ClusterRole and RoleBinding would allow `user-1` to grant othe
例如,下面的 ClusterRole 和 RoleBinding 将允许用户 `user-1` 把名字空间 `user-1-namespace`
中的 `admin`、`edit` 和 `view` 角色赋予其他用户:
+
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@@ -1529,33 +1806,32 @@ subjects:
When bootstrapping the first roles and role bindings, it is necessary for the initial user to grant permissions they do not yet have.
To bootstrap initial roles and role bindings:
-* Use a credential with the `system:masters` group, which is bound to the `cluster-admin` super-user role by the default bindings.
-* If your API server runs with the insecure port enabled (`-insecure-port`), you can also make API calls via that port, which does not enforce authentication or authorization.
+* Use a credential with the "system:masters" group, which is bound to the "cluster-admin" super-user role by the default bindings.
+* If your API server runs with the insecure port enabled (`--insecure-port`), you can also make API calls via that port, which does not enforce authentication or authorization.
-->
当启动引导第一个角色和角色绑定时,需要为初始用户授予他们尚未拥有的权限。
对初始角色和角色绑定进行初始化时需要:
* 使用用户组为 `system:masters` 的凭据,该用户组由默认绑定关联到 `cluster-admin`
这个超级用户角色。
-* 如果你的 API 服务器启动时启用了不安全端口(使用 `--insecure-port`), 你也可以通过
- 该端口调用 API ,这样的操作会绕过身份验证或鉴权。
+* 如果你的 API 服务器启动时启用了不安全端口(使用 `--insecure-port`),你也可以通过
+ 该端口调用 API,这样的操作会绕过身份验证或鉴权。
+## 一些命令行工具 {#command-line-utilities}
### `kubectl create role`
-Creates a `Role` object defining permissions within a single namespace. Examples:
+
-## 一些命令行工具
-
-### `kubectl create role`
-
创建 Role 对象,定义在某一名字空间中的权限。例如:
-* 创建名称为 "pod-reader" 的 Role 对象,允许用户对 Pods 执行 `get`、`watch` 和 `list` 操作:
+* 创建名称为 “pod-reader” 的 Role 对象,允许用户对 Pods 执行 `get`、`watch` 和 `list` 操作:
```shell
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods
@@ -1564,16 +1840,16 @@ Creates a `Role` object defining permissions within a single namespace. Examples
-* 创建名称为 "pod-reader" 的 Role 对象并指定 `resourceNames`:
+* 创建名称为 “pod-reader” 的 Role 对象并指定 `resourceNames`:
```shell
kubectl create role pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
```
-* 创建名为 "foo" 的 Role 对象并指定 `apiGroups`:
+* 创建名为 “foo” 的 Role 对象并指定 `apiGroups`:
```shell
kubectl create role foo --verb=get,list,watch --resource=replicasets.apps
@@ -1582,7 +1858,7 @@ Creates a `Role` object defining permissions within a single namespace. Examples
-* 创建名为 "foo" 的 Role 对象并指定子资源权限:
+* 创建名为 “foo” 的 Role 对象并指定子资源权限:
```shell
kubectl create role foo --verb=get,list,watch --resource=pods,pods/status
@@ -1591,7 +1867,7 @@ Creates a `Role` object defining permissions within a single namespace. Examples
-* 创建名为 "my-component-lease-holder" 的 Role 对象,使其具有对特定名称的
+* 创建名为 “my-component-lease-holder” 的 Role 对象,使其具有对特定名称的
资源执行 get/update 的权限:
```shell
@@ -1607,7 +1883,7 @@ Creates a ClusterRole. Examples:
-->
创建 ClusterRole 对象。例如:
-* 创建名称为 "pod-reader" 的 ClusterRole`对象,允许用户对 Pods 对象执行 `get`、
+* 创建名称为 “pod-reader” 的 ClusterRole 对象,允许用户对 Pods 对象执行 `get`、
`watch` 和 `list` 操作:
```shell
@@ -1617,7 +1893,7 @@ Creates a ClusterRole. Examples:
-* 创建名为 "pod-reader" 的 ClusterRole 对象并指定 `resourceNames`:
+* 创建名为 “pod-reader” 的 ClusterRole 对象并指定 `resourceNames`:
```shell
kubectl create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
@@ -1626,7 +1902,7 @@ Creates a ClusterRole. Examples:
-* 创建名为 "foo" 的 ClusterRole 对象并指定 `apiGroups`:
+* 创建名为 “foo” 的 ClusterRole 对象并指定 `apiGroups`:
```shell
kubectl create clusterrole foo --verb=get,list,watch --resource=replicasets.apps
@@ -1635,7 +1911,7 @@ Creates a ClusterRole. Examples:
-* 创建名为 "foo" 的 ClusterRole 对象并指定子资源:
+* 创建名为 “foo” 的 ClusterRole 对象并指定子资源:
```shell
kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status
@@ -1644,7 +1920,7 @@ Creates a ClusterRole. Examples:
-* 创建名为 "foo" 的 ClusterRole 对象并指定 `nonResourceURL`:
+* 创建名为 “foo” 的 ClusterRole 对象并指定 `nonResourceURL`:
```shell
kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/*
@@ -1653,7 +1929,7 @@ Creates a ClusterRole. Examples:
-* 创建名为 "monitoring" 的 ClusterRole 对象并指定 `aggregationRule`:
+* 创建名为 “monitoring” 的 ClusterRole 对象并指定 `aggregationRule`:
```shell
kubectl create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"
@@ -1668,7 +1944,7 @@ Grants a Role or ClusterRole within a specific namespace. Examples:
-->
在特定的名字空间中对 `Role` 或 `ClusterRole` 授权。例如:
-* 在名字空间 "acme" 中,将名为 `admin` 的 ClusterRole 中的权限授予名称 "bob" 的用户:
+* 在名字空间 “acme” 中,将名为 `admin` 的 ClusterRole 中的权限授予名称 “bob” 的用户:
```shell
kubectl create rolebinding bob-admin-binding --clusterrole=admin --user=bob --namespace=acme
@@ -1677,7 +1953,7 @@ Grants a Role or ClusterRole within a specific namespace. Examples:
-* 在名字空间 "acme" 中,将名为 `view` 的 ClusterRole 中的权限授予名字空间 "acme"
+* 在名字空间 “acme” 中,将名为 `view` 的 ClusterRole 中的权限授予名字空间 “acme”
中名为 `myapp` 的服务账户:
```shell
@@ -1687,8 +1963,8 @@ Grants a Role or ClusterRole within a specific namespace. Examples:
-* 在名字空间 "acme" 中,将名为 `view` 的 ClusterRole 对象中的权限授予名字空间
- "myappnamespace" 中名称为 `myapp` 的服务账户:
+* 在名字空间 “acme” 中,将名为 `view` 的 ClusterRole 对象中的权限授予名字空间
+ “myappnamespace” 中名称为 `myapp` 的服务账户:
```shell
kubectl create rolebinding myappnamespace-myapp-view-binding --clusterrole=view --serviceaccount=myappnamespace:myapp --namespace=acme
@@ -1704,7 +1980,7 @@ Grants a ClusterRole across the entire cluster (all namespaces). Examples:
在整个集群(所有名字空间)中用 ClusterRole 授权。例如:
* 在整个集群范围,将名为 `cluster-admin` 的 ClusterRole 中定义的权限授予名为
- "root" 用户:
+ “root” 用户:
```shell
kubectl create clusterrolebinding root-cluster-admin-binding --clusterrole=cluster-admin --user=root
@@ -1714,7 +1990,7 @@ Grants a ClusterRole across the entire cluster (all namespaces). Examples:
* Across the entire cluster, grant the permissions in the "system:node-proxier" ClusterRole to a user named "system:kube-proxy":
-->
* 在整个集群范围内,将名为 `system:node-proxier` 的 ClusterRole 的权限授予名为
- "system:kube-proxy" 的用户:
+ “system:kube-proxy” 的用户:
```shell
kubectl create clusterrolebinding kube-proxy-binding --clusterrole=system:node-proxier --user=system:kube-proxy
@@ -1723,8 +1999,8 @@ Grants a ClusterRole across the entire cluster (all namespaces). Examples:
-* 在整个集群范围内,将名为 `view` 的 ClusterRole 中定义的权限授予 "acme" 名字空间中
- 名为 "myapp" 的服务账户:
+* 在整个集群范围内,将名为 `view` 的 ClusterRole 中定义的权限授予 “acme” 名字空间中
+ 名为 “myapp” 的服务账户:
```shell
kubectl create clusterrolebinding myapp-view-binding --clusterrole=view --serviceaccount=acme:myapp
@@ -1762,7 +2038,7 @@ Examples:
* 测试应用 RBAC 对象的清单文件,显示将要进行的更改:
```shell
- kubectl auth reconcile -f my-rbac-rules.yaml --dry-run
+ kubectl auth reconcile -f my-rbac-rules.yaml --dry-run=client
```
-* 应用 RBAC 对象的清单文件, 删除角色中的额外权限和绑定中的其他主体:
+* 应用 RBAC 对象的清单文件,删除角色中的额外权限和绑定中的其他主体:
```shell
kubectl auth reconcile -f my-rbac-rules.yaml --remove-extra-subjects --remove-extra-permissions
```
-查看 CLI 帮助获取详细的用法。
-
-
## 服务账户权限 {#service-account-permissions}
@@ -1805,9 +2077,9 @@ Broader grants can give unnecessary (and potentially escalating) API access to s
但是不会对 `kube-system` 名字空间之外的服务账户授予权限。
(除了授予所有已认证用户的发现权限)
-这使得你可以根据需要向特定服务账户授予特定权限。
+这使得你可以根据需要向特定 ServiceAccount 授予特定权限。
细粒度的角色绑定可带来更好的安全性,但需要更多精力管理。
-粗粒度的授权可能导致服务账户被授予不必要的 API 访问权限(甚至导致潜在的权限提升),
+粗粒度的授权可能导致 ServiceAccount 被授予不必要的 API 访问权限(甚至导致潜在的权限提升),
但更易于管理。
这要求应用在其 Pod 规约中指定 `serviceAccountName`,
- 并额外创建服务账户(包括通过 API、应用程序清单、`kubectl create serviceaccount` 等)。
+ 并额外创建服务账户(包括通过 API、应用程序清单、`kubectl create serviceaccount` 等)。
- 例如,在名字空间 "my-namespace" 中授予服务账户 "my-sa" 只读权限:
+ 例如,在名字空间 “my-namespace” 中授予服务账户 “my-sa” 只读权限:
```shell
kubectl create rolebinding my-sa-view \
@@ -1840,7 +2112,7 @@ In order from most secure to least secure, the approaches are:
-2. 将角色授予某名字空间中的 "default" 服务账户
+2. 将角色授予某名字空间中的 “default” 服务账户
- 如果某应用没有指定 `serviceAccountName`,那么它将使用 "default" 服务账户。
+ 如果某应用没有指定 `serviceAccountName`,那么它将使用 “default” 服务账户。
{{< note >}}
"default" 服务账户所具有的权限会被授予给名字空间中所有未指定
@@ -1874,20 +2146,20 @@ In order from most secure to least secure, the approaches are:
To allow those add-ons to run with super-user access, grant cluster-admin
permissions to the "default" service account in the `kube-system` namespace.
- {{< note >}}
+ {{< caution >}}
Enabling this means the `kube-system` namespace contains Secrets
- that grant super-user access to the API.
- {{< /note >}}
+ that grant super-user access to your cluster's API.
+ {{< /caution >}}
-->
- 许多[插件组件](/zh/docs/concepts/cluster-administration/addons/) 在 `kube-system`
- 名字空间以 "default" 服务账户运行。
+ 许多[插件组件](/zh/docs/concepts/cluster-administration/addons/)在 `kube-system`
+ 名字空间以 “default” 服务账户运行。
要允许这些插件组件以超级用户权限运行,需要将集群的 `cluster-admin` 权限授予
- `kube-system` 名字空间中的 "default" 服务账户。
+ `kube-system` 名字空间中的 “default” 服务账户。
- {{< note >}}
- 启用这一配置意味着在 `kube-system` 名字空间中包含以超级用户账号来访问 API
+ {{< caution >}}
+ 启用这一配置意味着在 `kube-system` 名字空间中包含以超级用户账号来访问集群 API
的 Secrets。
- {{< /note >}}
+ {{< /caution >}}
```shell
kubectl create clusterrolebinding add-on-cluster-admin \
@@ -1907,7 +2179,7 @@ In order from most secure to least secure, the approaches are:
如果你想要名字空间中所有应用都具有某角色,无论它们使用的什么服务账户,
可以将角色授予该名字空间的服务账户组。
- 例如,在名字空间 "my-namespace" 中的只读权限授予该名字空间中的所有服务账户:
+ 例如,在名字空间 “my-namespace” 中的只读权限授予该名字空间中的所有服务账户:
```shell
kubectl create rolebinding serviceaccounts-view \
@@ -1949,7 +2221,7 @@ In order from most secure to least secure, the approaches are:
-->
5. 授予超级用户访问权限给集群范围内的所有服务帐户(强烈不鼓励)
- 如果你不关心如何区分权限,你可以将超级用户访问权限授予所有服务账户。
+ 如果你不在乎如何区分权限,你可以将超级用户访问权限授予所有服务账户。
{{< warning >}}
这样做会允许所有应用都对你的集群拥有完全的访问权限,并将允许所有能够读取
@@ -1978,19 +2250,16 @@ guidance for restricting this access in existing clusters.
If you want new clusters to retain this level of access in the aggregated roles,
you can create the following ClusterRole:
-
-{{< codenew file="access/endpoints-aggregated.yaml" >}}
-->
## Endpoints 写权限 {#write-access-for-endpoints}
在 Kubernetes v1.22 之前版本创建的集群里,
-"edit" 和 "admin" 聚合角色包含对 Endpoints 的写权限。
+“edit” 和 “admin” 聚合角色包含对 Endpoints 的写权限。
作为 [CVE-2021-25740](https://github.com/kubernetes/kubernetes/issues/103675) 的缓解措施,
此访问权限不包含在 Kubernetes 1.22 以及更高版本集群的聚合角色里。
升级到 Kubernetes v1.22 版本的现有集群不会包括此变化。
-[CVE 公告](https://github.com/kubernetes/kubernetes/issues/103675)
-包含了在现有集群里限制此访问权限的指引。
+[CVE 公告](https://github.com/kubernetes/kubernetes/issues/103675)包含了在现有集群里限制此访问权限的指引。
如果你希望在新集群的聚合角色里保留此访问权限,你可以创建下面的 ClusterRole:
@@ -2010,7 +2279,7 @@ and controllers, but grant *no permissions* to service accounts outside the `kub
While far more secure, this can be disruptive to existing workloads expecting to automatically receive API permissions.
Here are two approaches for managing this transition:
-->
-## 从 ABAC 升级
+## 从 ABAC 升级 {#upgrading-from-abac}
原来运行较老版本 Kubernetes 的集群通常会使用限制宽松的 ABAC 策略,
包括授予所有服务帐户全权访问 API 的能力。
@@ -2023,19 +2292,19 @@ Here are two approaches for managing this transition:
这里有两种方法来完成这种转换:
### 并行鉴权 {#parallel-authorizers}
-同时运行 RBAC 和 ABAC 鉴权模式, 并指定包含
+同时运行 RBAC 和 ABAC 鉴权模式,并指定包含
[现有的 ABAC 策略](/zh/docs/reference/access-authn-authz/abac/#policy-file-format)
的策略文件:
```shell
---authorization-mode=RBAC,ABAC --authorization-policy-file=mypolicy.json
+--authorization-mode=...,RBAC,ABAC --authorization-policy-file=mypolicy.json
```
-如果 API 服务器启动时,RBAC 组件的日志级别为 5 或更高(`--vmodule=rbac*=5` 或 `--v=5`),
-你可以在 API 服务器的日志中看到 RBAC 的细节 (前缀 `RBAC:`)
+如果 kube-apiserver 启动时,RBAC 组件的日志级别为 5 或更高(`--vmodule=rbac*=5` 或 `--v=5`),
+你可以在 API 服务器的日志中看到 RBAC 拒绝的细节(前缀 `RBAC`)
你可以使用这些信息来确定需要将哪些角色授予哪些用户、组或服务帐户。
-一旦你[将角色授予服务账户](#service-account-permissions) ,工作负载运行时
-在服务器日志中没有出现 RBAC 拒绝消息,就可以删除 ABAC 鉴权器。
+一旦你[将角色授予服务账户](#service-account-permissions)且工作负载运行时,
+服务器日志中没有出现 RBAC 拒绝消息,就可以删除 ABAC 鉴权器。
### 宽松的 RBAC 权限 {#permissive-rbac-permissions}
-你可以使用 RBAC 角色绑定在多个场合使用宽松的策略。
+你可以使用 RBAC 角色绑定复制宽松的 ABAC 策略。
{{< warning >}}
在你完成到 RBAC 的迁移后,应该调整集群的访问控制,确保相关的策略满足你的信息安全需求。
-
From adbf29ff8d86d44d69ee800d8933695d722d0c69 Mon Sep 17 00:00:00 2001
From: Guangwen Feng
Date: Tue, 24 May 2022 15:28:15 +0800
Subject: [PATCH 140/245] [zh] Sync kubelet-credential-provider.md and
downward-api-volume-expose-pod-information.md
Signed-off-by: Guangwen Feng
---
...nward-api-volume-expose-pod-information.md | 168 ++++++++++++------
.../kubelet-credential-provider.md | 61 ++++---
2 files changed, 155 insertions(+), 74 deletions(-)
diff --git a/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md b/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md
index 69b0b9ee0d..a8df0ff12b 100644
--- a/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md
+++ b/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md
@@ -7,12 +7,15 @@ weight: 40
-此页面描述 Pod 如何使用 DownwardAPIVolumeFile 把自己的信息呈现给 Pod 中运行的容器。
-DownwardAPIVolumeFile 可以呈现 Pod 的字段和容器字段。
+此页面描述 Pod 如何使用
+[`DownwardAPIVolumeFile`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumefile-v1-core)
+把自己的信息呈现给 Pod 中运行的容器。
+`DownwardAPIVolumeFile` 可以呈现 Pod 和容器的字段。
## {{% heading "prerequisites" %}}
@@ -26,16 +29,19 @@ DownwardAPIVolumeFile 可以呈现 Pod 的字段和容器字段。
There are two ways to expose Pod and Container fields to a running Container:
* [Environment variables](/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api)
-* Volume Files
+* Volume files
+
+Together, these two ways of exposing Pod and Container fields are called the
+"Downward API".
-->
-## Downward API
+## Downward API {#the-downward-api}
有两种方式可以将 Pod 和 Container 字段呈现给运行中的容器:
* [环境变量](/zh/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api)
* 卷文件
-这两种呈现 Pod 和 Container 字段的方式都称为 *Downward API*。
+这两种呈现 Pod 和 Container 字段的方式都称为 "Downward API"。
-## 存储 Pod 字段
+## 存储 Pod 字段 {#store-pod-fields}
在这个练习中,你将创建一个包含一个容器的 Pod。Pod 的配置文件如下:
@@ -88,7 +94,7 @@ kubectl apply -f https://k8s.io/examples/pods/inject/dapi-volume.yaml
```
验证Pod中的容器运行正常:
@@ -97,7 +103,7 @@ kubectl get pods
```
查看容器的日志:
@@ -120,7 +126,7 @@ builder="john-doe"
```
进入 Pod 中运行的容器,打开一个 Shell:
@@ -194,11 +200,10 @@ total 8
用符号链接可实现元数据的动态原子性刷新;更新将写入一个新的临时目录,
-然后通过使用[rename(2)](http://man7.org/linux/man-pages/man2/rename.2.html)
+然后通过使用 [rename(2)](http://man7.org/linux/man-pages/man2/rename.2.html)
完成 `..data` 符号链接的原子性更新。
-前面的练习中,你将 Pod 字段保存到 DownwardAPIVolumeFile 中。
+## 存储容器字段 {#store-container-fields}
+
+前面的练习中,你将 Pod 字段保存到
+[`DownwardAPIVolumeFile`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumefile-v1-core)
+中。
接下来这个练习,你将存储 Container 字段。这里是包含一个容器的 Pod 的配置文件:
{{< codenew file="pods/inject/dapi-volume-resources.yaml" >}}
-在这个配置文件中,你可以看到 Pod 有一个 `downwardAPI` 类型的卷,并且挂载到容器的
-`/etc/podinfo` 目录。
+在这个配置文件中,你可以看到 Pod 有一个
+[`downwardAPI` 卷](/zh/docs/concepts/storage/volumes/#downwardapi),
+并且挂载到容器的 `/etc/podinfo` 目录。
-查看 `downwardAPI` 下面的 `items` 数组。每个数组元素都是一个 DownwardAPIVolumeFile。
+查看 `downwardAPI` 下面的 `items` 数组。每个数组元素都是一个
+[`DownwardAPIVolumeFile`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumefile-v1-core)。
-第一个元素指定名为 `client-container` 的容器中 `limits.cpu` 字段的值应保存在名为
-`cpu_limit` 的文件中。
+第一个元素指定在名为 `client-container` 的容器中,
+以 `1m` 所指定格式的 `limits.cpu` 字段的值应保存在名为 `cpu_limit` 的文件中。
+`divisor` 字段是可选的,默认值为 `1`,表示 CPU 的核心和内存的字节。
创建Pod:
@@ -259,7 +273,7 @@ kubectl apply -f https://k8s.io/examples/pods/inject/dapi-volume-resources.yaml
```
打开一个 Shell,进入 Pod 中运行的容器:
@@ -283,39 +297,50 @@ You can use similar commands to view the `cpu_request`, `mem_limit` and
你可以使用同样的命令查看 `cpu_request`、`mem_limit` 和 `mem_request` 文件.
+
+
-## Downward API 的能力
+## Downward API 的能力 {#capabilities-of-the-downward-api}
下面这些信息可以通过环境变量和 `downwardAPI` 卷提供给容器:
* 能通过 `fieldRef` 获得的:
+
* `metadata.name` - Pod 名称
* `metadata.namespace` - Pod 名字空间
* `metadata.uid` - Pod 的 UID
- * `metadata.labels['']` - Pod 标签 `` 的值 (例如, `metadata.labels['mylabel']`)
- * `metadata.annotations['']` - Pod 的注解 `` 的值(例如, `metadata.annotations['myannotation']`)
+ * `metadata.labels['']` - Pod 标签 `` 的值
+ (例如:`metadata.labels['mylabel']`)
+ * `metadata.annotations['']` - Pod 的注解 `` 的值
+ (例如:`metadata.annotations['myannotation']`)
@@ -324,8 +349,10 @@ variables and `downwardAPI` volumes:
* 容器的 CPU 请求值
* 容器的内存约束值
* 容器的内存请求值
- * 容器的巨页限制值(前提是启用了 `DownwardAPIHugePages` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/))
- * 容器的巨页请求值(前提是启用了 `DownwardAPIHugePages` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/))
+ * 容器的巨页限制值(前提是启用了 `DownwardAPIHugePages`
+ [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/))
+ * 容器的巨页请求值(前提是启用了 `DownwardAPIHugePages`
+ [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/))
* 容器的临时存储约束值
* 容器的临时存储请求值
@@ -334,23 +361,33 @@ In addition, the following information is available through
`downwardAPI` volume `fieldRef`:
-->
此外,以下信息可通过 `downwardAPI` 卷从 `fieldRef` 获得:
+
-* `metadata.labels` - Pod 的所有标签,以 `label-key="escaped-label-value"` 格式显示,每行显示一个标签
-* `metadata.annotations` - Pod 的所有注解,以 `annotation-key="escaped-annotation-value"`
- 格式显示,每行显示一个标签
+* `metadata.labels` - Pod 的所有标签,以
+ `label-key="escaped-label-value"` 格式显示,每行显示一个标签
+* `metadata.annotations` - Pod 的所有注解,以
+ `annotation-key="escaped-annotation-value"` 格式显示,每行显示一个标签
以下信息可通过环境变量获得:
-* `status.podIP` - 节点 IP
-* `spec.serviceAccountName` - Pod 服务帐号名称, 版本要求 v1.4.0-alpha.3
-* `spec.nodeName` - 节点名称, 版本要求 v1.4.0-alpha.3
-* `status.hostIP` - 节点 IP, 版本要求 v1.7.0-alpha.1
+* `status.podIP` - Pod IP 地址
+* `spec.serviceAccountName` - Pod 服务帐号名称
+* `spec.nodeName` - 调度器总是尝试将 Pod 调度到的节点的名称
+* `status.hostIP` - Pod 分配到的节点的 IP
-## 投射键名到指定路径并且指定文件权限
+## 投射键名到指定路径并且指定文件权限 {#project-keys-to-specific-paths-and-file-permissions}
你可以将键名投射到指定路径并且指定每个文件的访问权限。
更多信息,请参阅[Secrets](/zh/docs/concepts/configuration/secret/).
@@ -376,7 +413,7 @@ basis. For more information, see
-## Downward API的动机
+## Downward API 的动机 {#motivation-for-the-downward-api}
对于容器来说,有时候拥有自己的信息是很有用的,可避免与 Kubernetes 过度耦合。
Downward API 使得容器使用自己或者集群的信息,而不必通过 Kubernetes 客户端或
@@ -399,9 +436,32 @@ API 服务器来获得。
## {{% heading "whatsnext" %}}
-* [PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core)
-* [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)
-* [DownwardAPIVolumeSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumesource-v1-core)
-* [DownwardAPIVolumeFile](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumefile-v1-core)
-* [ResourceFieldSelector](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcefieldselector-v1-core)
+
+* 参阅
+ [`PodSpec`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core)
+ API 定义,该 API 定义 Pod 所需状态。
+* 参阅
+ [`Volume`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)
+ API 定义,该 API 在 Pod 中定义通用卷以供容器访问。
+* 参阅
+ [`DownwardAPIVolumeSource`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumesource-v1-core)
+ API 定义,该 API 定义包含 Downward API 信息的卷。
+* 参阅
+ [`DownwardAPIVolumeFile`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#downwardapivolumefile-v1-core)
+ API 定义,该 API 包含对对象或资源字段的引用,用于在 Downward API 卷中填充文件。
+* 参阅
+ [`ResourceFieldSelector`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcefieldselector-v1-core)
+ API 定义,该 API 指定容器资源及其输出格式。
diff --git a/content/zh/docs/tasks/kubelet-credential-provider/kubelet-credential-provider.md b/content/zh/docs/tasks/kubelet-credential-provider/kubelet-credential-provider.md
index eb73c471c3..c888a27177 100644
--- a/content/zh/docs/tasks/kubelet-credential-provider/kubelet-credential-provider.md
+++ b/content/zh/docs/tasks/kubelet-credential-provider/kubelet-credential-provider.md
@@ -48,7 +48,7 @@ This guide demonstrates how to configure the kubelet's image credential provider
* kubelet 镜像凭证提供程序在 v1.20 版本作为 alpha 功能引入。
@@ -73,12 +73,14 @@ every node in your cluster and stored in a known directory. The directory will b
## Configuring the Kubelet
In order to use this feature, the kubelet expects two flags to be set:
+
* `--image-credential-provider-config` - the path to the credential provider plugin config file.
* `--image-credential-provider-bin-dir` - the path to the directory where credential provider plugin binaries are located.
-->
## 配置 kubelet {#configuring-the-kubelet}
为了使用这个特性,kubelet 需要设置以下两个标志:
+
* `--image-credential-provider-config` —— 凭据提供程序插件配置文件的路径。
* `--image-credential-provider-bin-dir` —— 凭据提供程序插件二进制文件所在目录的路径。
@@ -86,18 +88,19 @@ In order to use this feature, the kubelet expects two flags to be set:
### Configure a kubelet credential provider
The configuration file passed into `--image-credential-provider-config` is read by the kubelet to determine which exec plugins
-should be invoked for which container images. Here's an example configuration file you may end up using if you are using the [ECR](https://aws.amazon.com/ecr/)-based plugin:
+should be invoked for which container images. Here's an example configuration file you may end up using if you are using the
+[ECR](https://aws.amazon.com/ecr/)-based plugin:
-->
### 配置 kubelet 凭据提供程序 {#configure-a-kubelet-credential-provider}
-kubelet 会读取传入 `--image-credential-provider-config` 的配置文件文件,
+kubelet 会读取传入 `--image-credential-provider-config` 的配置文件,
以确定应该为哪些容器镜像调用哪些 exec 插件。
-如果你正在使用基于 [ECR](https://aws.amazon.com/ecr/) 插件,
+如果你正在使用基于 [ECR](https://aws.amazon.com/ecr/) 的插件,
这里有个样例配置文件你可能最终会使用到:
```yaml
-kind: CredentialProviderConfig
apiVersion: kubelet.config.k8s.io/v1alpha1
+kind: CredentialProviderConfig
# providers 是将由 kubelet 启用的凭证提供程序插件列表。
# 多个提供程序可能与单个镜像匹配,在这种情况下,来自所有提供程序的凭据将返回到 kubelet。
# 如果为单个镜像调用多个提供程序,则结果会合并。
@@ -130,11 +133,11 @@ providers:
# - *.*.registry.io
# - registry.io:8080/path
matchImages:
- - "*.dkr.ecr.*.amazonaws.com"
- - "*.dkr.ecr.*.amazonaws.cn"
- - "*.dkr.ecr-fips.*.amazonaws.com"
- - "*.dkr.ecr.us-iso-east-1.c2s.ic.gov"
- - "*.dkr.ecr.us-isob-east-1.sc2s.sgov.gov"
+ - "*.dkr.ecr.*.amazonaws.com"
+ - "*.dkr.ecr.*.amazonaws.cn"
+ - "*.dkr.ecr-fips.*.amazonaws.com"
+ - "*.dkr.ecr.us-iso-east-1.c2s.ic.gov"
+ - "*.dkr.ecr.us-isob-east-1.sc2s.sgov.gov"
# defaultCacheDuration 是插件将在内存中缓存凭据的默认持续时间
# 如果插件响应中未提供缓存持续时间。此字段是必需的。
defaultCacheDuration: "12h"
@@ -145,30 +148,36 @@ providers:
# 执行命令时传递给命令的参数。
# +可选
args:
- - get-credentials
+ - get-credentials
# env 定义了额外的环境变量以暴露给进程。
# 这些与主机环境以及 client-go 用于将参数传递给插件的变量结合在一起。
# +可选
env:
- - name: AWS_PROFILE
- value: example_profile
+ - name: AWS_PROFILE
+ value: example_profile
```
`providers` 字段是 kubelet 使用的已启用插件列表。每个条目都有几个必填字段:
+
* `name`:插件的名称,必须与传入`--image-credential-provider-bin-dir`
的目录中存在的可执行二进制文件的名称相匹配。
-* `matchImages`:用于匹配图像以确定是否应调用此提供程序的字符串列表。更多相关信息如下。
+* `matchImages`:用于匹配镜像以确定是否应调用此提供程序的字符串列表。更多相关信息如下。
* `defaultCacheDuration`:如果插件未指定缓存持续时间,kubelet 将在内存中缓存凭据的默认持续时间。
-* `apiVersion`:kubelet 和 exec 插件在通信时将使用的 api 版本。
+* `apiVersion`:kubelet 和 exec 插件在通信时将使用的 API 版本。
每个凭证提供程序也可以被赋予可选的参数和环境变量。
咨询插件实现者以确定给定插件需要哪些参数和环境变量集。
@@ -207,8 +216,20 @@ Some example values of `matchImages` patterns are:
* 如果 imageMatch 包含端口,则该端口也必须在镜像中匹配。
`matchImages` 模式的一些示例值:
+
* `123456789.dkr.ecr.us-east-1.amazonaws.com`
* `*.azurecr.io`
* `gcr.io`
* `*.*.registry.io`
* `foo.registry.io:8080/path`
+
+## {{% heading "whatsnext" %}}
+
+
+* 阅读 [kubelet 配置 API (v1alpha1) 参考](/zh/docs/reference/config-api/kubelet-config.v1alpha1/)中有关 `CredentialProviderConfig` 的详细信息。
+* 阅读 [kubelet 凭据提供程序 API 参考 (v1alpha1)](/docs/reference/config-api/kubelet-credentialprovider.v1alpha1/)。
+
From 1ef57ccad261d21c728a15e9975ec974938deca0 Mon Sep 17 00:00:00 2001
From: Debanitrkl <118bm0622@nitrkl.ac.in>
Date: Wed, 25 May 2022 11:26:08 +0530
Subject: [PATCH 141/245] Follow up updates to release blog regarding CSI
Snapshot
---
content/en/blog/_posts/2022-05-03-kubernetes-release-1.24.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/content/en/blog/_posts/2022-05-03-kubernetes-release-1.24.md b/content/en/blog/_posts/2022-05-03-kubernetes-release-1.24.md
index 7c0486478f..c0c47fd759 100644
--- a/content/en/blog/_posts/2022-05-03-kubernetes-release-1.24.md
+++ b/content/en/blog/_posts/2022-05-03-kubernetes-release-1.24.md
@@ -118,6 +118,11 @@ With containerd v1.6.0–v1.6.3, if you do not upgrade the CNI plugins and/or
declare the CNI config version, you might encounter the following "Incompatible
CNI versions" or "Failed to destroy network for sandbox" error conditions.
+## CSI Snapshot
+
+[VolumeSnapshot v1beta1 CRD has been removed](https://github.com/kubernetes/enhancements/issues/177).
+Volume snapshot and restore functionality for Kubernetes and the Container Storage Interface (CSI), which provides standardized APIs design (CRDs) and adds PV snapshot/restore support for CSI volume drivers, entered beta in v1.20. VolumeSnapshot v1beta1 was deprecated in v1.21 and is now unsupported. Refer to [KEP-177: CSI Snapshot](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/177-volume-snapshot#kep-177-csi-snapshot) and [kubernetes-csi/external-snapshotter](https://github.com/kubernetes-csi/external-snapshotter/releases/tag/v4.1.0) for more information.
+
## Other Updates
### Graduations to Stable
From 60c571656761253a4f616647b16b3e1ed8d07cf4 Mon Sep 17 00:00:00 2001
From: Tom Kivlin
Date: Wed, 25 May 2022 08:20:25 +0100
Subject: [PATCH 142/245] capitalisation consistency
---
.../compute-storage-net/network-plugins.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md
index 4c09ad1043..52b0bc3e26 100644
--- a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md
+++ b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md
@@ -29,8 +29,8 @@ CNI specification (plugins can be compatible with multiple spec versions).
A Container Runtime, in the networking context, is a daemon on a node configured to provide CRI Services for kubelet. In particular, the Container Runtime must be configured to load the CNI plugins required to implement the Kubernetes network model.
{{< note >}}
-Prior to Kubernetes 1.24, the CNI plugins could also be managed by the Kubelet using the `cni-bin-dir` and `network-plugin` command-line parameters.
-These command-line parameters were removed in Kubernetes 1.24, with management of the CNI no longer in scope for Kubelet.
+Prior to Kubernetes 1.24, the CNI plugins could also be managed by the kubelet using the `cni-bin-dir` and `network-plugin` command-line parameters.
+These command-line parameters were removed in Kubernetes 1.24, with management of the CNI no longer in scope for kubelet.
See [Troubleshooting CNI plugin-related errors](/docs/tasks/administer-cluster/migrating-from-dockershim/troubleshooting-cni-plugin-related-errors/)
if you are facing issues following the removal of dockershim.
@@ -53,8 +53,8 @@ By default, if no kubelet network plugin is specified, the `noop` plugin is used
### Loopback CNI
-In addition to the CNI plugin installed on the nodes for implementing the Kubernetes Network Model, Kubernetes also requires the Container Runtimes to provide a loopback interface `lo`, which is used for each sandbox (pod sandboxes, vm sandboxes, ...).
-Implementing the loopback interface can be accomplished by re-using the [`the CNI loopback plugin.`](https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback/loopback.go) or by developing your own code to achieve this (see [this example from CRI-O](https://github.com/cri-o/ocicni/blob/release-1.24/pkg/ocicni/util_linux.go#L91)).
+In addition to the CNI plugin installed on the nodes for implementing the Kubernetes network model, Kubernetes also requires the container runtimes to provide a loopback interface `lo`, which is used for each sandbox (pod sandboxes, vm sandboxes, ...).
+Implementing the loopback interface can be accomplished by re-using the [the CNI loopback plugin.](https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback/loopback.go) or by developing your own code to achieve this (see [this example from CRI-O](https://github.com/cri-o/ocicni/blob/release-1.24/pkg/ocicni/util_linux.go#L91)).
### Support hostPort
From 86cada932dc0c680080d7ced29b6d39694d63ca7 Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Wed, 25 May 2022 17:30:00 +0800
Subject: [PATCH 143/245] [zh] Sync kube-scheduler.md
---
.../kube-scheduler.md | 262 ++++++++----------
1 file changed, 121 insertions(+), 141 deletions(-)
diff --git a/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md b/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
index 0da24c1f84..28fb4f2a61 100644
--- a/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
+++ b/content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md
@@ -2,7 +2,6 @@
title: kube-scheduler
content_type: tool-reference
weight: 30
-auto_generated: true
---
Kubernetes 调度器是一个控制面进程,负责将 Pods 指派到节点上。
调度器基于约束和可用资源为调度队列中每个 Pod 确定其可合法放置的节点。
调度器之后对所有合法的节点进行排序,将 Pod 绑定到一个合适的节点。
在同一个集群中可以使用多个不同的调度器;kube-scheduler 是其参考实现。
-参阅[调度](zh/docs/concepts/scheduling-eviction/)
-以获得关于调度和 kube-scheduler 组件的更多信息。
+参阅[调度](/zh/docs/concepts/scheduling-eviction/)以获得关于调度和
+kube-scheduler 组件的更多信息。
```
kube-scheduler [flags]
@@ -47,14 +46,14 @@ kube-scheduler [flags]
--allow-metric-labels stringToString
-默认值: []
+默认值:[]
-这个键值映射表设置 度量标签 所允许设置的值。
+这个键值映射表设置度量标签所允许设置的值。
其中键的格式是 <MetricName>,<LabelName>。
值的格式是 <allowed_value>,<allowed_value>。
例如:metric1,label1='v1,v2,v3', metric1,label2='v1,v2,v3' metric2,label1='v1,v2,v3'。
@@ -120,7 +119,7 @@ If true, failures to look up missing authentication configuration from the clust
-在授权过程中跳过的 HTTP 路径列表,即在不联系 'core' kubernetes 服务器的情况下被授权的 HTTP 路径。
+在授权过程中跳过的 HTTP 路径列表,即在不联系 “core” kubernetes 服务器的情况下被授权的 HTTP 路径。
@@ -158,7 +157,7 @@ The duration to cache 'authorized' responses from the webhook authorizer.
-缓存来自 Webhook 授权者的 'unauthorized' 响应的持续时间。
+缓存来自 Webhook 授权者的 “unauthorized” 响应的持续时间。
@@ -184,7 +183,7 @@ The IP address on which to listen for the --secure-port port. The associated int
-->
监听 --secure-port 端口的 IP 地址。
集群的其余部分以及 CLI/ Web 客户端必须可以访问关联的接口。
-如果为空,将使用所有接口(0.0.0.0 表示使用所有 IPv4 接口,"::" 表示使用所有 IPv6 接口)。
+如果为空,将使用所有接口(0.0.0.0 表示使用所有 IPv4 接口,“::” 表示使用所有 IPv6 接口)。
如果为空或未指定地址 (0.0.0.0 或 ::),所有接口将被使用。
@@ -228,7 +227,7 @@ The path to the configuration file.
@@ -534,7 +516,7 @@ DEPRECATED: content type of requests sent to apiserver. This parameter is ignore
-
--kube-api-qps float32 默认值:50
+
--kube-api-qps float 默认值:50
@@ -745,7 +727,7 @@ If true, SO_REUSEADDR will be used when binding the port. This allows binding to
如果为 true,在绑定端口时将使用 SO_REUSEADDR。
这将允许同时绑定诸如 0.0.0.0 这类通配符 IP和特定 IP,
并且它避免等待内核释放处于 TIME_WAIT 状态的套接字。
-默认值: false
+默认值:false
@@ -758,7 +740,7 @@ If true, SO_REUSEADDR will be used when binding the port. This allows binding to
If true, SO_REUSEPORT will be used when binding the port, which allows more than one instance to bind on the same address and port. [default=false]
-->
如果此标志为 true,在绑定端口时会使用 SO_REUSEPORT,从而允许不止一个
-实例绑定到同一地址和端口。
+实例绑定到同一地址和端口。
默认值:false
@@ -781,7 +763,7 @@ unschedulablePods 移动到 backoffQ 或 activeQ。
-
--profiling 默认值: true
+
--profiling 默认值:true
@@ -824,7 +806,7 @@ Root certificate bundle to use to verify client certificates on incoming request
@@ -897,7 +879,7 @@ The previous version for which you want to show hidden metrics. Only the previou
-包含默认的 HTTPS x509 证书的文件。(CA证书(如果有)在服务器证书之后并置)。
+包含默认的 HTTPS x509 证书的文件。(如果有 CA 证书,在服务器证书之后并置)。
如果启用了 HTTPS 服务,并且未提供 --tls-cert-file 和
--tls-private-key-file,则会为公共地址生成一个自签名证书和密钥,
并将其保存到 --cert-dir 指定的目录中。
@@ -962,7 +944,7 @@ A pair of x509 certificate and private key file paths, optionally suffixed with
如果未提供域名匹配模式,则提取证书名称。
非通配符匹配优先于通配符匹配,显式域名匹配优先于提取而来的名称。
若有多个密钥/证书对,可多次使用 --tls-sni-cert-key。
-例子: "example.crt,example.key" 或者 "foo.crt,foo.key:*.foo.com,foo.com"。
+例如: "example.crt,example.key" 或者 "foo.crt,foo.key:*.foo.com,foo.com"。
@@ -998,7 +980,7 @@ Print version information and quit
-以逗号分隔的 ‘模式=N’ 设置列表,用于文件过滤的日志记录(仅适用于文本日志格式)。
+以逗号分隔的 “pattern=N” 设置列表,用于文件过滤的日志记录(仅适用于文本日志格式)。
@@ -1010,7 +992,7 @@ comma-separated list of pattern=N settings for file-filtered logging (only works
-如果已设置,将配置值写入此文件并退出。
+如果设置此参数,将配置值写入此文件并退出。
@@ -1019,5 +1001,3 @@ If set, write the configuration values to this file and exit.
-
-
From b2a646a158f50325d0f4a12c7bc9ec00bd6a2732 Mon Sep 17 00:00:00 2001
From: Mengjiao Liu
Date: Mon, 23 May 2022 16:14:39 +0800
Subject: [PATCH 144/245] [zh] Sync 1.24 concepts-3
---
.../concepts/storage/persistent-volumes.md | 128 +++++++++++---
content/zh/docs/concepts/storage/volumes.md | 162 +++++++-----------
2 files changed, 159 insertions(+), 131 deletions(-)
diff --git a/content/zh/docs/concepts/storage/persistent-volumes.md b/content/zh/docs/concepts/storage/persistent-volumes.md
index fdf9e6ee50..96c585fb72 100644
--- a/content/zh/docs/concepts/storage/persistent-volumes.md
+++ b/content/zh/docs/concepts/storage/persistent-volumes.md
@@ -374,6 +374,97 @@ However, the particular path specified in the custom recycler Pod template in th
定制回收器 Pod 模板中在 `volumes` 部分所指定的特定路径要替换为
正被回收的卷的路径。
+
+### PersistentVolume 删除保护 finalizer {#persistentvolume-deletion-protection-finalizer}
+{{< feature-state for_k8s_version="v1.23" state="alpha" >}}
+
+可以在 PersistentVolume 上添加终结器(Finalizers),以确保只有在删除对应的存储后才删除具有
+`Delete` 回收策略的 PersistentVolume。
+
+
+新引入的 `kubernetes.io/pv-controller` 和 `external-provisioner.volume.kubernetes.io/finalizer`
+终结器仅会被添加到动态制备的卷上。
+
+终结器 `kubernetes.io/pv-controller` 会被添加到树内插件卷上。
+下面是一个例子:
+
+```shell
+kubectl describe pv pvc-74a498d6-3929-47e8-8c02-078c1ece4d78
+Name: pvc-74a498d6-3929-47e8-8c02-078c1ece4d78
+Labels:
+Annotations: kubernetes.io/createdby: vsphere-volume-dynamic-provisioner
+ pv.kubernetes.io/bound-by-controller: yes
+ pv.kubernetes.io/provisioned-by: kubernetes.io/vsphere-volume
+Finalizers: [kubernetes.io/pv-protection kubernetes.io/pv-controller]
+StorageClass: vcp-sc
+Status: Bound
+Claim: default/vcp-pvc-1
+Reclaim Policy: Delete
+Access Modes: RWO
+VolumeMode: Filesystem
+Capacity: 1Gi
+Node Affinity:
+Message:
+Source:
+ Type: vSphereVolume (a Persistent Disk resource in vSphere)
+ VolumePath: [vsanDatastore] d49c4a62-166f-ce12-c464-020077ba5d46/kubernetes-dynamic-pvc-74a498d6-3929-47e8-8c02-078c1ece4d78.vmdk
+ FSType: ext4
+ StoragePolicyName: vSAN Default Storage Policy
+Events:
+```
+
+
+终结器 `external-provisioner.volume.kubernetes.io/finalizer` 会被添加到 CSI 卷上。下面是一个例子:
+
+```shell
+Name: pvc-2f0bab97-85a8-4552-8044-eb8be45cf48d
+Labels:
+Annotations: pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
+Finalizers: [kubernetes.io/pv-protection external-provisioner.volume.kubernetes.io/finalizer]
+StorageClass: fast
+Status: Bound
+Claim: demo-app/nginx-logs
+Reclaim Policy: Delete
+Access Modes: RWO
+VolumeMode: Filesystem
+Capacity: 200Mi
+Node Affinity:
+Message:
+Source:
+ Type: CSI (a Container Storage Interface (CSI) volume source)
+ Driver: csi.vsphere.vmware.com
+ FSType: ext4
+ VolumeHandle: 44830fa8-79b4-406b-8b58-621ba25353fd
+ ReadOnly: false
+ VolumeAttributes: storage.kubernetes.io/csiProvisionerIdentity=1648442357185-8081-csi.vsphere.vmware.com
+ type=vSphere CNS Block Volume
+Events:
+```
+
+
+为特定的树内卷插件启用 `CSIMigration` 特性将删除 `kubernetes.io/pv-controller` 终结器,
+同时添加 `external-provisioner.volume.kubernetes.io/finalizer` 终结器。
+同样,禁用 `CSIMigration` 将删除 `external-provisioner.volume.kubernetes.io/finalizer` 终结器,
+同时添加 `kubernetes.io/pv-controller` 终结器。
+
#### 重设使用中 PVC 申领的大小 {#resizing-an-in-use-persistentvolumevlaim}
-{{< feature-state for_k8s_version="v1.15" state="beta" >}}
-
-
-{{< note >}}
-Kubernetes 从 1.15 版本开始将调整使用中 PVC 申领大小这一能力作为 Beta
-特性支持;该特性在 1.11 版本以来处于 Alpha 阶段。
-`ExpandInUsePersistentVolumes` 特性必须被启用;在很多集群上,与此类似的
-Beta 阶段的特性是自动启用的。
-可参考[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
-文档了解更多信息。
-{{< /note >}}
+{{< feature-state for_k8s_version="v1.24" state="stable" >}}
{{< note >}}
Kubernetes 从 1.23 版本开始将允许用户恢复失败的 PVC 扩展这一能力作为
-alpha 特性支持。 `RecoverVolumeExpansionFailure` 必须被启用以允许使用此功能。
+alpha 特性支持。 `RecoverVolumeExpansionFailure` 必须被启用以允许使用此特性。
可参考[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
文档了解更多信息。
{{< /note >}}
-如果集群中的特性门控 `ExpandPersistentVolumes` 和 `RecoverVolumeExpansionFailure`
-都已启用,在 PVC 的扩展发生失败时,你可以使用比先前请求的值更小的尺寸来重试扩展。
+如果集群中的特性门控 `RecoverVolumeExpansionFailure`
+已启用,在 PVC 的扩展发生失败时,你可以使用比先前请求的值更小的尺寸来重试扩展。
要使用一个更小的尺寸尝试请求新的扩展,请编辑该 PVC 的 `.spec.resources` 并选择
一个比你之前所尝试的值更小的值。
如果由于容量限制而无法成功扩展至更高的值,这将很有用。
@@ -1411,10 +1490,7 @@ spec:
## Volume populators and data sources
-Kubernetes supports custom volume populators; this alpha feature was introduced
-in Kubernetes 1.18. Kubernetes 1.22 reimplemented the mechanism with a redesigned API.
-Check that you are reading the version of the Kubernetes documentation that matches your
-cluster. {{% version-check %}}
+Kubernetes supports custom volume populators.
To use custom volume populators, you must enable the `AnyVolumeDataSource`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for
the kube-apiserver and kube-controller-manager.
@@ -1428,13 +1504,11 @@ gate enabled, use of the `dataSourceRef` is preferred over `dataSource`.
## 卷填充器(Populator)与数据源 {#volume-populators-and-data-sources}
-{{< feature-state for_k8s_version="v1.22" state="alpha" >}}
+{{< feature-state for_k8s_version="v1.24" state="beta" >}}
{{< note >}}
-Kubernetes 支持自定义的卷填充器;Kubernetes 1.18 版本引入了这个 alpha 特性。
-Kubernetes 1.22 使用重新设计的 API 重新实现了该机制。
-确认你正在阅读与你的集群版本一致的 Kubernetes 文档。{{% version-check %}}
-要使用自定义的卷填充器,你必须为 kube-apiserver 和 kube-controller-manager 启用 `AnyVolumeDataSource`
+Kubernetes 支持自定义的卷填充器;要使用自定义的卷填充器,你必须为
+kube-apiserver 和 kube-controller-manager 启用 `AnyVolumeDataSource`
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
{{< /note >}}
@@ -1630,7 +1704,7 @@ Volume snapshot feature was added to support CSI Volume Plugins only. For detail
To enable support for restoring a volume from a volume snapshot data source, enable the
`VolumeSnapshotDataSource` feature gate on the apiserver and controller-manager.
-->
-卷快照(Volume Snapshot)功能的添加仅是为了支持 CSI 卷插件。
+卷快照(Volume Snapshot)特性的添加仅是为了支持 CSI 卷插件。
有关细节可参阅[卷快照](/zh/docs/concepts/storage/volume-snapshots/)文档。
要启用从卷快照数据源恢复数据卷的支持,可在 API 服务器和控制器管理器上启用
diff --git a/content/zh/docs/concepts/storage/volumes.md b/content/zh/docs/concepts/storage/volumes.md
index 2d92dbf79c..f70172c0a2 100644
--- a/content/zh/docs/concepts/storage/volumes.md
+++ b/content/zh/docs/concepts/storage/volumes.md
@@ -256,22 +256,21 @@ For more details, see the [`azureDisk` volume plugin](https://github.com/kuberne
-->
#### azureDisk 的 CSI 迁移 {#azuredisk-csi-migration}
-{{< feature-state for_k8s_version="v1.19" state="beta" >}}
+{{< feature-state for_k8s_version="v1.24" state="stable" >}}
-启用 `azureDisk` 的 `CSIMigration` 功能后,所有插件操作从现有的树内插件重定向到
+启用 `azureDisk` 的 `CSIMigration` 特性后,所有插件操作从现有的树内插件重定向到
`disk.csi.azure.com` 容器存储接口(CSI)驱动程序。
-为了使用此功能,必须在集群中安装
+为了使用此特性,必须在集群中安装
[Azure 磁盘 CSI 驱动程序](https://github.com/kubernetes-sigs/azuredisk-csi-driver),
-并且 `CSIMigration` 和 `CSIMigrationAzureDisk` 功能必须被启用。
+并且 `CSIMigration` 特性必须被启用。
-启用 `azureFile` 的 `CSIMigration` 功能后,所有插件操作将从现有的树内插件重定向到
-`file.csi.azure.com` 容器存储接口(CSI)驱动程序。要使用此功能,必须在集群中安装
+启用 `azureFile` 的 `CSIMigration` 特性后,所有插件操作将从现有的树内插件重定向到
+`file.csi.azure.com` 容器存储接口(CSI)驱动程序。要使用此特性,必须在集群中安装
[Azure 文件 CSI 驱动程序](https://github.com/kubernetes-sigs/azurefile-csi-driver),
并且 `CSIMigration` 和 `CSIMigrationAzureFile`
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
必须被启用。
Azure 文件 CSI 驱动尚不支持为同一卷设置不同的 fsgroup。
-如果 AzureFile CSI 迁移被启用,用不同的 fsgroup 来使用同一卷也是不被支持的。
+如果 `CSIMigrationAzureFile` 特性被启用,用不同的 fsgroup 来使用同一卷也是不被支持的。
#### OpenStack CSI 迁移
-{{< feature-state for_k8s_version="v1.21" state="beta" >}}
+{{< feature-state for_k8s_version="v1.24" state="stable" >}}
-Cinder 的 `CSIMigration` 功能在 Kubernetes 1.21 版本中是默认被启用的。
+自 Kubernetes 1.21 版本起,Cinder 的 `CSIMigration` 特性是默认被启用的。
此特性会将插件的所有操作从现有的树内插件重定向到
`cinder.csi.openstack.org` 容器存储接口(CSI)驱动程序。
-为了使用此功能,必须在集群中安装
+为了使用此特性,必须在集群中安装
[OpenStack Cinder CSI 驱动程序](https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/cinder-csi-plugin/using-cinder-csi-plugin.md),
你可以通过设置 `CSIMigrationOpenStack`
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
为 `false` 来禁止 Cinder CSI 迁移。
-如果你禁用了 `CSIMigrationOpenStack` 功能特性,则树内的 Cinder 卷插件
-会负责 Cinder 卷存储管理的方方面面。
+
+
+要禁止控制器管理器和 kubelet 加载树内 Cinder 插件,你可以启用
+`InTreePluginOpenStackUnregister` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
### configMap
@@ -783,8 +785,8 @@ within the same region. In order to use this feature, the volume must be provisi
as a PersistentVolume; referencing the volume directly from a Pod is not supported.
-->
[区域持久盘](https://cloud.google.com/compute/docs/disks/#repds)
-功能允许你创建能在同一区域的两个可用区中使用的持久盘。
-要使用这个功能,必须以持久卷(PersistentVolume)的方式提供卷;直接从
+特性允许你创建能在同一区域的两个可用区中使用的持久盘。
+要使用这个特性,必须以持久卷(PersistentVolume)的方式提供卷;直接从
Pod 引用这种卷是不可以的。
-启用 GCE PD 的 `CSIMigration` 功能后,所有插件操作将从现有的树内插件重定向到
+启用 GCE PD 的 `CSIMigration` 特性后,所有插件操作将从现有的树内插件重定向到
`pd.csi.storage.gke.io` 容器存储接口( CSI )驱动程序。
-为了使用此功能,必须在集群中上安装
+为了使用此特性,必须在集群中上安装
[GCE PD CSI驱动程序](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver),
-并且 `CSIMigration` 和 `CSIMigrationGCE` Beta 功能必须被启用。
+并且 `CSIMigration` 和 `CSIMigrationGCE` Beta 特性必须被启用。
-启用 RBD 的 `CSIMigration` 功能后,所有插件操作从现有的树内插件重定向到
+启用 RBD 的 `CSIMigration` 特性后,所有插件操作从现有的树内插件重定向到
`rbd.csi.ceph.com` {{}} 驱动程序。
-要使用该功能,必须在集群内安装
+要使用该特性,必须在集群内安装
[Ceph CSI 驱动](https://github.com/ceph/ceph-csi),并启用 `CSIMigration` 和 `csiMigrationRBD`
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
@@ -1601,15 +1603,13 @@ For more information about StorageOS, dynamic provisioning, and PersistentVolume
关于 StorageOS 的进一步信息、动态供应和持久卷申领等等,请参考
[StorageOS 示例](https://github.com/kubernetes/examples/blob/master/volumes/storageos)。
-### vsphereVolume {#vspherevolume}
+### vsphereVolume(弃用) {#vspherevolume}
{{< note >}}
-你必须配置 Kubernetes 的 vSphere 云驱动。云驱动的配置方法请参考
-[vSphere 使用指南](https://vmware.github.io/vsphere-storage-for-kubernetes/documentation/)。
+建议你改用 vSphere CSI 树外驱动程序。
{{< /note >}}
-{{< caution >}}
-在挂载到 Pod 之前,你必须用下列方式之一创建 VMDK。
-{{< /caution >}}
-
-
-#### 创建 VMDK 卷 {#creating-vmdk-volume}
-
-选择下列方式之一创建 VMDK。
-
-{{< tabs name="tabs_volumes" >}}
-{{% tab name="使用 vmkfstools 创建" %}}
-
-首先 ssh 到 ESX,然后使用下面的命令来创建 VMDK:
-
-```shell
-vmkfstools -c 2G /vmfs/volumes/DatastoreName/volumes/myDisk.vmdk
-```
-{{% /tab %}}
-{{% tab name="使用 vmware-vdiskmanager 创建" %}}
-
-使用下面的命令创建 VMDK:
-
-```shell
-vmware-vdiskmanager -c -t 0 -s 40GB -a lsilogic myDisk.vmdk
-```
-{{% /tab %}}
-
-{{< /tabs >}}
-
-
-
-#### vSphere VMDK 配置示例 {#vsphere-vmdk-configuration}
-
-```yaml
-apiVersion: v1
-kind: Pod
-metadata:
- name: test-vmdk
-spec:
- containers:
- - image: k8s.gcr.io/test-webserver
- name: test-container
- volumeMounts:
- - mountPath: /test-vmdk
- name: test-volume
- volumes:
- - name: test-volume
- # 此 VMDK 卷必须已经存在
- vsphereVolume:
- volumePath: "[DatastoreName] volumes/myDisk"
- fsType: ext4
-```
-
@@ -1710,10 +1648,26 @@ must be installed on the cluster and the `CSIMigration` and `CSIMigrationvSphere
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
-此特性还要求 vSphere vCenter/ESXi 的版本至少为 7.0u1,且 HW 版本至少为
-VM version 15。
+你可以在 VMware 的文档页面
+[迁移树内 vSphere 卷插件到 vSphere 容器存储插件](https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/2.0/vmware-vsphere-csp-getting-started/GUID-968D421F-D464-4E22-8127-6CB9FF54423F.html)
+中找到有关如何迁移的其他建议。
+
+为了迁移到树外 CSI 驱动程序,Kubernetes v{{< skew currentVersion >}}
+要求你使用 vSphere 7.0u2 或更高版本。
+如果你正在运行 v{{< skew currentVersion >}} 以外的 Kubernetes 版本,
+请查阅该 Kubernetes 版本的文档。
+如果你正在运行 Kubernetes v{{< skew currentVersion >}} 和旧版本的 vSphere,
+请考虑至少升级到 vSphere 7.0u2。
{{< note >}}
-Kubernetes 1.23 中加入了 Portworx 的 `CSIMigration` 功能,但默认不会启用,因为该功能仍处于 alpha 阶段。
-该功能会将所有的插件操作从现有的树内插件重定向到
+Kubernetes 1.23 中加入了 Portworx 的 `CSIMigration` 特性,但默认不会启用,因为该特性仍处于 alpha 阶段。
+该特性会将所有的插件操作从现有的树内插件重定向到
`pxd.portworx.com` 容器存储接口(Container Storage Interface, CSI)驱动程序。
集群中必须安装
[Portworx CSI 驱动](https://docs.portworx.com/portworx-install-with-kubernetes/storage-operations/csi/)。
-要启用此功能,请在 kube-controller-manager 和 kubelet 中设置 `CSIMigrationPortworx=true`。
+要启用此特性,请在 kube-controller-manager 和 kubelet 中设置 `CSIMigrationPortworx=true`。
-启用 `CSIMigration` 功能后,针对现有树内插件的操作会被重定向到相应的 CSI 插件(应已安装和配置)。
+启用 `CSIMigration` 特性后,针对现有树内插件的操作会被重定向到相应的 CSI 插件(应已安装和配置)。
因此,操作员在过渡到取代树内插件的 CSI 驱动时,无需对现有存储类、PV 或 PVC(指树内插件)进行任何配置更改。
-所支持的操作和功能包括:配备(Provisioning)/删除、挂接(Attach)/解挂(Detach)、
+所支持的操作和特性包括:配备(Provisioning)/删除、挂接(Attach)/解挂(Detach)、
挂载(Mount)/卸载(Unmount)和调整卷大小。
上面的[卷类型](#volume-types)节列出了支持 `CSIMigration` 并已实现相应 CSI
From 5f953799ca1d401c04bea77e5147e4aa676447b6 Mon Sep 17 00:00:00 2001
From: howieyuen
Date: Wed, 25 May 2022 17:55:13 +0800
Subject: [PATCH 145/245] fix: delete redundant quotation
---
.../update-api-object-kubectl-patch.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/zh/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md b/content/zh/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md
index dd47ec39cf..af9c187e4d 100644
--- a/content/zh/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md
+++ b/content/zh/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md
@@ -254,7 +254,7 @@ Patch your Deployment:
对 Deployment 执行 patch 操作:
```
-kubectl patch deployment patch-demo --patch-file patch-file-tolerations.yaml"
+kubectl patch deployment patch-demo --patch-file patch-file-tolerations.yaml
```
+
+`apiVersion: rbac.authorization.k8s.io/v1`
+
+`import "k8s.io/api/rbac/v1"`
+
+## Role {#Role}
+
+Role 是一个按命名空间划分的 PolicyRule 逻辑分组,可以被 RoleBinding 作为一个单元引用。
+
+
+
+- **apiVersion**: rbac.authorization.k8s.io/v1
+
+- **kind**: Role
+
+- **metadata** (}}">ObjectMeta)
+
+ 标准的对象元数据。
+
+- **rules** ([]PolicyRule)
+
+ rules 包含了这个 Role 的所有 PolicyRule。
+
+
+ **PolicyRule 包含描述一个策略规则的信息,但不包含该规则适用于哪个主体或适用于哪个命名空间的信息。**
+
+ - **rules.apiGroups** ([]string)
+
+ apiGroups 是包含资源的 apiGroup 的名称。
+ 如果指定了多个 API 组,则允许对任何 API 组中的其中一个枚举资源来请求任何操作。
+
+ - **rules.resources** ([]string)
+
+ resources 是此规则所适用的资源的列表。
+ “*” 表示所有资源。
+
+ - **rules.verbs** ([]string),必需
+
+ verbs 是适用于此规则中所包含的所有 ResourceKinds 的动作。
+ “*” 表示所有动作。
+
+ - **rules.resourceNames** ([]string)
+
+ resourceNames 是此规则所适用的资源名称白名单,可选。
+ 空集合意味着允许所有资源。
+
+ - **rules.nonResourceURLs** ([]string)
+
+ nonResourceURLs 是用户应有权访问的一组部分 URL。
+ 允许使用 “*”,但仅能作为路径中最后一段且必须用于完整的一段,
+ 因为非资源 URL 没有划分命名空间。
+ 此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRole。
+ rules 可以应用到 API 资源(如 “pod” 或 “secret”)或非资源 URL 路径(如 “/api”),
+ 但不能同时应用于两者。
+
+## RoleList {#RoleList}
+
+RoleList 是 Role 的集合。
+
+
+
+- **apiVersion**: rbac.authorization.k8s.io/v1
+
+- **kind**: RoleList
+
+- **metadata** (}}">ListMeta)
+
+ 标准的对象元数据。
+
+- **items** ([]}}">Role),必需
+
+ items 是 Role 的列表。
+
+## 操作 {#Operations}
+
+
+
+### `get` 读取指定的 Role
+
+#### HTTP 请求
+
+GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
+
+#### 参数
+
+- **name** (**路径参数**): string,必需
+
+ Role 的名称
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+#### 响应
+
+200 (}}">Role): OK
+
+401: Unauthorized
+
+### `list` 列出或观测类别为 Role 的对象
+
+#### HTTP 请求
+
+GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
+
+#### 参数
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **allowWatchBookmarks** (**查询参数**): boolean
+
+ }}">allowWatchBookmarks
+
+- **continue** (**查询参数**): string
+
+ }}">continue
+
+- **fieldSelector** (**查询参数**): string
+
+ }}">fieldSelector
+
+- **labelSelector** (**查询参数**): string
+
+ }}">labelSelector
+
+- **limit** (**查询参数**): integer
+
+ }}">limit
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+- **resourceVersion** (**查询参数**): string
+
+ }}">resourceVersion
+
+- **resourceVersionMatch** (**查询参数**): string
+
+ }}">resourceVersionMatch
+
+- **timeoutSeconds** (**查询参数**): integer
+
+ }}">timeoutSeconds
+
+- **watch** (**查询参数**): boolean
+
+ }}">watch
+
+#### 响应
+
+200 (}}">RoleList): OK
+
+401: Unauthorized
+
+### `list` 列出或观测类别为 Role 的对象
+
+#### HTTP 请求
+
+GET /apis/rbac.authorization.k8s.io/v1/roles
+
+#### 参数
+
+- **allowWatchBookmarks** (**查询参数**): boolean
+
+ }}">allowWatchBookmarks
+
+- **continue** (**查询参数**): string
+
+ }}">continue
+
+- **fieldSelector** (**查询参数**): string
+
+ }}">fieldSelector
+
+- **labelSelector** (**查询参数**): string
+
+ }}">labelSelector
+
+- **limit** (**查询参数**): integer
+
+ }}">limit
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+- **resourceVersion** (**查询参数**): string
+
+ }}">resourceVersion
+
+- **resourceVersionMatch** (**查询参数**): string
+
+ }}">resourceVersionMatch
+
+- **timeoutSeconds** (**查询参数**): integer
+
+ }}">timeoutSeconds
+
+- **watch** (**查询参数**): boolean
+
+ }}">watch
+
+#### 响应
+
+200 (}}">RoleList): OK
+
+401: Unauthorized
+
+### `create` 创建 Role
+
+#### HTTP 请求
+
+POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
+
+#### 参数
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **body**: }}">Role,必需
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+- **fieldManager** (**查询参数**): string
+
+ }}">fieldManager
+
+- **fieldValidation** (**查询参数**): string
+
+ }}">fieldValidation
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+#### 响应
+
+200 (}}">Role): OK
+
+201 (}}">Role): Created
+
+202 (}}">Role): Accepted
+
+401: Unauthorized
+
+### `update` 替换指定的 Role
+
+#### HTTP 请求
+
+PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
+
+#### 参数
+
+- **name** (**路径参数**): string,必需
+
+ Role 的名称
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **body**: }}">Role,必需
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+- **fieldManager** (**查询参数**): string
+
+ }}">fieldManager
+
+- **fieldValidation** (**查询参数**): string
+
+ }}">fieldValidation
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+#### 响应
+
+200 (}}">Role): OK
+
+201 (}}">Role): Created
+
+401: Unauthorized
+
+### `patch` 部分更新指定的 Role
+
+#### HTTP 请求
+
+PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
+
+#### 参数
+
+- **name** (**路径参数**): string,必需
+
+ Role 的名称
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **body**: }}">Patch,必需
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+- **fieldManager** (**查询参数**): string
+
+ }}">fieldManager
+
+- **fieldValidation** (**查询参数**): string
+
+ }}">fieldValidation
+
+- **force** (**查询参数**): boolean
+
+ }}">force
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+#### 响应
+
+200 (}}">Role): OK
+
+201 (}}">Role): Created
+
+401: Unauthorized
+
+### `delete` 删除 Role
+
+#### HTTP 请求
+
+DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
+
+#### 参数
+
+- **name** (**路径参数**): string,必需
+
+ Role 的名称
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **body**: }}">DeleteOptions
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+- **gracePeriodSeconds** (**查询参数**): integer
+
+ }}">gracePeriodSeconds
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+- **propagationPolicy** (**查询参数**): string
+
+ }}">propagationPolicy
+
+#### 响应
+
+200 (}}">Status): OK
+
+202 (}}">Status): Accepted
+
+401: Unauthorized
+
+### `deletecollection` 删除 Role 的集合
+
+#### HTTP 请求
+
+DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
+
+#### 参数
+
+- **namespace** (**路径参数**): string,必需
+
+ }}">namespace
+
+- **body**: }}">DeleteOptions
+
+- **continue** (**查询参数**): string
+
+ }}">continue
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+- **fieldSelector** (**查询参数**): string
+
+ }}">fieldSelector
+
+- **gracePeriodSeconds** (**查询参数**): integer
+
+ }}">gracePeriodSeconds
+
+- **labelSelector** (**查询参数**): string
+
+ }}">labelSelector
+
+- **limit** (**查询参数**): integer
+
+ }}">limit
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+- **propagationPolicy** (**查询参数**): string
+
+ }}">propagationPolicy
+
+- **resourceVersion** (**查询参数**): string
+
+ }}">resourceVersion
+
+- **resourceVersionMatch** (**查询参数**): string
+
+ }}">resourceVersionMatch
+
+- **timeoutSeconds** (**查询参数**): integer
+
+ }}">timeoutSeconds
+
+#### 响应
+
+200 (}}">Status): OK
+
+401: Unauthorized
From cca0aca8550be1a6d24efaf64f6e731028665111 Mon Sep 17 00:00:00 2001
From: Sean Wei
Date: Sat, 21 May 2022 02:17:51 +0800
Subject: [PATCH 147/245] Fix Markdown link
---
content/en/docs/concepts/configuration/secret.md | 6 +++---
content/en/docs/contribute/participate/pr-wranglers.md | 2 +-
.../docs/tasks/administer-cluster/configure-upgrade-etcd.md | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/content/en/docs/concepts/configuration/secret.md b/content/en/docs/concepts/configuration/secret.md
index d9611439a4..3bdfb16a0c 100644
--- a/content/en/docs/concepts/configuration/secret.md
+++ b/content/en/docs/concepts/configuration/secret.md
@@ -982,7 +982,7 @@ kubectl create secret docker-registry secret-tiger-docker \
```
That command creates a Secret of type `kubernetes.io/dockerconfigjson`.
-If you dump the `.data.dockercfgjson` field from that new Secret and then
+If you dump the `.data.dockerconfigjson` field from that new Secret and then
decode it from base64:
```shell
@@ -1291,7 +1291,7 @@ on that node.
- When deploying applications that interact with the Secret API, you should
limit access using
[authorization policies](/docs/reference/access-authn-authz/authorization/) such as
- [RBAC]( /docs/reference/access-authn-authz/rbac/).
+ [RBAC](/docs/reference/access-authn-authz/rbac/).
- In the Kubernetes API, `watch` and `list` requests for Secrets within a namespace
are extremely powerful capabilities. Avoid granting this access where feasible, since
listing Secrets allows the clients to inspect the values of every Secret in that
@@ -1310,7 +1310,7 @@ have access to run a Pod that then exposes the Secret.
- When deploying applications that interact with the Secret API, you should
limit access using
[authorization policies](/docs/reference/access-authn-authz/authorization/) such as
- [RBAC]( /docs/reference/access-authn-authz/rbac/).
+ [RBAC](/docs/reference/access-authn-authz/rbac/).
- In the API server, objects (including Secrets) are persisted into
{{< glossary_tooltip term_id="etcd" >}}; therefore:
- only allow cluster admistrators to access etcd (this includes read-only access);
diff --git a/content/en/docs/contribute/participate/pr-wranglers.md b/content/en/docs/contribute/participate/pr-wranglers.md
index 865af35805..42c1d2b32b 100644
--- a/content/en/docs/contribute/participate/pr-wranglers.md
+++ b/content/en/docs/contribute/participate/pr-wranglers.md
@@ -100,4 +100,4 @@ In late 2021, SIG Docs introduced the PR Wrangler Shadow Program. The program wa
- Others can reach out on the [#sig-docs Slack channel](https://kubernetes.slack.com/messages/sig-docs) for requesting to shadow an assigned PR Wrangler for a specific week. Feel free to reach out to Brad Topol (`@bradtopol`) or one of the [SIG Docs co-chairs/leads](https://github.com/kubernetes/community/tree/master/sig-docs#leadership).
-- Once you've signed up to shadow a PR Wrangler, introduce yourself to the PR Wrangler on the [Kubernetes Slack](slack.k8s.io).
\ No newline at end of file
+- Once you've signed up to shadow a PR Wrangler, introduce yourself to the PR Wrangler on the [Kubernetes Slack](https://slack.k8s.io).
diff --git a/content/en/docs/tasks/administer-cluster/configure-upgrade-etcd.md b/content/en/docs/tasks/administer-cluster/configure-upgrade-etcd.md
index bf5ddd8f5f..be77074dc1 100644
--- a/content/en/docs/tasks/administer-cluster/configure-upgrade-etcd.md
+++ b/content/en/docs/tasks/administer-cluster/configure-upgrade-etcd.md
@@ -150,7 +150,7 @@ access to clients with the certificate `k8sclient.cert`.
Once etcd is configured correctly, only clients with valid certificates can
access it. To give Kubernetes API servers the access, configure them with the
-flags `--etcd-certfile=k8sclient.cert`,`--etcd-keyfile=k8sclient.key` and
+flags `--etcd-certfile=k8sclient.cert`, `--etcd-keyfile=k8sclient.key` and
`--etcd-cafile=ca.cert`.
{{< note >}}
@@ -319,7 +319,7 @@ employed to recover the data of a failed cluster.
Before starting the restore operation, a snapshot file must be present. It can
either be a snapshot file from a previous backup operation, or from a remaining
-[data directory]( https://etcd.io/docs/current/op-guide/configuration/#--data-dir).
+[data directory](https://etcd.io/docs/current/op-guide/configuration/#--data-dir).
Here is an example:
```shell
From 2c154e13f5b05837e0ca3352b7cba806201e82b7 Mon Sep 17 00:00:00 2001
From: Tom Kivlin <52716470+tomkivlin@users.noreply.github.com>
Date: Wed, 25 May 2022 15:15:38 +0100
Subject: [PATCH 148/245] remove duplicate 'the'
---
.../extend-kubernetes/compute-storage-net/network-plugins.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md
index 52b0bc3e26..647111b375 100644
--- a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md
+++ b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md
@@ -54,7 +54,7 @@ By default, if no kubelet network plugin is specified, the `noop` plugin is used
### Loopback CNI
In addition to the CNI plugin installed on the nodes for implementing the Kubernetes network model, Kubernetes also requires the container runtimes to provide a loopback interface `lo`, which is used for each sandbox (pod sandboxes, vm sandboxes, ...).
-Implementing the loopback interface can be accomplished by re-using the [the CNI loopback plugin.](https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback/loopback.go) or by developing your own code to achieve this (see [this example from CRI-O](https://github.com/cri-o/ocicni/blob/release-1.24/pkg/ocicni/util_linux.go#L91)).
+Implementing the loopback interface can be accomplished by re-using the [CNI loopback plugin.](https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback/loopback.go) or by developing your own code to achieve this (see [this example from CRI-O](https://github.com/cri-o/ocicni/blob/release-1.24/pkg/ocicni/util_linux.go#L91)).
### Support hostPort
From 694abb29622bed76830fe7b72df9a940385c5103 Mon Sep 17 00:00:00 2001
From: kadtendulkar
Date: Wed, 25 May 2022 21:28:36 +0530
Subject: [PATCH 149/245] update content/en/releases/version-skew-policy.md
---
content/en/releases/version-skew-policy.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/releases/version-skew-policy.md b/content/en/releases/version-skew-policy.md
index 87f6cf2c62..f59ab71ad8 100644
--- a/content/en/releases/version-skew-policy.md
+++ b/content/en/releases/version-skew-policy.md
@@ -26,7 +26,7 @@ For more information, see [Kubernetes Release Versioning](https://github.com/kub
The Kubernetes project maintains release branches for the most recent three minor releases ({{< skew latestVersion >}}, {{< skew prevMinorVersion >}}, {{< skew oldestMinorVersion >}}). Kubernetes 1.19 and newer receive approximately 1 year of patch support. Kubernetes 1.18 and older received approximately 9 months of patch support.
Applicable fixes, including security fixes, may be backported to those three release branches, depending on severity and feasibility.
-Patch releases are cut from those branches at a [regular cadence](https://git.k8s.io/sig-release/releases/patch-releases.md#cadence), plus additional urgent releases, when required.
+Patch releases are cut from those branches at a [regular cadence](https://kubernetes.io/releases/patch-releases/#cadence), plus additional urgent releases, when required.
The [Release Managers](/releases/release-managers/) group owns this decision.
From 9c71a06df47872e142ffcc44a3bf62eef3390dd0 Mon Sep 17 00:00:00 2001
From: "wei.wang"
Date: Thu, 26 May 2022 02:26:45 +0800
Subject: [PATCH 150/245] [zh]Update
content/zh/docs/reference/config-api/kubeadm-config.v1beta2.md
---
.../config-api/kubeadm-config.v1beta2.md | 34 +++++++++----------
.../config-api/kubeadm-config.v1beta3.md | 20 ++++++-----
2 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/content/zh/docs/reference/config-api/kubeadm-config.v1beta2.md b/content/zh/docs/reference/config-api/kubeadm-config.v1beta2.md
index f34da9f473..bc37e362a7 100644
--- a/content/zh/docs/reference/config-api/kubeadm-config.v1beta2.md
+++ b/content/zh/docs/reference/config-api/kubeadm-config.v1beta2.md
@@ -292,7 +292,7 @@ https://godoc.org/k8s.io/kubelet/config/v1beta1#KubeletConfiguration。
criSocket:"/var/run/dockershim.sock"taints:- key:"kubeadmNode"
-value:"master"
+value:"someValue"effect:"NoSchedule"kubeletExtraArgs:v:4
@@ -1274,9 +1274,10 @@ cluster information.
tlsBootstrapToken 是 TLS 启动引导过程中使用的令牌。
如果设置了 bootstrapToken,则此字段默认值为 .bootstrapToken.token,
@@ -1783,29 +1784,28 @@ Defaults to the hostname of the node if not provided.
criSocket 用来读取容器运行时的信息。
-此信息会被以注解的方式添加到 Node API 对象至上,用于后续用途。
-
+If this field is unset, i.e. nil, in the kubeadm init process it will be defaulted with
+a control-plane taint for control-plane nodes. If you don't want to taint your control-plane
+node, set this field to an empty list, i.e. taints: [], in the YAML file. This field is
+solely used for Node registration.
+-->
kubeletExtraArgs[必需]
diff --git a/content/zh/docs/reference/config-api/kubeadm-config.v1beta3.md b/content/zh/docs/reference/config-api/kubeadm-config.v1beta3.md
index 2a53c835db..ef491a424e 100644
--- a/content/zh/docs/reference/config-api/kubeadm-config.v1beta3.md
+++ b/content/zh/docs/reference/config-api/kubeadm-config.v1beta3.md
@@ -313,7 +313,7 @@ https://godoc.org/k8s.io/kubelet/config/v1beta1#KubeletConfiguration。
criSocket:"/var/run/dockershim.sock"taints:- key:"kubeadmNode"
-value:"master"
+value:"someValue"effect:"NoSchedule"kubeletExtraArgs:v:4
@@ -1655,15 +1655,17 @@ This information will be annotated to the Node API object, for later re-use[]core/v1.Taint