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 {{}} -***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 {{}} -***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 {{}} -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 {{}} -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/)。 - - -![Dockershim 和 Containerd CRI 的实现对比图](/images/blog/2018-05-24-kubernetes-containerd-integration-goes-ga/cri-containerd.png) - - -切换到容器运行时 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 + - 地点: 加州旧金山 --- + -
-
-
- -

利用 Kubernetes 构建工具提升世界的维基

-

- -非营利的 Wikimedia 基金会运营着一些世界上最大的合作编辑参考项目,包括 Wikipedia。为了帮助用户维护和使用 wiki,它运行 Wikimedia 工具实验室,这是一个托管环境,为社区开发人员工作的工具和机器人,以帮助编辑和其他志愿者做他们的工作,包括减少破坏。Wikimedia 工具实验室周围的社区在近10年前开始形成。 -

-
- Wikimedia -

- -“ Wikimedia 工具实验室对于确保世界各地的 wiki 尽可能工作至关重要。因为它有机地生长了近10年,它已成为一个极具挑战性的环境,难以维持。它就像一个大的泥球,你真的看不透它。借助 Kubernetes,可以简化环境,使开发人员能够更轻松地构建使 wiki 运行得更好的工具。” -

- -

— Yuvi Panda, Wikimedia 基金会和 Wikimedia 工具实验室的运维工程师

-
-
-
-
+ +

非营利的 Wikimedia 基金会运营着一些世界上最大的合作编辑参考项目,包括 Wikipedia。为了帮助用户维护和使用 wiki,它运行 Wikimedia 工具实验室,这是一个托管环境,为社区开发人员工作的工具和机器人,以帮助编辑和其他志愿者做他们的工作,包括减少破坏。Wikimedia 工具实验室周围的社区在近 10 年前开始形成。

-
-
-
-
-

挑战:

-
    - -
  • 简化复杂、难以管理的基础架构
  • - -
  • 允许开发人员使用现有技术继续编写工具和机器人
  • -
-
-
- -

为什么要使用 Kubernetes

-
    - -
  • Wikimedia 工具实验室之所以选择 Kubernetes,是因为它可以模仿现有的工作流程,同时降低复杂性。
  • -
-
-
- -

解决方案:

-
    - -
  • 将旧系统和复杂的基础设施迁移到库贝内特斯
  • -
-
-
- -

结果:

-
    - -
  • 占 Web 流量 40% 以上的 Web 工具的 20% 现在都在 Kubernetes 上运行
  • - -
  • 一个 25 节点集群可跟上每个新 Kubernetes 版本
  • - -
  • 由于 Kubernetes 数千行旧代码被删除
  • -
-
-
-
-
+ -

使用 Kubernetes 提供维护 wiki 的工具

-

- - Wikimedia 工具实验室由四名半付费员工和两名志愿者管理。基础架构无法使开发人员轻松或直观地构建机器人和其他工具,使 wiki 更易于工作。Yuvi说,“它非常混乱。我们有很多的 Perl 和 Bash 缠绕在上面。一切都是超级脆弱。” -

-

- - 为了解决这个问题,Wikimedia 工具实验室将其部分基础设施迁移到了 Kubernetes,为最终迁移整个系统做准备。Yuvi 说,Kubernetes 大大简化了维护。目标是允许创建机器人和其他工具的开发人员使用他们想要的任何开发方法,但使 Wikimedia 工具实验室更容易维护托管和共享它们所需的基础结构。 -

-

- - “借助 Kubernetes,我能够删除大量我们定制的代码,这使得所有内容更易于维护。我们的用户代码也以比以前更稳定的方式运行,” Yuvi 说。 -

- - - +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 工具实验室的运维工程师">}} -
-
-
- -

简化基础架构让 wiki 更好地运行

-

- - Wikimedia 工具实验室在最初的 Kubernetes 部署中取得了巨大成功。旧代码正在被简化和消除,使开发人员不必改变他们编写工具和机器人的方式,这些工具和机器人的运行方式比过去更稳定。付费员工和志愿者能够更好地解决问题。 -

-

- - 将来,随着更完整的迁移到 Kubernetes,Wikimedia 工具实验室希望使托管和维护帮助在世界各地运行 wiki 的机器人和工具变得更加容易。该工具实验室已经托管了来自 800 名志愿者的大约 1300 个工具和机器人,每天提交更多工具和机器人。占 Web 流量 60% 以上的 20% 的工具实验室 Web 工具现在运行在 Kubernetes 上。该工具实验室有一个 25 节点群集,可跟上每个新的 Kubernetes 版本。许多现有的 Web 工具正在迁移到 Kubernetes。 -

-

- - “我们的目标是确保世界各地的人们能够尽可能轻松地分享知识。Kubernetes 通过让世界各地的 wiki 更容易拥有蓬勃发展所需的工具,从而帮助到您,” Yuvi 说。 -

-
-
-
+Wikimedia +
+
+“Wikimedia 工具实验室对于确保世界各地的 wiki 尽可能正常运行至关重要。因为它有机地生长了近 10 年,所以它已成为一个极具挑战性且难以维护的环境。它就像一个大的泥球,你真的看不透它。借助 Kubernetes,我们正在简化环境并让开发人员更容易构建出使 wiki 更好运行的工具。” +{{< /case-studies/quote >}} + + +

挑战

+ + +
    +
  • 简化复杂、难以管理的基础架构
  • +
  • 允许开发人员使用现有技术继续编写工具和机器人
  • +
+ + +

为什么要使用 Kubernetes

+ +
    + +
  • Wikimedia 工具实验室之所以选择 Kubernetes,是因为它可以模仿现有的工作流程,同时降低复杂性。
  • +
+ + +

解决方案

+ +
    + +
  • 将旧系统和复杂的基础设施迁移到 Kubernetes
  • +
+ + +

结果

+ + +
    +
  • 现在占 Web 流量 40% 以上的 20% Web 工具都在 Kubernetes 上运行
  • +
  • 一个 25 节点集群可跟上每个新 Kubernetes 版本
  • +
  • 多亏了 Kubernetes,数千行旧代码可被删除
  • +
+ + +

使用 Kubernetes 提供维护 wiki 的工具

+ + +

Wikimedia 工具实验室由四个半带薪员工和两名志愿者管理。基础架构无法使开发人员轻松或直观地构建机器人和其他工具,使 wiki 更易于工作。Yuvi 说,“它非常混乱,我们有很多的 Perl 和 Bash 缠绕在上面,一切都是超级脆弱。”

+ + +

为了解决这个问题,Wikimedia 工具实验室将其部分基础设施迁移到了 Kubernetes,为最终迁移整个系统做准备。Yuvi 说,Kubernetes 大大简化了维护。目标是允许创建机器人和其他工具的开发人员使用他们想要的任何开发方法,但使 Wikimedia 工具实验室更容易维护托管和共享它们所需的基础结构。

+ + +

Yuvi 说:“借助 Kubernetes,我能够删除大量我们定制的代码,这使得所有内容更易于维护,我们的用户代码也以比以前更稳定的方式运行。”

+ + +

简化基础架构让 wiki 更好地运行

+ + +

Wikimedia 工具实验室在最初的 Kubernetes 部署中取得了巨大成功。旧代码正在被简化和消除,使开发人员不必改变他们编写工具和机器人的方式,这些工具和机器人的运行方式比过去更稳定。带薪员工和志愿者能够更好地解决问题。

+ + +

将来,随着更完整的迁移到 Kubernetes,Wikimedia 工具实验室希望更轻松地托管和维护有助于在世界各地运行 wiki 的机器人和工具。该工具实验室已经拥有来自 800 名志愿者的大约 1300 个工具和机器人,而且每天提交量会更多。占 Web 流量 60% 以上的工具实验室的 Web 工具中有 20% 现在运行在 Kubernetes 上。工具实验室有一个 25 节点的集群,可以跟上每个新的 Kubernetes 版本。许多现有的 Web 工具正在迁移到 Kubernetes。

+ + +

Yuvi 说:“我们的目标是确保世界各地的人们能够尽可能轻松地分享知识,Kubernetes 帮助实现了这一点,它让世界各地的 wiki 更容易拥有蓬勃发展所需的工具。”

diff --git a/content/zh/case-studies/wikimedia/wikimedia_featured.svg b/content/zh/case-studies/wikimedia/wikimedia_featured.svg new file mode 100644 index 0000000000..5fa786aaa5 --- /dev/null +++ b/content/zh/case-studies/wikimedia/wikimedia_featured.svg @@ -0,0 +1 @@ +kubernetes.io-logos2 \ No newline at end of file From 3c746f6cdca5c606063fe9fd1a2a64e459570644 Mon Sep 17 00:00:00 2001 From: yuli Date: Tue, 17 May 2022 20:56:26 +0800 Subject: [PATCH 035/245] [zh]Update content/zh/docs/reference/command-line-tools-reference/kube-controller-manager.md [zh]Update content/zh/docs/reference/command-line-tools-reference/kube-proxy.md [zh]Update content/zh/docs/reference/using-api/deprecation-guide.md --- .../kube-controller-manager.md | 401 +++++---------- .../kube-proxy.md | 477 ++++++++---------- .../reference/using-api/deprecation-guide.md | 5 +- 3 files changed, 344 insertions(+), 539 deletions(-) diff --git a/content/zh/docs/reference/command-line-tools-reference/kube-controller-manager.md b/content/zh/docs/reference/command-line-tools-reference/kube-controller-manager.md index 4580ad21ca..69d31090b9 100644 --- a/content/zh/docs/reference/command-line-tools-reference/kube-controller-manager.md +++ b/content/zh/docs/reference/command-line-tools-reference/kube-controller-manager.md @@ -48,18 +48,6 @@ kube-controller-manager [flags] - ---add-dir-header - - - - -若为 true,将文件目录添加到日志消息的头部。 - - - --allocate-node-cidrs @@ -73,7 +61,7 @@ Should CIDRs for Pods be allocated and set on the cloud provider. ---allow-metric-labels stringToString     默认值:"" +--allow-metric-labels stringToString     默认值:[]

@@ -89,18 +77,6 @@ metric2,label='v1,v2,v3'。 - ---alsologtostderr - - - - -在向文件输出日志的同时,也将日志写到标准输出。 - - - --attach-detach-reconcile-sync-period duration     默认值:1m0s @@ -232,7 +208,7 @@ Path to the file containing Azure container registry configuration information. ---bind-address ip     默认值:0.0.0.0 +--bind-address string     默认值:0.0.0.0 @@ -511,6 +487,19 @@ The number of endpoint syncing operations that will be done concurrently. Larger + +--concurrent-ephemeralvolume-syncs int32     默认值:5 + + + + +可以并发执行的 EphemeralVolume 同步操作个数。数值越大意味着更快的 EphemeralVolume 更新操作, +同时也意味着更大的 CPU (和网络)压力。 + + + --concurrent-gc-syncs int32     默认值:20 @@ -676,7 +665,7 @@ Interval between starting controller managers. ---controllers strings     默认值:[*] +--controllers strings     默认值:* @@ -690,18 +679,6 @@ A list of controllers to enable. '*' enables all on-by-default controllers, 'foo 默认禁用的控制器有:bootstrapsigner 和 tokencleaner。 - ---deployment-controller-sync-period duration     默认值:30s - - - - -Deployment 资源的同步周期。 - - - --disable-attach-detach-reconcile-sync @@ -822,19 +799,6 @@ The length of endpoint slice updates batching period. Processing of pod changes - ---experimental-logging-sanitization - - - - -[试验性功能] 当启用此标志时,被标记为敏感的字段(密码、密钥、令牌)不会被日志输出。
-运行时的日志清理操作可能会引入相当程度的计算开销,因此不应在生产环境中启用。 - - - --external-cloud-volume-plugin string @@ -864,96 +828,99 @@ APIServerIdentity=true|false (ALPHA - default=false)
APIServerTracing=true|false (ALPHA - default=false)
AllAlpha=true|false (ALPHA - default=false)
AllBeta=true|false (BETA - default=false)
-AnyVolumeDataSource=true|false (ALPHA - default=false)
+AnyVolumeDataSource=true|false (BETA - default=true)
AppArmor=true|false (BETA - default=true)
CPUManager=true|false (BETA - default=true)
-CPUManagerPolicyOptions=true|false (ALPHA - default=false)
+CPUManagerPolicyAlphaOptions=true|false (ALPHA - default=false)
+CPUManagerPolicyBetaOptions=true|false (BETA - default=true)
+CPUManagerPolicyOptions=true|false (BETA - default=true)
CSIInlineVolume=true|false (BETA - default=true)
CSIMigration=true|false (BETA - default=true)
-CSIMigrationAWS=true|false (BETA - default=false)
-CSIMigrationAzureDisk=true|false (BETA - default=false)
-CSIMigrationAzureFile=true|false (BETA - default=false)
-CSIMigrationGCE=true|false (BETA - default=false)
-CSIMigrationOpenStack=true|false (BETA - default=true)
+CSIMigrationAWS=true|false (BETA - default=true)
+CSIMigrationAzureFile=true|false (BETA - default=true)
+CSIMigrationGCE=true|false (BETA - default=true)
+CSIMigrationPortworx=true|false (ALPHA - default=false)
+CSIMigrationRBD=true|false (ALPHA - default=false)
CSIMigrationvSphere=true|false (BETA - default=false)
-CSIStorageCapacity=true|false (BETA - default=true)
-CSIVolumeFSGroupPolicy=true|false (BETA - default=true)
CSIVolumeHealth=true|false (ALPHA - default=false)
-CSRDuration=true|false (BETA - default=true)
-ConfigurableFSGroupPolicy=true|false (BETA - default=true)
-ControllerManagerLeaderMigration=true|false (BETA - default=true)
+ContextualLogging=true|false (ALPHA - default=false)
+CronJobTimeZone=true|false (ALPHA - default=false)
CustomCPUCFSQuotaPeriod=true|false (ALPHA - default=false)
+CustomResourceValidationExpressions=true|false (ALPHA - default=false)
DaemonSetUpdateSurge=true|false (BETA - default=true)
-DefaultPodTopologySpread=true|false (BETA - default=true)
-DelegateFSGroupToCSIDriver=true|false (ALPHA - default=false)
+DelegateFSGroupToCSIDriver=true|false (BETA - default=true)
DevicePlugins=true|false (BETA - default=true)
DisableAcceleratorUsageMetrics=true|false (BETA - default=true)
DisableCloudProviders=true|false (ALPHA - default=false)
-DownwardAPIHugePages=true|false (BETA - default=false)
-EfficientWatchResumption=true|false (BETA - default=true)
+DisableKubeletCloudCredentialProviders=true|false (ALPHA - default=false)
+DownwardAPIHugePages=true|false (BETA - default=true)
EndpointSliceTerminatingCondition=true|false (BETA - default=true)
-EphemeralContainers=true|false (ALPHA - default=false)
-ExpandCSIVolumes=true|false (BETA - default=true)
-ExpandInUsePersistentVolumes=true|false (BETA - default=true)
-ExpandPersistentVolumes=true|false (BETA - default=true)
+EphemeralContainers=true|false (BETA - default=true)
ExpandedDNSConfig=true|false (ALPHA - default=false)
ExperimentalHostUserNamespaceDefaulting=true|false (BETA - default=false)
-GenericEphemeralVolume=true|false (BETA - default=true)
+GRPCContainerProbe=true|false (BETA - default=true)
GracefulNodeShutdown=true|false (BETA - default=true)
+GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - default=true)
HPAContainerMetrics=true|false (ALPHA - default=false)
HPAScaleToZero=true|false (ALPHA - default=false)
-IPv6DualStack=true|false (BETA - default=true)
+HonorPVReclaimPolicy=true|false (ALPHA - default=false)
+IdentifyPodOS=true|false (BETA - default=true)
InTreePluginAWSUnregister=true|false (ALPHA - default=false)
InTreePluginAzureDiskUnregister=true|false (ALPHA - default=false)
InTreePluginAzureFileUnregister=true|false (ALPHA - default=false)
InTreePluginGCEUnregister=true|false (ALPHA - default=false)
InTreePluginOpenStackUnregister=true|false (ALPHA - default=false)
+InTreePluginPortworxUnregister=true|false (ALPHA - default=false)
+InTreePluginRBDUnregister=true|false (ALPHA - default=false)
InTreePluginvSphereUnregister=true|false (ALPHA - default=false)
-IndexedJob=true|false (BETA - default=true)
-IngressClassNamespacedParams=true|false (BETA - default=true)
-JobTrackingWithFinalizers=true|false (ALPHA - default=false)
-KubeletCredentialProviders=true|false (ALPHA - default=false)
+JobMutableNodeSchedulingDirectives=true|false (BETA - default=true)
+JobReadyPods=true|false (BETA - default=true)
+JobTrackingWithFinalizers=true|false (BETA - default=false)
+KubeletCredentialProviders=true|false (BETA - default=true)
KubeletInUserNamespace=true|false (ALPHA - default=false)
KubeletPodResources=true|false (BETA - default=true)
-KubeletPodResourcesGetAllocatable=true|false (ALPHA - default=false)
+KubeletPodResourcesGetAllocatable=true|false (BETA - default=true)
+LegacyServiceAccountTokenNoAutoGeneration=true|false (BETA - default=true)
LocalStorageCapacityIsolation=true|false (BETA - default=true)
LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (ALPHA - default=false)
LogarithmicScaleDown=true|false (BETA - default=true)
+MaxUnavailableStatefulSet=true|false (ALPHA - default=false)
MemoryManager=true|false (BETA - default=true)
MemoryQoS=true|false (ALPHA - default=false)
-MixedProtocolLBService=true|false (ALPHA - default=false)
+MinDomainsInPodTopologySpread=true|false (ALPHA - default=false)
+MixedProtocolLBService=true|false (BETA - default=true)
NetworkPolicyEndPort=true|false (BETA - default=true)
+NetworkPolicyStatus=true|false (ALPHA - default=false)
+NodeOutOfServiceVolumeDetach=true|false (ALPHA - default=false)
NodeSwap=true|false (ALPHA - default=false)
-NonPreemptingPriority=true|false (BETA - default=true)
-PodAffinityNamespaceSelector=true|false (BETA - default=true)
+OpenAPIEnums=true|false (BETA - default=true)
+OpenAPIV3=true|false (BETA - default=true)
+PodAndContainerStatsFromCRI=true|false (ALPHA - default=false)
PodDeletionCost=true|false (BETA - default=true)
-PodOverhead=true|false (BETA - default=true)
-PodSecurity=true|false (ALPHA - default=false)
-PreferNominatedNode=true|false (BETA - default=true)
+PodSecurity=true|false (BETA - default=true)
ProbeTerminationGracePeriod=true|false (BETA - default=false)
ProcMountType=true|false (ALPHA - default=false)
ProxyTerminatingEndpoints=true|false (ALPHA - default=false)
QOSReserved=true|false (ALPHA - default=false)
ReadWriteOncePod=true|false (ALPHA - default=false)
+RecoverVolumeExpansionFailure=true|false (ALPHA - default=false)
RemainingItemCount=true|false (BETA - default=true)
-RemoveSelfLink=true|false (BETA - default=true)
RotateKubeletServerCertificate=true|false (BETA - default=true)
SeccompDefault=true|false (ALPHA - default=false)
+ServerSideFieldValidation=true|false (ALPHA - default=false)
+ServiceIPStaticSubrange=true|false (ALPHA - default=false)
ServiceInternalTrafficPolicy=true|false (BETA - default=true)
-ServiceLBNodePortControl=true|false (BETA - default=true)
-ServiceLoadBalancerClass=true|false (BETA - default=true)
SizeMemoryBackedVolumes=true|false (BETA - default=true)
-StatefulSetMinReadySeconds=true|false (ALPHA - default=false)
+StatefulSetAutoDeletePVC=true|false (ALPHA - default=false)
+StatefulSetMinReadySeconds=true|false (BETA - default=true)
StorageVersionAPI=true|false (ALPHA - default=false)
StorageVersionHash=true|false (BETA - default=true)
-SuspendJob=true|false (BETA - default=true)
-TTLAfterFinished=true|false (BETA - default=true)
-TopologyAwareHints=true|false (ALPHA - default=false)
+TopologyAwareHints=true|false (BETA - default=true)
TopologyManager=true|false (BETA - default=true)
VolumeCapacityPriority=true|false (ALPHA - default=false)
WinDSR=true|false (ALPHA - default=false)
WinOverlay=true|false (BETA - default=true)
-WindowsHostProcessContainers=true|false (ALPHA - default=false) +WindowsHostProcessContainers=true|false (BETA - default=true) --> 一组 key=value 对,用来描述测试性/试验性功能的特性门控(Feature Gate)。可选项有: APIListChunking=true|false (BETA - 默认值=true)
@@ -963,96 +930,99 @@ APIServerIdentity=true|false (ALPHA - 默认值=false)
APIServerTracing=true|false (ALPHA - 默认值=false)
AllAlpha=true|false (ALPHA - 默认值=false)
AllBeta=true|false (BETA - 默认值=false)
-AnyVolumeDataSource=true|false (ALPHA - 默认值=false)
+AnyVolumeDataSource=true|false (BETA - 默认值=true)
AppArmor=true|false (BETA - 默认值=true)
CPUManager=true|false (BETA - 默认值=true)
-CPUManagerPolicyOptions=true|false (ALPHA - 默认值=false)
+CPUManagerPolicyAlphaOptions=true|false (ALPHA - 默认值=false)
+CPUManagerPolicyBetaOptions=true|false (BETA - 默认值=true)
+CPUManagerPolicyOptions=true|false (BETA - 默认值=true)
CSIInlineVolume=true|false (BETA - 默认值=true)
CSIMigration=true|false (BETA - 默认值=true)
-CSIMigrationAWS=true|false (BETA - 默认值=false)
-CSIMigrationAzureDisk=true|false (BETA - 默认值=false)
-CSIMigrationAzureFile=true|false (BETA - 默认值=false)
-CSIMigrationGCE=true|false (BETA - 默认值=false)
-CSIMigrationOpenStack=true|false (BETA - 默认值=true)
+CSIMigrationAWS=true|false (BETA - 默认值=true)
+CSIMigrationAzureFile=true|false (BETA - 默认值=true)
+CSIMigrationGCE=true|false (BETA - 默认值=true)
+CSIMigrationPortworx=true|false (ALPHA - 默认值=false)
+CSIMigrationRBD=true|false (ALPHA - 默认值=false)
CSIMigrationvSphere=true|false (BETA - 默认值=false)
-CSIStorageCapacity=true|false (BETA - 默认值=true)
-CSIVolumeFSGroupPolicy=true|false (BETA - 默认值=true)
CSIVolumeHealth=true|false (ALPHA - 默认值=false)
-CSRDuration=true|false (BETA - 默认值=true)
-ConfigurableFSGroupPolicy=true|false (BETA - 默认值=true)
-ControllerManagerLeaderMigration=true|false (BETA - 默认值=true)
+ContextualLogging=true|false (ALPHA - 默认值=false)
+CronJobTimeZone=true|false (ALPHA - 默认值=false)
CustomCPUCFSQuotaPeriod=true|false (ALPHA - 默认值=false)
+CustomResourceValidationExpressions=true|false (ALPHA - 默认值=false)
DaemonSetUpdateSurge=true|false (BETA - 默认值=true)
-默认值PodTopologySpread=true|false (BETA - 默认值=true)
-DelegateFSGroupToCSIDriver=true|false (ALPHA - 默认值=false)
+DelegateFSGroupToCSIDriver=true|false (BETA - 默认值=true)
DevicePlugins=true|false (BETA - 默认值=true)
DisableAcceleratorUsageMetrics=true|false (BETA - 默认值=true)
DisableCloudProviders=true|false (ALPHA - 默认值=false)
-DownwardAPIHugePages=true|false (BETA - 默认值=false)
-EfficientWatchResumption=true|false (BETA - 默认值=true)
+DisableKubeletCloudCredentialProviders=true|false (ALPHA - 默认值=false)
+DownwardAPIHugePages=true|false (BETA - 默认值=true)
EndpointSliceTerminatingCondition=true|false (BETA - 默认值=true)
-EphemeralContainers=true|false (ALPHA - 默认值=false)
-ExpandCSIVolumes=true|false (BETA - 默认值=true)
-ExpandInUsePersistentVolumes=true|false (BETA - 默认值=true)
-ExpandPersistentVolumes=true|false (BETA - 默认值=true)
+EphemeralContainers=true|false (BETA - 默认值=true)
ExpandedDNSConfig=true|false (ALPHA - 默认值=false)
-ExperimentalHostUserNamespace默认值ing=true|false (BETA - 默认值=false)
-GenericEphemeralVolume=true|false (BETA - 默认值=true)
+ExperimentalHostUserNamespaceDefaulting=true|false (BETA - 默认值=false)
+GRPCContainerProbe=true|false (BETA - 默认值=true)
GracefulNodeShutdown=true|false (BETA - 默认值=true)
+GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - 默认值=true)
HPAContainerMetrics=true|false (ALPHA - 默认值=false)
HPAScaleToZero=true|false (ALPHA - 默认值=false)
-IPv6DualStack=true|false (BETA - 默认值=true)
+HonorPVReclaimPolicy=true|false (ALPHA - 默认值=false)
+IdentifyPodOS=true|false (BETA - 默认值=true)
InTreePluginAWSUnregister=true|false (ALPHA - 默认值=false)
InTreePluginAzureDiskUnregister=true|false (ALPHA - 默认值=false)
InTreePluginAzureFileUnregister=true|false (ALPHA - 默认值=false)
InTreePluginGCEUnregister=true|false (ALPHA - 默认值=false)
InTreePluginOpenStackUnregister=true|false (ALPHA - 默认值=false)
+InTreePluginPortworxUnregister=true|false (ALPHA - 默认值=false)
+InTreePluginRBDUnregister=true|false (ALPHA - 默认值=false)
InTreePluginvSphereUnregister=true|false (ALPHA - 默认值=false)
-IndexedJob=true|false (BETA - 默认值=true)
-IngressClassNamespacedParams=true|false (BETA - 默认值=true)
-JobTrackingWithFinalizers=true|false (ALPHA - 默认值=false)
-KubeletCredentialProviders=true|false (ALPHA - 默认值=false)
+JobMutableNodeSchedulingDirectives=true|false (BETA - 默认值=true)
+JobReadyPods=true|false (BETA - 默认值=true)
+JobTrackingWithFinalizers=true|false (BETA - 默认值=false)
+KubeletCredentialProviders=true|false (BETA - 默认值=true)
KubeletInUserNamespace=true|false (ALPHA - 默认值=false)
KubeletPodResources=true|false (BETA - 默认值=true)
-KubeletPodResourcesGetAllocatable=true|false (ALPHA - 默认值=false)
+KubeletPodResourcesGetAllocatable=true|false (BETA - 默认值=true)
+LegacyServiceAccountTokenNoAutoGeneration=true|false (BETA - 默认值=true)
LocalStorageCapacityIsolation=true|false (BETA - 默认值=true)
LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (ALPHA - 默认值=false)
LogarithmicScaleDown=true|false (BETA - 默认值=true)
+MaxUnavailableStatefulSet=true|false (ALPHA - 默认值=false)
MemoryManager=true|false (BETA - 默认值=true)
MemoryQoS=true|false (ALPHA - 默认值=false)
-MixedProtocolLBService=true|false (ALPHA - 默认值=false)
+MinDomainsInPodTopologySpread=true|false (ALPHA - 默认值=false)
+MixedProtocolLBService=true|false (BETA - 默认值=true)
NetworkPolicyEndPort=true|false (BETA - 默认值=true)
+NetworkPolicyStatus=true|false (ALPHA - 默认值=false)
+NodeOutOfServiceVolumeDetach=true|false (ALPHA - 默认值=false)
NodeSwap=true|false (ALPHA - 默认值=false)
-NonPreemptingPriority=true|false (BETA - 默认值=true)
-PodAffinityNamespaceSelector=true|false (BETA - 默认值=true)
+OpenAPIEnums=true|false (BETA - 默认值=true)
+OpenAPIV3=true|false (BETA - 默认值=true)
+PodAndContainerStatsFromCRI=true|false (ALPHA - 默认值=false)
PodDeletionCost=true|false (BETA - 默认值=true)
-PodOverhead=true|false (BETA - 默认值=true)
-PodSecurity=true|false (ALPHA - 默认值=false)
-PreferNominatedNode=true|false (BETA - 默认值=true)
+PodSecurity=true|false (BETA - 默认值=true)
ProbeTerminationGracePeriod=true|false (BETA - 默认值=false)
ProcMountType=true|false (ALPHA - 默认值=false)
ProxyTerminatingEndpoints=true|false (ALPHA - 默认值=false)
QOSReserved=true|false (ALPHA - 默认值=false)
ReadWriteOncePod=true|false (ALPHA - 默认值=false)
+RecoverVolumeExpansionFailure=true|false (ALPHA - 默认值=false)
RemainingItemCount=true|false (BETA - 默认值=true)
-RemoveSelfLink=true|false (BETA - 默认值=true)
RotateKubeletServerCertificate=true|false (BETA - 默认值=true)
-Seccomp默认值=true|false (ALPHA - 默认值=false)
+SeccompDefault=true|false (ALPHA - 默认值=false)
+ServerSideFieldValidation=true|false (ALPHA - 默认值=false)
+ServiceIPStaticSubrange=true|false (ALPHA - 默认值=false)
ServiceInternalTrafficPolicy=true|false (BETA - 默认值=true)
-ServiceLBNodePortControl=true|false (BETA - 默认值=true)
-ServiceLoadBalancerClass=true|false (BETA - 默认值=true)
SizeMemoryBackedVolumes=true|false (BETA - 默认值=true)
-StatefulSetMinReadySeconds=true|false (ALPHA - 默认值=false)
+StatefulSetAutoDeletePVC=true|false (ALPHA - 默认值=false)
+StatefulSetMinReadySeconds=true|false (BETA - 默认值=true)
StorageVersionAPI=true|false (ALPHA - 默认值=false)
StorageVersionHash=true|false (BETA - 默认值=true)
-SuspendJob=true|false (BETA - 默认值=true)
-TTLAfterFinished=true|false (BETA - 默认值=true)
-TopologyAwareHints=true|false (ALPHA - 默认值=false)
+TopologyAwareHints=true|false (BETA - 默认值=true)
TopologyManager=true|false (BETA - 默认值=true)
VolumeCapacityPriority=true|false (ALPHA - 默认值=false)
WinDSR=true|false (ALPHA - 默认值=false)
WinOverlay=true|false (BETA - 默认值=true)
-WindowsHostProcessContainers=true|false (ALPHA - 默认值=false) +WindowsHostProcessContainers=true|false (BETA - 默认值=true)

@@ -1181,7 +1151,7 @@ Content type of requests sent to apiserver. ---kube-api-qps float32     默认值:20 +--kube-api-qps float     默认值:20 @@ -1267,10 +1237,10 @@ The interval between attempts by the acting master to renew a leadership slot be -在领导者选举期间用于锁定的资源对象的类型。 支持的选项为 "endpoints"、 -"configmaps"、"leases"、"endpointsleases" 和 "configmapsleases"。 +在领导者选举期间用于锁定的资源对象的类型。 支持的选项为 +"leases"、"endpointsleases" 和 "configmapsleases"。 @@ -1326,56 +1296,6 @@ Path to the config file for controller leader migration, or empty to use the val

- - ---log-backtrace-at traceLocation     默认值::0 - - - - -当执行到 file:N 所给的文件和代码行时,日志机制会生成一个调用栈快照。 - - - - ---log-dir string - - - - -此标志为非空字符串时,日志文件会写入到所给的目录中。 - - - - ---log-file string - - - - -此标志为非空字符串时,意味着日志会写入到所给的文件中。 - - - - ---log-file-max-size uint     默认值:1800 - - - - -定义日志文件大小的上限。单位是兆字节(MB)。 -若此值为 0,则不对日志文件尺寸进行约束。 - - - --log-flush-frequency duration     默认值:5s @@ -1394,31 +1314,19 @@ Maximum number of seconds between log flushes -设置日志格式。允许的格式:"text"。 +设置日志格式。允许的格式:"text"。
非默认格式不支持以下标志:--add-dir-header、 ---alsologtostderr》、--log-backtrace-at、 +--alsologtostderr--log-backtrace-at--log-dir--log-file--log-file-max-size--logtostderr--one-output--skip-headers--skip-log-headers--stderrthreshold、 ---vmodule--log-flush-frequency。 +--vmodule
当前非默认选项为 Alpha 阶段,如有更改,恕不另行通知。 - ---logtostderr     默认值:true - - - - -将日志写出到标准错误输出(stderr)而不是写入到日志文件。 - - - --master string @@ -1492,10 +1400,10 @@ EndpointSlice 更改的处理将延迟此持续时间, EndpointSliceMirroring 控制器将添加到 EndpointSlice 的最大端点数。 -每个分片的端点越多,端点分片越少,但资源越大。 +每个分片的端点越多,端点分片越少,但资源越大。默认为 100。 @@ -1548,7 +1456,7 @@ Mask size for IPv6 node cidr in dual-stack cluster. Default is 64. ---node-eviction-rate float32     默认值:0.1 +--node-eviction-rate float     默认值:0.1 @@ -1601,29 +1509,17 @@ Amount of time which we allow starting Node to be unresponsive before marking it - ---one-output - - - - -如果此标志为 true,则仅将日志写入其自身的严重性级别(而不是同时写入更低的严重性级别中)。 - - - --permit-address-sharing

如果此标志为 true,则在绑定端口时使用 SO_REUSEADDR。 这就意味着可以同时绑定到 0.0.0.0 和特定的 IP 地址, -并且避免等待内核释放处于 TIME_WAITE 状态的套接字。 +并且避免等待内核释放处于 TIME_WAITE 状态的套接字。[默认值=false]。

@@ -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 供服务器使用的加密包的逗号分隔列表。若忽略此标志,则使用 Go 语言默认的加密包。
-可选值包括:TLS_AES_128_GCM_SHA256、TLS_AES_256_GCM_SHA384、TLS_CHACHA20_POLY1305_SHA256、TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA、TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256、TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA、TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384、TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305、TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256、TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA、TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA、TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256、TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA、TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384、TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305、TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256、TLS_RSA_WITH_3DES_EDE_CBC_SHA、TLS_RSA_WITH_AES_128_CBC_SHA、TLS_RSA_WITH_AES_128_GCM_SHA256、TLS_RSA_WITH_AES_256_CBC_SHA、TLS_RSA_WITH_AES_256_GCM_SHA384. -
不安全的值: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256、TLS_ECDHE_ECDSA_WITH_RC4_128_SHA、TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256、TLS_ECDHE_RSA_WITH_RC4_128_SHA、TLS_RSA_WITH_AES_128_CBC_SHA256、TLS_RSA_WITH_RC4_128_SHA +可选值包括:TLS_AES_128_GCM_SHA256、TLS_AES_256_GCM_SHA384、TLS_CHACHA20_POLY1305_SHA256、TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA、TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256、TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA、TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384、TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305、TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256、TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA、TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256、TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA、TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384、TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305、TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256、TLS_RSA_WITH_AES_128_CBC_SHA、TLS_RSA_WITH_AES_128_GCM_SHA256、TLS_RSA_WITH_AES_256_CBC_SHA、TLS_RSA_WITH_AES_256_GCM_SHA384。 +
不安全的值: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256、TLS_ECDHE_ECDSA_WITH_RC4_128_SHA、TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA、TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256、TLS_ECDHE_RSA_WITH_RC4_128_SHA、TLS_RSA_WITH_3DES_EDE_CBC_SHA、TLS_RSA_WITH_AES_128_CBC_SHA256、TLS_RSA_WITH_RC4_128_SHA。 @@ -2026,12 +1887,12 @@ File containing the default x509 private key matching --tls-cert-file. ---tls-sni-cert-key namedCertKey     默认值:[] +--tls-sni-cert-key string X509 证书和私钥文件路径的耦对。作为可选项,可以添加域名模式的列表, 其中每个域名模式都是可以带通配片段前缀的全限定域名(FQDN)。 @@ -2092,14 +1953,14 @@ Print version information and quit ---vmodule <逗号分隔的 'pattern=N' 配置值> +--vmodule pattern=N,... -由逗号分隔的列表,每一项都是 pattern=N 格式,用来执行根据文件过滤的日志行为。 +由逗号分隔的列表,每一项都是 pattern=N 格式,用来执行根据文件过滤的日志行为(仅适用于 text 日志格式)。 diff --git a/content/zh/docs/reference/command-line-tools-reference/kube-proxy.md b/content/zh/docs/reference/command-line-tools-reference/kube-proxy.md index 0eff062d25..2cb541d830 100644 --- a/content/zh/docs/reference/command-line-tools-reference/kube-proxy.md +++ b/content/zh/docs/reference/command-line-tools-reference/kube-proxy.md @@ -53,30 +53,6 @@ kube-proxy [flags] - ---add-dir-header - - -

- -若此标志为 true,则将文件目录添加到日志消息的头部。 -

- - - ---alsologtostderr - - -

- -将日志输出到文件时也输出到标准错误输出(stderr)。 -

- - --azure-container-registry-config string @@ -96,10 +72,11 @@ Path to the file containing Azure container registry configuration information.

代理服务器要使用的 IP 地址(设置为 '0.0.0.0' 表示要使用所有 IPv4 接口; 设置为 '::' 表示使用所有 IPv6 接口)。 +如果配置文件由 --config 指定,则忽略此参数。

@@ -142,17 +119,44 @@ If true cleanup iptables and ipvs rules and exit. + +--cloud-provider-gce-l7lb-src-cidrs cidrs     默认值:130.211.0.0/22,35.191.0.0/16 + + + + +此值表示,在 GCE 防火墙中打开 CIDRs 用于 L7 LB 流量代理 & 健康检查。 + + + + +--cloud-provider-gce-lb-src-cidrs cidrs     默认值:130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16 + + + + +此值表示,在 GCE 防火墙中打开 CIDRs 用于 L4 LB 流量代理 & 健康检查。 + + + --cluster-cidr string

集群中 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 中。 + + + --detect-local-mode LocalMode

- + 用于检测本地流量的模式。 +如果配置文件由 --config 指定,则忽略此参数。

@@ -264,96 +297,100 @@ APIServerIdentity=true|false (ALPHA - default=false)
APIServerTracing=true|false (ALPHA - default=false)
AllAlpha=true|false (ALPHA - default=false)
AllBeta=true|false (BETA - default=false)
-AnyVolumeDataSource=true|false (ALPHA - default=false)
+AnyVolumeDataSource=true|false (BETA - default=true)
AppArmor=true|false (BETA - default=true)
CPUManager=true|false (BETA - default=true)
-CPUManagerPolicyOptions=true|false (ALPHA - default=false)
+CPUManagerPolicyAlphaOptions=true|false (ALPHA - default=false)
+CPUManagerPolicyBetaOptions=true|false (BETA - default=true)
+CPUManagerPolicyOptions=true|false (BETA - default=true)
CSIInlineVolume=true|false (BETA - default=true)
CSIMigration=true|false (BETA - default=true)
-CSIMigrationAWS=true|false (BETA - default=false)
-CSIMigrationAzureDisk=true|false (BETA - default=false)
-CSIMigrationAzureFile=true|false (BETA - default=false)
-CSIMigrationGCE=true|false (BETA - default=false)
-CSIMigrationOpenStack=true|false (BETA - default=true)
+CSIMigrationAWS=true|false (BETA - default=true)
+CSIMigrationAzureFile=true|false (BETA - default=true)
+CSIMigrationGCE=true|false (BETA - default=true)
+CSIMigrationPortworx=true|false (ALPHA - default=false)
+CSIMigrationRBD=true|false (ALPHA - default=false)
CSIMigrationvSphere=true|false (BETA - default=false)
-CSIStorageCapacity=true|false (BETA - default=true)
-CSIVolumeFSGroupPolicy=true|false (BETA - default=true)
CSIVolumeHealth=true|false (ALPHA - default=false)
-CSRDuration=true|false (BETA - default=true)
-ConfigurableFSGroupPolicy=true|false (BETA - default=true)
-ControllerManagerLeaderMigration=true|false (BETA - default=true)
+ContextualLogging=true|false (ALPHA - default=false)
+CronJobTimeZone=true|false (ALPHA - default=false)
CustomCPUCFSQuotaPeriod=true|false (ALPHA - default=false)
+CustomResourceValidationExpressions=true|false (ALPHA - default=false)
DaemonSetUpdateSurge=true|false (BETA - default=true)
-DefaultPodTopologySpread=true|false (BETA - default=true)
-DelegateFSGroupToCSIDriver=true|false (ALPHA - default=false)
+DelegateFSGroupToCSIDriver=true|false (BETA - default=true)
DevicePlugins=true|false (BETA - default=true)
DisableAcceleratorUsageMetrics=true|false (BETA - default=true)
DisableCloudProviders=true|false (ALPHA - default=false)
-DownwardAPIHugePages=true|false (BETA - default=false)
-EfficientWatchResumption=true|false (BETA - default=true)
+DisableKubeletCloudCredentialProviders=true|false (ALPHA - default=false)
+DownwardAPIHugePages=true|false (BETA - default=true)
EndpointSliceTerminatingCondition=true|false (BETA - default=true)
-EphemeralContainers=true|false (ALPHA - default=false)
-ExpandCSIVolumes=true|false (BETA - default=true)
-ExpandInUsePersistentVolumes=true|false (BETA - default=true)
-ExpandPersistentVolumes=true|false (BETA - default=true)
+EphemeralContainers=true|false (BETA - default=true)
ExpandedDNSConfig=true|false (ALPHA - default=false)
ExperimentalHostUserNamespaceDefaulting=true|false (BETA - default=false)
-GenericEphemeralVolume=true|false (BETA - default=true)
+GRPCContainerProbe=true|false (BETA - default=true)
GracefulNodeShutdown=true|false (BETA - default=true)
+GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - default=true)
HPAContainerMetrics=true|false (ALPHA - default=false)
HPAScaleToZero=true|false (ALPHA - default=false)
-IPv6DualStack=true|false (BETA - default=true)
+HonorPVReclaimPolicy=true|false (ALPHA - default=false)
+IdentifyPodOS=true|false (BETA - default=true)
InTreePluginAWSUnregister=true|false (ALPHA - default=false)
InTreePluginAzureDiskUnregister=true|false (ALPHA - default=false)
InTreePluginAzureFileUnregister=true|false (ALPHA - default=false)
InTreePluginGCEUnregister=true|false (ALPHA - default=false)
InTreePluginOpenStackUnregister=true|false (ALPHA - default=false)
+InTreePluginPortworxUnregister=true|false (ALPHA - default=false)
+InTreePluginRBDUnregister=true|false (ALPHA - default=false)
InTreePluginvSphereUnregister=true|false (ALPHA - default=false)
-IndexedJob=true|false (BETA - default=true)
-IngressClassNamespacedParams=true|false (BETA - default=true)
-JobTrackingWithFinalizers=true|false (ALPHA - default=false)
-KubeletCredentialProviders=true|false (ALPHA - default=false)
+JobMutableNodeSchedulingDirectives=true|false (BETA - default=true)
+JobReadyPods=true|false (BETA - default=true)
+JobTrackingWithFinalizers=true|false (BETA - default=false)
+KubeletCredentialProviders=true|false (BETA - default=true)
KubeletInUserNamespace=true|false (ALPHA - default=false)
KubeletPodResources=true|false (BETA - default=true)
-KubeletPodResourcesGetAllocatable=true|false (ALPHA - default=false)
+KubeletPodResourcesGetAllocatable=true|false (BETA - default=true)
+LegacyServiceAccountTokenNoAutoGeneration=true|false (BETA - default=true)
LocalStorageCapacityIsolation=true|false (BETA - default=true)
LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (ALPHA - default=false)
LogarithmicScaleDown=true|false (BETA - default=true)
+MaxUnavailableStatefulSet=true|false (ALPHA - default=false)
MemoryManager=true|false (BETA - default=true)
MemoryQoS=true|false (ALPHA - default=false)
-MixedProtocolLBService=true|false (ALPHA - default=false)
+MinDomainsInPodTopologySpread=true|false (ALPHA - default=false)
+MixedProtocolLBService=true|false (BETA - default=true)
NetworkPolicyEndPort=true|false (BETA - default=true)
+NetworkPolicyStatus=true|false (ALPHA - default=false)
+NodeOutOfServiceVolumeDetach=true|false (ALPHA - default=false)
NodeSwap=true|false (ALPHA - default=false)
-NonPreemptingPriority=true|false (BETA - default=true)
-PodAffinityNamespaceSelector=true|false (BETA - default=true)
+OpenAPIEnums=true|false (BETA - default=true)
+OpenAPIV3=true|false (BETA - default=true)
+PodAndContainerStatsFromCRI=true|false (ALPHA - default=false)
PodDeletionCost=true|false (BETA - default=true)
-PodOverhead=true|false (BETA - default=true)
-PodSecurity=true|false (ALPHA - default=false)
-PreferNominatedNode=true|false (BETA - default=true)
+PodSecurity=true|false (BETA - default=true)
ProbeTerminationGracePeriod=true|false (BETA - default=false)
ProcMountType=true|false (ALPHA - default=false)
ProxyTerminatingEndpoints=true|false (ALPHA - default=false)
QOSReserved=true|false (ALPHA - default=false)
ReadWriteOncePod=true|false (ALPHA - default=false)
+RecoverVolumeExpansionFailure=true|false (ALPHA - default=false)
RemainingItemCount=true|false (BETA - default=true)
-RemoveSelfLink=true|false (BETA - default=true)
RotateKubeletServerCertificate=true|false (BETA - default=true)
SeccompDefault=true|false (ALPHA - default=false)
+ServerSideFieldValidation=true|false (ALPHA - default=false)
+ServiceIPStaticSubrange=true|false (ALPHA - default=false)
ServiceInternalTrafficPolicy=true|false (BETA - default=true)
-ServiceLBNodePortControl=true|false (BETA - default=true)
-ServiceLoadBalancerClass=true|false (BETA - default=true)
1 SizeMemoryBackedVolumes=true|false (BETA - default=true)
-StatefulSetMinReadySeconds=true|false (ALPHA - default=false)
+StatefulSetAutoDeletePVC=true|false (ALPHA - default=false)
+StatefulSetMinReadySeconds=true|false (BETA - default=true)
StorageVersionAPI=true|false (ALPHA - default=false)
StorageVersionHash=true|false (BETA - default=true)
-SuspendJob=true|false (BETA - default=true)
-TTLAfterFinished=true|false (BETA - default=true)
-TopologyAwareHints=true|false (ALPHA - default=false)
+TopologyAwareHints=true|false (BETA - default=true)
TopologyManager=true|false (BETA - default=true)
VolumeCapacityPriority=true|false (ALPHA - default=false)
WinDSR=true|false (ALPHA - default=false)
WinOverlay=true|false (BETA - default=true)
-WindowsHostProcessContainers=true|false (ALPHA - default=false) +WindowsHostProcessContainers=true|false (BETA - default=true) +This parameter is ignored if a config file is specified by --config. --> 一组键=值(key=value)对,描述了 alpha/experimental 的特征。可选项有: APIListChunking=true|false (BETA - 默认值=true)
@@ -363,96 +400,100 @@ APIServerIdentity=true|false (ALPHA - 默认值=false)
APIServerTracing=true|false (ALPHA - 默认值=false)
AllAlpha=true|false (ALPHA - 默认值=false)
AllBeta=true|false (BETA - 默认值=false)
-AnyVolumeDataSource=true|false (ALPHA - 默认值=false)
+AnyVolumeDataSource=true|false (BETA - 默认值=true)
AppArmor=true|false (BETA - 默认值=true)
CPUManager=true|false (BETA - 默认值=true)
-CPUManagerPolicyOptions=true|false (ALPHA - 默认值=false)
+CPUManagerPolicyAlphaOptions=true|false (ALPHA - 默认值=false)
+CPUManagerPolicyBetaOptions=true|false (BETA - 默认值=true)
+CPUManagerPolicyOptions=true|false (BETA - 默认值=true)
CSIInlineVolume=true|false (BETA - 默认值=true)
CSIMigration=true|false (BETA - 默认值=true)
-CSIMigrationAWS=true|false (BETA - 默认值=false)
-CSIMigrationAzureDisk=true|false (BETA - 默认值=false)
-CSIMigrationAzureFile=true|false (BETA - 默认值=false)
-CSIMigrationGCE=true|false (BETA - 默认值=false)
-CSIMigrationOpenStack=true|false (BETA - 默认值=true)
+CSIMigrationAWS=true|false (BETA - 默认值=true)
+CSIMigrationAzureFile=true|false (BETA - 默认值=true)
+CSIMigrationGCE=true|false (BETA - 默认值=true)
+CSIMigrationPortworx=true|false (ALPHA - 默认值=false)
+CSIMigrationRBD=true|false (ALPHA - 默认值=false)
CSIMigrationvSphere=true|false (BETA - 默认值=false)
-CSIStorageCapacity=true|false (BETA - 默认值=true)
-CSIVolumeFSGroupPolicy=true|false (BETA - 默认值=true)
CSIVolumeHealth=true|false (ALPHA - 默认值=false)
-CSRDuration=true|false (BETA - 默认值=true)
-ConfigurableFSGroupPolicy=true|false (BETA - 默认值=true)
-ControllerManagerLeaderMigration=true|false (BETA - 默认值=true)
+ContextualLogging=true|false (ALPHA - 默认值=false)
+CronJobTimeZone=true|false (ALPHA - 默认值=false)
CustomCPUCFSQuotaPeriod=true|false (ALPHA - 默认值=false)
+CustomResourceValidationExpressions=true|false (ALPHA - 默认值=false)
DaemonSetUpdateSurge=true|false (BETA - 默认值=true)
-DefaultPodTopologySpread=true|false (BETA - 默认值=true)
-DelegateFSGroupToCSIDriver=true|false (ALPHA - 默认值=false)
+DelegateFSGroupToCSIDriver=true|false (BETA - 默认值=true)
DevicePlugins=true|false (BETA - 默认值=true)
DisableAcceleratorUsageMetrics=true|false (BETA - 默认值=true)
DisableCloudProviders=true|false (ALPHA - 默认值=false)
-DownwardAPIHugePages=true|false (BETA - 默认值=false)
-EfficientWatchResumption=true|false (BETA - 默认值=true)
+DisableKubeletCloudCredentialProviders=true|false (ALPHA - 默认值=false)
+DownwardAPIHugePages=true|false (BETA - 默认值=true)
EndpointSliceTerminatingCondition=true|false (BETA - 默认值=true)
-EphemeralContainers=true|false (ALPHA - 默认值=false)
-ExpandCSIVolumes=true|false (BETA - 默认值=true)
-ExpandInUsePersistentVolumes=true|false (BETA - 默认值=true)
-ExpandPersistentVolumes=true|false (BETA - 默认值=true)
+EphemeralContainers=true|false (BETA - 默认值=true)
ExpandedDNSConfig=true|false (ALPHA - 默认值=false)
ExperimentalHostUserNamespaceDefaulting=true|false (BETA - 默认值=false)
-GenericEphemeralVolume=true|false (BETA - 默认值=true)
+GRPCContainerProbe=true|false (BETA - 默认值=true)
GracefulNodeShutdown=true|false (BETA - 默认值=true)
+GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - 默认值=true)
HPAContainerMetrics=true|false (ALPHA - 默认值=false)
HPAScaleToZero=true|false (ALPHA - 默认值=false)
-IPv6DualStack=true|false (BETA - 默认值=true)
+HonorPVReclaimPolicy=true|false (ALPHA - 默认值=false)
+IdentifyPodOS=true|false (BETA - 默认值=true)
InTreePluginAWSUnregister=true|false (ALPHA - 默认值=false)
InTreePluginAzureDiskUnregister=true|false (ALPHA - 默认值=false)
InTreePluginAzureFileUnregister=true|false (ALPHA - 默认值=false)
InTreePluginGCEUnregister=true|false (ALPHA - 默认值=false)
InTreePluginOpenStackUnregister=true|false (ALPHA - 默认值=false)
+InTreePluginPortworxUnregister=true|false (ALPHA - 默认值=false)
+InTreePluginRBDUnregister=true|false (ALPHA - 默认值=false)
InTreePluginvSphereUnregister=true|false (ALPHA - 默认值=false)
-IndexedJob=true|false (BETA - 默认值=true)
-IngressClassNamespacedParams=true|false (BETA - 默认值=true)
-JobTrackingWithFinalizers=true|false (ALPHA - 默认值=false)
-KubeletCredentialProviders=true|false (ALPHA - 默认值=false)
+JobMutableNodeSchedulingDirectives=true|false (BETA - 默认值=true)
+JobReadyPods=true|false (BETA - 默认值=true)
+JobTrackingWithFinalizers=true|false (BETA - 默认值=false)
+KubeletCredentialProviders=true|false (BETA - 默认值=true)
KubeletInUserNamespace=true|false (ALPHA - 默认值=false)
KubeletPodResources=true|false (BETA - 默认值=true)
-KubeletPodResourcesGetAllocatable=true|false (ALPHA - 默认值=false)
+KubeletPodResourcesGetAllocatable=true|false (BETA - 默认值=true)
+LegacyServiceAccountTokenNoAutoGeneration=true|false (BETA - 默认值=true)
LocalStorageCapacityIsolation=true|false (BETA - 默认值=true)
LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (ALPHA - 默认值=false)
LogarithmicScaleDown=true|false (BETA - 默认值=true)
+MaxUnavailableStatefulSet=true|false (ALPHA - 默认值=false)
MemoryManager=true|false (BETA - 默认值=true)
MemoryQoS=true|false (ALPHA - 默认值=false)
-MixedProtocolLBService=true|false (ALPHA - 默认值=false)
+MinDomainsInPodTopologySpread=true|false (ALPHA - 默认值=false)
+MixedProtocolLBService=true|false (BETA - 默认值=true)
NetworkPolicyEndPort=true|false (BETA - 默认值=true)
+NetworkPolicyStatus=true|false (ALPHA - 默认值=false)
+NodeOutOfServiceVolumeDetach=true|false (ALPHA - 默认值=false)
NodeSwap=true|false (ALPHA - 默认值=false)
-NonPreemptingPriority=true|false (BETA - 默认值=true)
-PodAffinityNamespaceSelector=true|false (BETA - 默认值=true)
+OpenAPIEnums=true|false (BETA - 默认值=true)
+OpenAPIV3=true|false (BETA - 默认值=true)
+PodAndContainerStatsFromCRI=true|false (ALPHA - 默认值=false)
PodDeletionCost=true|false (BETA - 默认值=true)
-PodOverhead=true|false (BETA - 默认值=true)
-PodSecurity=true|false (ALPHA - 默认值=false)
-PreferNominatedNode=true|false (BETA - 默认值=true)
+PodSecurity=true|false (BETA - 默认值=true)
ProbeTerminationGracePeriod=true|false (BETA - 默认值=false)
ProcMountType=true|false (ALPHA - 默认值=false)
ProxyTerminatingEndpoints=true|false (ALPHA - 默认值=false)
QOSReserved=true|false (ALPHA - 默认值=false)
ReadWriteOncePod=true|false (ALPHA - 默认值=false)
+RecoverVolumeExpansionFailure=true|false (ALPHA - 默认值=false)
RemainingItemCount=true|false (BETA - 默认值=true)
-RemoveSelfLink=true|false (BETA - 默认值=true)
RotateKubeletServerCertificate=true|false (BETA - 默认值=true)
SeccompDefault=true|false (ALPHA - 默认值=false)
+ServerSideFieldValidation=true|false (ALPHA - 默认值=false)
+ServiceIPStaticSubrange=true|false (ALPHA - 默认值=false)
ServiceInternalTrafficPolicy=true|false (BETA - 默认值=true)
-ServiceLBNodePortControl=true|false (BETA - 默认值=true)
-ServiceLoadBalancerClass=true|false (BETA - 默认值=true)
SizeMemoryBackedVolumes=true|false (BETA - 默认值=true)
-StatefulSetMinReadySeconds=true|false (ALPHA - 默认值=false)
+StatefulSetAutoDeletePVC=true|false (ALPHA - 默认值=false)
+StatefulSetMinReadySeconds=true|false (BETA - 默认值=true)
StorageVersionAPI=true|false (ALPHA - 默认值=false)
StorageVersionHash=true|false (BETA - 默认值=true)
-SuspendJob=true|false (BETA - 默认值=true)
-TTLAfterFinished=true|false (BETA - 默认值=true)
-TopologyAwareHints=true|false (ALPHA - 默认值=false)
+TopologyAwareHints=true|false (BETA - 默认值=true)
TopologyManager=true|false (BETA - 默认值=true)
VolumeCapacityPriority=true|false (ALPHA - 默认值=false)
WinDSR=true|false (ALPHA - 默认值=false)
WinOverlay=true|false (BETA - 默认值=true)
-WindowsHostProcessContainers=true|false (ALPHA - 默认值=false) +WindowsHostProcessContainers=true|false (BETA - 默认值=true) +如果配置文件由 --config 指定,则忽略此参数。

@@ -463,13 +504,12 @@ WindowsHostProcessContainers=true|false (ALPHA - 默认值=false)

服务健康状态检查的 IP 地址和端口(设置为 '0.0.0.0:10256' 表示使用所有 IPv4 接口,设置为 '[::]:10256' 表示使用所有 IPv6 接口); 设置为空则禁用。 +如果配置文件由 --config 指定,则忽略此参数。

@@ -698,71 +738,6 @@ Path to kubeconfig file with authorization information (the master location is s - ---log-backtrace-at <形式为 'file:N' 的字符串>     Default: :0 - - -

- -当日志逻辑执行到文件 file 的第 N 行时,输出调用堆栈跟踪。 -

- - - - ---log-dir string - - -

- -若此标志费控,则将日志文件写入到此标志所给的目录下。 -

- - - - ---log-file string - - -

- -若此标志非空,则该字符串作为日志文件名。 -

- - - ---log-file-max-size uint     默认值:1800 - - -

- -定义日志文件可增长到的最大尺寸。单位是兆字节(MB)。 -如果此值为 0,则最大文件大小无限制。 -

- - - - ---log-flush-frequency duration     默认值:5s - - - - - -两次日志刷新之间的最大秒数。 - - - --machine-id-file string     默认值:"/etc/machine-id,/var/lib/dbus/machine-id" @@ -776,6 +751,19 @@ Comma-separated list of files to check for machine-id. Use the first one that ex

+ +--machine_id_file string     默认值:"/etc/machine-id,/var/lib/dbus/machine-id" + + +

+ +用来检查 Machine-ID 的文件列表,用逗号分隔。 +使用找到的第一个文件。 +

+ + --masquerade-all @@ -809,13 +797,12 @@ Kubernetes API 服务器的地址(覆盖 kubeconfig 中的相关值)。

metrics 服务器要使用的 IP 地址和端口 (设置为 '0.0.0.0:10249' 则使用所有 IPv4 接口,设置为 '[::]:10249' 则使用所有 IPv6 接口) 设置为空则禁用。 +如果配置文件由 --config 指定,则忽略此参数。

@@ -826,66 +813,84 @@ metrics 服务器要使用的 IP 地址和端口

一个字符串值,指定用于 NodePort 服务的地址。 值可以是有效的 IP 块(例如 1.2.3.0/24, 1.2.3.4/32)。 默认的空字符串切片([])表示使用所有本地地址。 +如果配置文件由 --config 指定,则忽略此参数。

- ---one-output - - -

- -若此标志为 true,则仅将日志写入到其原本的严重性级别之下 -(而不是将其写入到所有更低严重性级别中)。 -

- - --oom-score-adj int32     默认值:-999

kube-proxy 进程中的 oom-score-adj 值,必须在 [-1000,1000] 范围内。 +如果配置文件由 --config 指定,则忽略此参数。

+ +--pod-bridge-interface string + + + + +集群中的一个桥接接口名称。 +Kube-proxy 将来自与该值匹配的桥接接口的流量视为本地流量。 +如果 DetectLocalMode 设置为 BridgeInterface,则应设置该参数。 + + + + +--pod-interface-name-prefix string + + + + +集群中的一个接口前缀。 +Kube-proxy 将来自与给定前缀匹配的接口的流量视为本地流量。 +如果 DetectLocalMode 设置为 InterfaceNamePrefix,则应设置该参数。 + + + --profiling

如果为 true,则通过 Web 接口 /debug/pprof 启用性能分析。 +如果配置文件由 --config 指定,则忽略此参数。

---proxy-mode string +--proxy-mode ProxyMode

-使用哪种代理模式:'userspace'(较旧)或 'iptables'(较快)或 'ipvs'。 -如果为空,使用最佳可用代理(当前为 iptables)。 -如果选择了 iptables 代理(无论是否为显式设置),但系统的内核或 -iptables 版本较低,总是会回退到 userspace 代理。 +使用哪种代理模式:'iptables'(仅 Linux)、'ipvs'(仅 Linux)、'kernelspace'(仅 Linux) +或者 'userspace'(Linux/Windows, 已弃用)。 +Linux 系统上的默认值是 'iptables',Windows 系统上的默认值是 'userspace'。 +如果配置文件由 --config 指定,则忽略此参数。

@@ -911,53 +916,18 @@ Range of host ports (beginPort-endPort, single port or beginPort+offset, inclusi

要显示隐藏指标的先前版本。 仅先前的次要版本有意义,不允许其他值。 格式为 <major>.<minor> ,例如:'1.16'。 这种格式的目的是确保你有机会注意到下一个发行版是否隐藏了其他指标, 而不是在之后将其永久删除时感到惊讶。 +如果配置文件由 --config 指定,则忽略此参数。

- ---skip-headers - - -

- -若此标志为 true,则避免在日志消息中包含头部前缀。 -

- - - ---skip-log-headers - - -

- -如果此标志为 true,则避免在打开日志文件时使用头部。 -

- - - ---stderrthreshold int     默认值:2 - - -

- -如果日志消息处于或者高于此阈值所设置的级别,则将其输出到标准错误输出(stderr)。 -

- - --udp-timeout duration     默认值:250ms @@ -972,18 +942,6 @@ How long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be - --v, --v int - - -

- -用来设置日志详细程度的数值。 -

- - --version version[=true] @@ -997,19 +955,6 @@ Print version information and quit - ---vmodule <逗号分隔的 'pattern=N' 设置’> - - -

- -用逗号分隔的列表,其中每一项为 'pattern=N' 格式。 -用来支持基于文件过滤的日志机制。 -

- - --write-config-to string 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.

+ + + + + + + + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
imagepolicy.k8s.io/v1alpha1
kind
string
ImageReview
metadata
+meta/v1.ObjectMeta +
+

Standard object's metadata. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

+Refer to the Kubernetes API documentation for the fields of the metadata field.
spec [Required]
+ImageReviewSpec +
+

Spec holds information about the pod being evaluated

+
status
+ImageReviewStatus +
+

Status is filled in by the backend and indicates whether the pod should be allowed.

+
+ +## `ImageReviewContainerSpec` {#imagepolicy-k8s-io-v1alpha1-ImageReviewContainerSpec} + + +**Appears in:** + +- [ImageReviewSpec](#imagepolicy-k8s-io-v1alpha1-ImageReviewSpec) + + +

ImageReviewContainerSpec is a description of a container within the pod creation request.

+ + + + + + + + + + + +
FieldDescription
image
+string +
+

This can be in the form image:tag or image@SHA:012345679abcdef.

+
+ +## `ImageReviewSpec` {#imagepolicy-k8s-io-v1alpha1-ImageReviewSpec} + + +**Appears in:** + +- [ImageReview](#imagepolicy-k8s-io-v1alpha1-ImageReview) + + +

ImageReviewSpec is a description of the pod creation request.

+ + + + + + + + + + + + + + + + + +
FieldDescription
containers
+[]ImageReviewContainerSpec +
+

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` {#imagepolicy-k8s-io-v1alpha1-ImageReviewStatus} + + +**Appears in:** + +- [ImageReview](#imagepolicy-k8s-io-v1alpha1-ImageReview) + + +

ImageReviewStatus is the result of the review for the pod creation request.

+ + + + + + + + + + + + + + + + + +
FieldDescription
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. -kubeadm 配置文件路径。 +

kubeadm 配置文件路径。

@@ -75,9 +89,9 @@ kubeadm 配置文件路径。 -apiserver-kubelet-client 操作的帮助命令 +

apiserver-kubelet-client 操作的帮助命令

@@ -92,9 +106,9 @@ apiserver-kubelet-client 操作的帮助命令 -为控制平面指定特定的 Kubernetes 版本。 +

为控制平面指定特定的 Kubernetes 版本。

@@ -120,9 +134,9 @@ Choose a specific Kubernetes version for the control plane. -[实验] 指向宿主机上的 '实际' 根文件系统的路径。 +

[实验] 指向宿主机上的 '实际' 根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_ca.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_ca.md index 3b24c3d0b4..71a091342a 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_ca.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_ca.md @@ -1,3 +1,18 @@ + + + +生成自签名的 Kubernetes CA 以便为其他 Kubernetes 组件提供身份标识 - -生成自签名的 Kubernetes CA 以提供其他 Kubernetes 组件的身份,并将其保存到 ca.cert 和 ca.key 文件中。 +生成自签名的 Kubernetes CA 以便为其他 Kubernetes 组件提供身份标识,并将其保存到 ca.crt 和 ca.key 文件中。 - 如果两个文件都已存在,则 kubeadm 将跳过生成步骤,使用现有文件。 - Alpha 免责声明:此命令当前为 Alpha 功能。 ``` @@ -51,9 +63,9 @@ kubeadm init phase certs ca [flags] -证书的存储路径。 +

证书的存储路径。

@@ -63,9 +75,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -75,9 +87,9 @@ kubeadm 配置文件的路径。 -ca 操作的帮助命令 +

ca 操作的帮助命令

@@ -92,9 +104,9 @@ ca 操作的帮助命令 -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

@@ -120,9 +132,9 @@ Choose a specific Kubernetes version for the control plane. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config.md index dc424bd24e..0447fc428c 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config.md @@ -1,3 +1,18 @@ + + + +上传 kubeadm 和 kubelet 配置到 ConfigMap 中 -upload-config 操作的帮助命令 +

upload-config 操作的帮助命令

@@ -62,9 +77,9 @@ upload-config 操作的帮助命令 -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

From a26e231c2f3489cb7777c287d457fdfccead37b6 Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 21:12:58 +0800 Subject: [PATCH 042/245] [zh] sync v1.24 kubeadm-13 --- ...adm_certs_renew_controller-manager.conf.md | 61 ++++++------- ...let-finalize_experimental-cert-rotation.md | 33 ++++--- ...ubeadm_upgrade_node_phase_control-plane.md | 90 +++++++++++-------- 3 files changed, 100 insertions(+), 84 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_controller-manager.conf.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_controller-manager.conf.md index a4d974bb52..9285782b4b 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_controller-manager.conf.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_controller-manager.conf.md @@ -1,3 +1,18 @@ + + + +续订 kubeconfig 文件中嵌入的证书,以供控制器管理器(Controller Manager)使用。 -保存证书的路径。 +

保存证书的路径。

@@ -64,33 +79,9 @@ The path where to save the certificates. -kubeadm 配置文件的路径。 - - - - ---csr-dir string - - - - -CSR 和私钥的输出路径 - - - - ---csr-only - - - - -创建 CSR 而不是生成证书 +

kubeadm 配置文件的路径。

@@ -100,9 +91,9 @@ Create CSRs instead of generating certificates -controller-manager.conf 操作的帮助命令 +

controller-manager.conf 操作的帮助命令

@@ -117,10 +108,10 @@ controller-manager.conf 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。 -如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 +

与集群通信时使用的 kubeconfig 文件。 +如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -157,9 +148,9 @@ Use the Kubernetes certificate API to renew certificates -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize_experimental-cert-rotation.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize_experimental-cert-rotation.md index 77517935ca..ef3c0ae99a 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize_experimental-cert-rotation.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize_experimental-cert-rotation.md @@ -1,9 +1,22 @@ + + + +启用 kubelet 客户端证书轮换 ### 概要 - - 启用 kubelet 客户端证书轮换 @@ -25,24 +38,24 @@ kubeadm init phase kubelet-finalize experimental-cert-rotation [flags] --cert-dir string     Default: "/etc/kubernetes/pki" - -保存和存储证书的路径。 + +

保存和存储证书的路径。

--config string - -kubeadm 配置文件的路径。 + +

kubeadm 配置文件的路径。

-h, --help - -experimental-cert-rotation 操作的帮助命令 + +

experimental-cert-rotation 操作的帮助命令

@@ -64,8 +77,8 @@ kubeadm init phase kubelet-finalize experimental-cert-rotation [flags] --rootfs string - -[实验] 到'真实'主机根文件系统的路径。 + +

[实验] 到'真实'主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_node_phase_control-plane.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_node_phase_control-plane.md index 4235ef59b5..f69ec4a67e 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_node_phase_control-plane.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_node_phase_control-plane.md @@ -1,3 +1,19 @@ + + + +升级部署在此节点上的控制平面实例,如果有的话 + @@ -31,38 +47,64 @@ kubeadm upgrade node phase control-plane [flags] --certificate-renewal -更新在升级期间变更的组件使用的证书。 +

更新在升级期间变更的组件使用的证书。

--dry-run -不改变任何状态,只输出将要执行的动作。 +

不改变任何状态,只输出将要执行的动作。

--etcd-upgrade     默认值: true -执行 etcd 的升级。 +

执行 etcd 的升级。

---experimental-patches string +-h, --help + + +

control-plane 的帮助信息

+ + + + + +--kubeconfig string     默认值: "/etc/kubernetes/admin.conf" + + +

用于和集群通信的 KubeConfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 KubeConfig 文件。

+ + + + + + + +--patches string @@ -77,36 +119,6 @@ Path to a directory that contains files named "target[suffix][+patchtype].extens - - - --h, --help - - -control-plane 的帮助信息 - - - - - ---kubeconfig string     默认值: "/etc/kubernetes/admin.conf" - - -用于和集群通信的 KubeConfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 KubeConfig 文件。 - - - - - - @@ -129,10 +141,10 @@ Path to a directory that contains files named "target[suffix][+patchtype].extens --rootfs string -[实验] 到'真实'主机根文件系统的路径。 +

[实验] 到'真实'主机根文件系统的路径。

From 52802c7b1abd37f77d993c89275e6461d8161fcd Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 21:25:46 +0800 Subject: [PATCH 043/245] [zh] sync v1.24 kubeadm-14 --- .../kubeadm_init_phase_bootstrap-token.md | 35 ++++++++++---- .../kubeadm_init_phase_certs_etcd-peer.md | 47 ++++++++++++++----- .../generated/kubeadm_token_generate.md | 36 ++++++++++---- 3 files changed, 88 insertions(+), 30 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_bootstrap-token.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_bootstrap-token.md index 2ea181aac1..5c77af3735 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_bootstrap-token.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_bootstrap-token.md @@ -1,3 +1,18 @@ + + + +生成用于将节点加入集群的引导令牌 -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -67,9 +82,9 @@ kubeadm 配置文件的路径。 -bootstrap-token 操作的帮助命令 +

bootstrap-token 操作的帮助命令

@@ -84,9 +99,9 @@ bootstrap-token 操作的帮助命令 -用于和集群通信的 kubeconfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 kubeconfig 文件。 +

用于和集群通信的 kubeconfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 kubeconfig 文件。

@@ -96,9 +111,9 @@ The kubeconfig file to use when talking to the cluster. If the flag is not set, -跳过打印 'kubeadm init' 生成的默认引导令牌。 +

跳过打印 'kubeadm init' 生成的默认引导令牌。

@@ -124,9 +139,9 @@ Skip printing of the default bootstrap token generated by 'kubeadm init'. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md index 9933975b92..4a4ec4fd19 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md @@ -1,3 +1,18 @@ + + + +生成 etcd 节点相互通信的证书 -生成 etcd 节点相互通信的证书,并将其保存到 etcd/peer.cert 和 etcd/peer.key 文件中。 +生成 etcd 节点相互通信的证书,并将其保存到 etcd/peer.crt 和 etcd/peer.key 文件中。 -保存和存储证书的路径。 + +

保存和存储证书的路径。

@@ -66,8 +83,10 @@ kubeadm init phase certs etcd-peer [flags] - -kubeadm 配置文件的路径。 + +

kubeadm 配置文件的路径。

@@ -76,8 +95,10 @@ kubeadm 配置文件的路径。 - -etcd-peer 操作的帮助命令 + +

etcd-peer 操作的帮助命令

@@ -91,8 +112,10 @@ etcd-peer 操作的帮助命令 - -为控制平面指定特定的 Kubernetes 版本。 + +

为控制平面指定特定的 Kubernetes 版本。

@@ -118,9 +141,9 @@ etcd-peer 操作的帮助命令 -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_generate.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_generate.md index c91bb69ae8..da02baf36f 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_generate.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_generate.md @@ -1,3 +1,18 @@ + + + +生成并打印一个引导令牌,但不要在服务器上创建它 -generate 操作的帮助命令 +

generate 操作的帮助命令

@@ -71,8 +86,11 @@ generate 操作的帮助命令 - -是否启用 `dry-run` 运行模式 + +

是否启用 `dry-run` 运行模式

+ @@ -86,9 +104,9 @@ generate 操作的帮助命令 -用于和集群通信的 KubeConfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 KubeConfig 文件。 +

用于和集群通信的 KubeConfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 KubeConfig 文件。

@@ -97,8 +115,10 @@ The kubeconfig file to use when talking to the cluster. If the flag is not set, - -[实验] 指向 '真实' 宿主机根文件系统的路径。 + +

[实验] 指向 '真实' 宿主机根文件系统的路径。

From adda371aa4469de788f974f48d8398411acc8ced Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 22:58:10 +0800 Subject: [PATCH 044/245] [zh] sync v1.24 kubeadm-19 --- ...dm_certs_renew_apiserver-kubelet-client.md | 61 +++++++-------- .../kubeadm_init_phase_control-plane.md | 27 ++++++- .../kubeadm_init_phase_etcd_local.md | 75 ++++++++++++------- 3 files changed, 99 insertions(+), 64 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-kubelet-client.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-kubelet-client.md index 9b1d8127b9..4272890db4 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-kubelet-client.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-kubelet-client.md @@ -1,3 +1,18 @@ + + + +续订 apiserver 用于连接 kubelet 的证书。 -存储证书的路径。 +

存储证书的路径。

@@ -64,33 +79,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 - - - - ---csr-dir string - - - - -输出 CSR 和私钥的路径 - - - - ---csr-only - - - - -创建 CSR 而不是生成证书 +

kubeadm 配置文件的路径。

@@ -100,9 +91,9 @@ Create CSRs instead of generating certificates -apiserver-kubelet-client 操作的帮助命令 +

apiserver-kubelet-client 操作的帮助命令

@@ -117,10 +108,10 @@ apiserver-kubelet-client 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。 -如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 +

与集群通信时使用的 kubeconfig 文件。 +如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -157,9 +148,9 @@ Use the Kubernetes certificate API to renew certificates -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane.md index 61320596e6..683327985a 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane.md @@ -1,3 +1,18 @@ + + + +生成建立控制平面所需的静态 Pod 清单文件 -control-plane 操作的帮助命令 + +

control-plane 操作的帮助命令

@@ -59,8 +76,10 @@ control-plane 操作的帮助命令 - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_etcd_local.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_etcd_local.md index 0a09b80c86..e046168998 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_etcd_local.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_etcd_local.md @@ -1,3 +1,18 @@ + + + +为本地单节点 etcd 实例生成静态 Pod 清单文件 -存储证书的路径。 + +

存储证书的路径。

@@ -69,24 +86,10 @@ kubeadm init phase etcd local --config config.yaml - -kubeadm 配置文件的路径。 - - - - ---experimental-patches string - - - - -包含名为 "target[suffix][+patchtype].extension" 的文件的目录的路径。 -例如,"kube-apiserver0+merge.yaml" 或仅仅是 "etcd.json"。 -"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,并且它们与 kubectl 支持的补丁格式匹配。 -默认的 "patchtype" 为 "strategic"。 "extension" 必须为 "json" 或 "yaml"。 -"suffix" 是一个可选字符串,可用于确定首先按字母顺序应用哪些补丁。 +

kubeadm 配置文件的路径。

@@ -95,8 +98,10 @@ Path to a directory that contains files named "target[suffix][+patchtype].extens - -local 操作的帮助命令 + +

local 操作的帮助命令

@@ -110,8 +115,26 @@ local 操作的帮助命令 - -选择要从中拉取控制平面镜像的容器仓库 + +

选择要从中拉取控制平面镜像的容器仓库

+ + + + +--patches string + + + + +

包含名为 "target[suffix][+patchtype].extension" 的文件的目录的路径。 +例如,"kube-apiserver0+merge.yaml" 或仅仅是 "etcd.json"。 +"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,并且它们与 kubectl 支持的补丁格式匹配。 +默认的 "patchtype" 为 "strategic"。 "extension" 必须为 "json" 或 "yaml"。 +"suffix" 是一个可选字符串,可用于确定首先按字母顺序应用哪些补丁。

@@ -136,8 +159,10 @@ local 操作的帮助命令 - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。

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 操作的帮助命令 + +

config 操作的帮助命令

@@ -56,10 +73,11 @@ config 操作的帮助命令 - -用于和集群通信的 kubeconfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 kubeconfig 文件 +

用于和集群通信的 kubeconfig 文件。如果它没有被设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 kubeconfig 文件 @@ -84,8 +102,10 @@ If the flag is not set, a set of standard locations can be searched for an exist - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。 diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_migrate.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_migrate.md index 7d1ae11ea0..df70d06637 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_migrate.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_migrate.md @@ -1,3 +1,18 @@ + + + +从文件中读取旧版本的 kubeadm 配置的 API 类型,并为新版本输出类似的配置对象 此命令允许您在 CLI 工具中将本地旧版本的配置对象转换为最新支持的版本,而无需变更集群中的任何内容。在此版本的 kubeadm 中,支持以下 API 版本: - -- kubeadm.k8s.io/v1beta2 +- kubeadm.k8s.io/v1beta3 -migrate 操作的帮助信息 + +

migrate 操作的帮助信息

@@ -66,9 +82,9 @@ migrate 操作的帮助信息 -使用新的 API 版本生成的 kubeadm 配置文件的路径。这个路径是可选的。如果没有指定,输出将被写到 stdout。 +

使用新的 API 版本生成的 kubeadm 配置文件的路径。这个路径是可选的。如果没有指定,输出将被写到 stdout。

@@ -78,9 +94,9 @@ Path to the resulting equivalent kubeadm config file using the new API version. -使用旧 API 版本且应转换的 kubeadm 配置文件的路径。此参数是必需的。 +

使用旧 API 版本且应转换的 kubeadm 配置文件的路径。此参数是必需的。

@@ -109,9 +125,9 @@ Path to the kubeadm config file that is using an old API version and should be c -用于和集群通信的 kubeconfig 文件。如果未设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 kubeconfig 文件。 +

用于和集群通信的 kubeconfig 文件。如果未设置,那么 kubeadm 将会搜索一个已经存在于标准路径的 kubeconfig 文件。

@@ -120,8 +136,10 @@ The kubeconfig file to use when talking to the cluster. If the flag is not set, - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase.md index ee327bcc75..1fea4a45f4 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase.md @@ -1,3 +1,18 @@ + + + +使用此命令来调用 `join` 工作流程的某个阶段 -phase 操作的帮助命令 + +

phase 操作的帮助命令

@@ -55,8 +72,10 @@ phase 操作的帮助命令 - -[实验] 指向 '真实' 宿主机根文件系统的路径。 + +

[实验] 指向 '真实' 宿主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_update-status.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_update-status.md index 0fce61c11b..22df0e47a8 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_update-status.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_update-status.md @@ -1,3 +1,18 @@ + + + +将新的控制平面节点注册到 kubeadm-config ConfigMap 维护的 ClusterStatus 中(已弃用) -将新的控制平面节点注册到 kubeadm-config ConfigMap 维护的 ClusterStatus 中 +将新的控制平面节点注册到 kubeadm-config ConfigMap 维护的 ClusterStatus 中(已弃用) ``` kubeadm join phase control-plane-join update-status [flags] @@ -34,9 +49,9 @@ kubeadm join phase control-plane-join update-status [flags] -如果该节点托管一个新的控制平面实例,则 API 服务器将公布其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。 +

如果该节点托管一个新的控制平面实例,则 API 服务器将公布其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。

@@ -45,8 +60,10 @@ If the node should host a new control plane instance, the IP address the API Ser - -kubeadm 配置文件的路径。 + +

kubeadm 配置文件的路径。

@@ -55,8 +72,10 @@ kubeadm 配置文件的路径。 - -在此节点上创建一个新的控制平面实例 + +

在此节点上创建一个新的控制平面实例

@@ -65,8 +84,10 @@ kubeadm 配置文件的路径。 - -update-status 操作的帮助命令 + +

update-status 操作的帮助命令

@@ -75,8 +96,10 @@ update-status 操作的帮助命令 - -指定节点名称。 + +

指定节点名称。

@@ -103,8 +126,10 @@ update-status 操作的帮助命令 - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。

From 3acf1cddcdfdc26855120094d7e8df3492444214 Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 23:25:19 +0800 Subject: [PATCH 047/245] [zh] sync v1.24 kubeadm-21 --- .../kubeadm_certs_renew_front-proxy-client.md | 61 ++++++++----------- .../kubeadm/generated/kubeadm_init_phase.md | 25 ++++++-- ..._init_phase_certs_apiserver-etcd-client.md | 47 ++++++++++---- ...adm_init_phase_certs_front-proxy-client.md | 39 ++++++++---- 4 files changed, 109 insertions(+), 63 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_front-proxy-client.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_front-proxy-client.md index 7dac9e30d2..ca748f5482 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_front-proxy-client.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_front-proxy-client.md @@ -1,3 +1,18 @@ + + + +为前端代理客户端续订证书。 -存储证书的路径。 +

存储证书的路径。

@@ -60,33 +75,9 @@ The path where to save the certificates -kubeadm 配置文件的路径。 - - - - ---csr-dir string - - - - -输出 CSR 和私钥的路径 - - - - ---csr-only - - - - -创建 CSR 而不是生成证书 +

kubeadm 配置文件的路径。

@@ -96,9 +87,9 @@ Create CSRs instead of generating certificates -front-proxy-client 操作的帮助命令 +

front-proxy-client 操作的帮助命令

@@ -113,10 +104,10 @@ front-proxy-client 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。 -如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 +

与集群通信时使用的 kubeconfig 文件。 +如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -153,9 +144,9 @@ Use the Kubernetes certificate API to renew certificates -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase.md index 3052b2a5b6..2b74059aef 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase.md @@ -1,3 +1,18 @@ + + + +使用此命令可以调用 init 工作流程的单个阶段 -phase 操作的帮助命令 + +

phase 操作的帮助命令

@@ -56,9 +73,9 @@ phase 操作的帮助命令 -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md index 00444ac3f4..d3035731f4 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md @@ -1,3 +1,18 @@ + + + +生成 apiserver 用来访问 etcd 的证书 -生成 apiserver 用于访问 etcd 的证书,并将其保存到 apiserver-etcd-client.cert 和 apiserver-etcd-client.key 文件中。 +生成 apiserver 用于访问 etcd 的证书,并将其保存到 apiserver-etcd-client.crt 和 apiserver-etcd-client.key 文件中。 -证书的存储路径。 + +

证书的存储路径。

@@ -60,8 +77,10 @@ kubeadm init phase certs apiserver-etcd-client [flags] - -kubeadm 配置文件的路径。 + +

kubeadm 配置文件的路径。

@@ -70,8 +89,10 @@ kubeadm 配置文件的路径。 - -apiserver-etcd-client 操作的帮助命令 + +

apiserver-etcd-client 操作的帮助命令

@@ -84,9 +105,9 @@ apiserver-etcd-client 操作的帮助命令 -为控制平面指定特定的 Kubernetes 版本。 +

为控制平面指定特定的 Kubernetes 版本。

@@ -111,8 +132,10 @@ Choose a specific Kubernetes version for the control plane. - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md index fb39d4a6cf..e2dba21e7e 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md @@ -1,3 +1,18 @@ + + + +为前端代理客户端生成证书 -为前端代理客户端生成证书,并将其保存到 front-proxy-client.cert 和 front-proxy-client.key 文件中。 +为前端代理客户端生成证书,并将其保存到 front-proxy-client.crt 和 front-proxy-client.key 文件中。 如果两个文件都已存在,kubeadm 将跳过生成步骤并将使用现有文件。 Alpha 免责声明:此命令目前是 alpha 阶段。 @@ -42,9 +57,9 @@ kubeadm init phase certs front-proxy-client [flags] -存储证书的路径。 +

存储证书的路径。

@@ -54,9 +69,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -66,9 +81,9 @@ kubeadm 配置文件的路径。 -front-proxy-client 操作的帮助命令 +

front-proxy-client 操作的帮助命令

@@ -83,9 +98,9 @@ front-proxy-client 操作的帮助命令 -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

@@ -111,9 +126,9 @@ Choose a specific Kubernetes version for the control plane. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

From c04222c314eeba9c6365fbf70a7e93640c8739dd Mon Sep 17 00:00:00 2001 From: yuli Date: Wed, 18 May 2022 22:17:37 +0800 Subject: [PATCH 048/245] [zh]Sync reference-11 [zh]Sync reference-11 --- ...-dockershim-and-cri-compatible-runtimes.md | 92 +++++++++++-------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/content/zh/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes.md b/content/zh/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes.md index 094da533f0..28f075cbb9 100644 --- a/content/zh/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes.md +++ b/content/zh/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes.md @@ -1,83 +1,99 @@ --- -title: 关于 dockershim 移除和使用兼容 CRI 运行时的外部文章 +title: 关于 dockershim 移除和使用兼容 CRI 运行时的文章 content_type: reference weight: 20 --- -这是有关以下内容的文章列表: - -- Kubernetes 弃用和删除 _dockershim_ -- 使用兼容 CRI 的容器运行时 +这是关于 Kubernetes 弃用和删除 “dockershim” +或使用兼容 CRI 的容器运行时相关的文章和其他页面的列表, -## 首要来源 +## Kubernetes 项目 {#kubernetes-project} -* [Kubernetes 博客: “Dockershim 弃用常见问题解答”, 2020/12/02](/blog/2020/12/02/dockershim-faq/) +* Kubernetes 博客:[Dockershim 弃用常见问题解答](/zh/blog/2022/02/17/dockershim-faq/)(最初发表于 2022/02/17) -* [Kubernetes 文档:“从 dockershim 迁移”](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/) +* Kubernetes 博客:[Kubernetes 即将移除 Dockershim:承诺和下一步](/blog/2022/01/07/kubernetes-is-moving-on-from-dockershim/)(发表于 2022/01/07) -* [Kubernetes 文档:“容器运行时”](/zh/docs/setup/production-environment/container-runtimes/) +* Kubernetes 博客:[移除 Dockershim 即将到来。你准备好了吗?](/zh/blog/2021/11/12/are-you-ready-for-dockershim-removal/)(发表于 2021/11/12) -* [Kubernetes 增强提问: “从 kubelet 中删除 dockershim” (`kubernetes/enhancements#2221`)](https://github.com/kubernetes/enhancements/issues/2221) +* Kubernetes 文档:[从 dockershim 迁移](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/) -* [Kubernetes 增强建议:“KEP-2221: 从 kubelet 中删除 dockershim”](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2221-remove-dockershim/README.md) +* Kubernetes 文档:[容器运行时](/zh/docs/setup/production-environment/container-runtimes/) -* [Kubernetes 博客: “移除 Dockershim 即将到来。你准备好了吗?”, 2021/11/12](/blog/2021/11/12/are-you-ready-for-dockershim-removal/) +* Kubernetes 增强建议:[KEP-2221: 从 kubelet 中删除 dockershim](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2221-remove-dockershim/README.md) + +* Kubernetes 增强提问:[从 kubelet 中删除 dockershim](https://github.com/kubernetes/enhancements/issues/2221)(“k/enhancements#2221”) + + +你可以通过 GitHub 问题 +[**Dockershim 删除反馈和问题**](https://github.com/kubernetes/kubernetes/issues/106917) 提供反馈。 -## 次要来源 +## 外部来源 {#third-party} -* [Docker.com 博客:“开发人员需要了解的关于 Docker、Docker Engine 和 Kubernetes v1.20 的哪些知识”,2020/12/04](https://www.docker.com/blog/what-developers-need-to-know-about-docker-docker-engine-and-kubernetes-v1-20/) +* Amazon 网络服务 EKS 文档:[Dockershim 弃用](https://docs.aws.amazon.com/eks/latest/userguide/dockershim-deprecation.html) -* [Tripwire.com:“Dockershim 即将弃用如何影响你的 Kubernetes”](https://www.tripwire.com/state-of-security/security-data-protection/cloud/how-dockershim-forthcoming-deprecation-affects-your-kubernetes/) +* CNCF会议视频:[将 Kubernetes 从 Docker 迁移到 containerd 运行时的经验教训](https://www.docker.com/blog/what-developers-need-to-know-about-docker-docker-engine-and-kubernetes-v1-20/)(Ana Caylin,在 KubeCon Europe 2019) -* [Amazon EKS 文档:“Dockershim 弃用”](https://docs.aws.amazon.com/eks/latest/userguide/dockershim-deprecation.html) +* Docker.com 博客:[开发人员需要了解的关于 Docker、Docker Engine 和 Kubernetes v1.20 的哪些知识](https://www.docker.com/blog/what-developers-need-to-know-about-docker-docker-engine-and-kubernetes-v1-20/)(发表于 2020/12/04) -* [YouTube 上的 “Google 开源”频道:“与 Google 一起学习 Kubernetes - 从 Dockershim 迁移到 Containerd”](https://youtu.be/fl7_4hjT52g) +* YouTube 上的“Google 开源”频道:[与 Google 一起学习 Kubernetes - 从 Dockershim 迁移到 Containerd](https://youtu.be/fl7_4hjT52g) -* [Mirantis 博客:“Dockershim 的未来是 cri-dockerd”,2021/04/21](https://www.mirantis.com/blog/the-future-of-dockershim-is-cri-dockerd/) +* Azure 博客上的 Microsoft 应用:[Dockershim 弃用和 AKS](https://techcommunity.microsoft.com/t5/apps-on-azure-blog/dockershim-deprecation-and-aks/ba-p/3055902)(发表于 2022/01/21) -* [Github.com:“Mirantis/cri-dockerd” 仓库](https://github.com/Mirantis/cri-dockerd) +* Mirantis 博客:[Dockershim 的未来是 cri-dockerd](https://www.mirantis.com/blog/the-future-of-dockershim-is-cri-dockerd/)(发表于 2021/04/21) + +* Mirantis: [Mirantis/cri-dockerd](https://github.com/Mirantis/cri-dockerd) Git 仓库(在 GitHub 上) + +* Tripwire:[Dockershim 即将弃用如何影响你的 Kubernetes](https://www.tripwire.com/state-of-security/security-data-protection/cloud/how-dockershim-forthcoming-deprecation-affects-your-kubernetes/) From 5a8589f7cb0c5a35b236982124b49392fdc02c38 Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 23:42:02 +0800 Subject: [PATCH 049/245] [zh] sync v1.24 kubeadm-22 --- .../kubeadm_init_phase_addon_kube-proxy.md | 55 +++++++----- ...nit_phase_kubeconfig_controller-manager.md | 51 ++++++++---- ..._phase_control-plane-prepare_kubeconfig.md | 59 ++++++++----- .../generated/kubeadm_join_phase_preflight.md | 83 +++++++++++-------- 4 files changed, 154 insertions(+), 94 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy.md index 4698ee4b32..ca63db2de4 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy.md @@ -1,3 +1,18 @@ + + + +将 kube-proxy 插件安装到 Kubernetes 集群 -API 服务器所公布的其正在监听的 IP 地址。如果未设置,则将使用默认网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,则将使用默认网络接口。

@@ -51,9 +66,9 @@ API 服务器所公布的其正在监听的 IP 地址。如果未设置,则将 -API 服务器绑定的端口。 +

API 服务器绑定的端口。

@@ -63,9 +78,9 @@ API 服务器绑定的端口。 -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -75,9 +90,9 @@ kubeadm 配置文件的路径。 -为控制平面指定一个稳定的 IP 地址或 DNS 名称。 +

为控制平面指定一个稳定的 IP 地址或 DNS 名称。

@@ -87,9 +102,9 @@ Specify a stable IP address or DNS name for the control plane. -kube-proxy 操作的帮助命令 +

kube-proxy 操作的帮助命令

@@ -104,9 +119,9 @@ kube-proxy 操作的帮助命令 -选择用于拉取控制平面镜像的容器仓库 +

选择用于拉取控制平面镜像的容器仓库

@@ -121,9 +136,9 @@ Choose a container registry to pull control plane images from -与集群通信时使用的 kubeconfig 文件。如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 +

与集群通信时使用的 kubeconfig 文件。如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -138,9 +153,9 @@ The kubeconfig file to use when talking to the cluster. If the flag is not set, -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

@@ -150,9 +165,9 @@ Choose a specific Kubernetes version for the control plane. -指定 Pod 网络的 IP 地址范围。如果已设置,控制平面将自动为每个节点分配 CIDR。 +

指定 Pod 网络的 IP 地址范围。如果已设置,控制平面将自动为每个节点分配 CIDR。

@@ -178,9 +193,9 @@ Specify range of IP addresses for the pod network. If set, the control plane wil -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_controller-manager.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_controller-manager.md index 0ba7a636c3..a5c2db1235 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_controller-manager.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_controller-manager.md @@ -1,3 +1,18 @@ + + + +生成控制器管理器要使用的 kubeconfig 文件 -API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。

@@ -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. -controller-manager 操作的帮助命令 +

controller-manager 操作的帮助命令

@@ -121,9 +136,9 @@ controller-manager 操作的帮助命令 -kubeconfig 文件的保存路径。 +

kubeconfig 文件的保存路径。

@@ -138,9 +153,9 @@ kubeconfig 文件的保存路径。 -为控制平面指定特定的 Kubernetes 版本。 +

为控制平面指定特定的 Kubernetes 版本。

@@ -165,9 +180,9 @@ Choose a specific Kubernetes version for the control plane. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_kubeconfig.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_kubeconfig.md index 4ae6068268..449f477df5 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_kubeconfig.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_kubeconfig.md @@ -1,3 +1,18 @@ + + + +为新的控制平面组件生成 kubeconfig -使用此密钥可以解密由 init 上传的证书 secret。 +

使用此密钥可以解密由 init 上传的证书 secret。

@@ -45,9 +60,9 @@ Use this key to decrypt the certificate secrets uploaded by init. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -57,9 +72,9 @@ kubeadm 配置文件的路径。 -在此节点上创建一个新的控制平面实例 +

在此节点上创建一个新的控制平面实例

@@ -69,9 +84,9 @@ Create a new control plane instance on this node -对于基于文件的发现,给出用于加载集群信息的文件或者 URL。 +

对于基于文件的发现,给出用于加载集群信息的文件或者 URL。

@@ -81,9 +96,9 @@ For file-based discovery, a file or URL from which to load cluster information. -对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。 +

对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。

@@ -93,9 +108,9 @@ For token-based discovery, the token used to validate cluster information fetche -对于基于令牌的发现,请验证根 CA 公钥是否匹配此哈希值(格式:"<type>:<value>")。 +

对于基于令牌的发现,请验证根 CA 公钥是否匹配此哈希值(格式:"<type>:<value>")。

@@ -105,9 +120,9 @@ For token-based discovery, validate that the root CA public key matches this has -对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。 +

对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。

@@ -117,9 +132,9 @@ For token-based discovery, allow joining without --discovery-token-ca-cert-hash -kubeconfig 操作的帮助命令 +

kubeconfig 操作的帮助命令

@@ -129,9 +144,9 @@ kubeconfig 操作的帮助命令 -指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。 +

指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。

@@ -141,9 +156,9 @@ Specify the token used to temporarily authenticate with the Kubernetes Control P -如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。 +

如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。

@@ -169,9 +184,9 @@ Use this token for both discovery-token and tls-bootstrap-token when those value -[实验] 指向 '真实' 宿主机根文件系统的路径。 +

[实验] 指向 '真实' 宿主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_preflight.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_preflight.md index 97ad892e9d..77951cba33 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_preflight.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_preflight.md @@ -1,3 +1,18 @@ + + + +运行 join 命令前检查 -对于将要托管新的控制平面实例的节点,指定 API 服务器将公布的其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。 +

对于将要托管新的控制平面实例的节点,指定 API 服务器将公布的其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。

@@ -63,9 +78,9 @@ If the node should host a new control plane instance, the IP address the API Ser -针对将要托管新的控制平面实例的节点,设置 API 服务器要绑定的端口。 +

针对将要托管新的控制平面实例的节点,设置 API 服务器要绑定的端口。

@@ -75,9 +90,9 @@ If the node should host a new control plane instance, the port for the API Serve -使用此密钥可以解密由 `init` 操作上传的证书 secret。 +

使用此密钥可以解密由 `init` 操作上传的证书 secret。

@@ -87,9 +102,9 @@ Use this key to decrypt the certificate secrets uploaded by init. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -99,9 +114,9 @@ kubeadm 配置文件的路径。 -在此节点上创建一个新的控制平面实例 +

在此节点上创建一个新的控制平面实例

@@ -111,9 +126,9 @@ Create a new control plane instance on this node -提供给 CRI 套接字建立连接的路径。如果为空,则 kubeadm 将尝试自动检测该值;仅当安装了多个 CRI 或具有非标准 CRI 套接字时,才使用此选项。 +

提供给 CRI 套接字建立连接的路径。如果为空,则 kubeadm 将尝试自动检测该值;仅当安装了多个 CRI 或具有非标准 CRI 套接字时,才使用此选项。

@@ -123,9 +138,9 @@ Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this -对于基于文件的发现,给出用于加载集群信息的文件或者 URL。 +

对于基于文件的发现,给出用于加载集群信息的文件或者 URL。

@@ -135,21 +150,21 @@ For file-based discovery, a file or URL from which to load cluster information. -对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。 +

对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。

---discovery-token-ca-cert-hash stringSlice +--discovery-token-ca-cert-hash strings -对于基于令牌的发现,验证根 CA 公钥是否匹配此哈希值(格式:"<type>:<value>")。 +

对于基于令牌的发现,验证根 CA 公钥是否匹配此哈希值(格式:"<type>:<value>")。

@@ -159,9 +174,9 @@ For token-based discovery, validate that the root CA public key matches this has -对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。 +

对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。

@@ -171,9 +186,9 @@ For token-based discovery, allow joining without --discovery-token-ca-cert-hash -preflight 操作的帮助命令 +

preflight 操作的帮助命令

@@ -183,9 +198,9 @@ preflight 操作的帮助命令 -错误将显示为警告的检查列表;例如:'IsPrivilegedUser,Swap'。取值为 'all' 时将忽略检查中的所有错误。 +

错误将显示为警告的检查列表;例如:'IsPrivilegedUser,Swap'。取值为 'all' 时将忽略检查中的所有错误。

@@ -195,9 +210,9 @@ A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedU -指定节点名称。 +

指定节点名称。

@@ -207,9 +222,9 @@ Specify the node name. -指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。 +

指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。

@@ -219,9 +234,9 @@ Specify the token used to temporarily authenticate with the Kubernetes Control P -如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。 +

如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。

@@ -247,9 +262,9 @@ Use this token for both discovery-token and tls-bootstrap-token when those value -[实验] 指向 '真实' 宿主机根文件系统的路径。 +

[实验] 指向 '真实' 宿主机根文件系统的路径。

From 531088a523e13c7387646a29d83d89a4dbed64a5 Mon Sep 17 00:00:00 2001 From: huangminjie Date: Thu, 19 May 2022 00:01:53 +0800 Subject: [PATCH 050/245] [zh] sync v1.24 kubeadm-23 --- .../kubeadm_config_print_init-defaults.md | 37 ++++-- .../kubeadm_init_phase_kubeconfig_kubelet.md | 55 +++++--- .../kubeadm/generated/kubeadm_join.md | 121 +++++++++++------- 3 files changed, 135 insertions(+), 78 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_init-defaults.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_init-defaults.md index 2f20499dba..0ae02abb63 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_init-defaults.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_init-defaults.md @@ -1,3 +1,18 @@ + + + +打印用于 'kubeadm init' 的默认 init 配置 -请注意,Bootstrap Token 字段之类的敏感值已替换为 {"abcdef.0123456789abcdef" "" "nil" <nil> [] []} 之类的占位符值以通过验证,但不执行创建令牌的实际计算。 +

请注意,Bootstrap Token 字段之类的敏感值已替换为 "abcdef.0123456789abcdef" 之类的占位符值以通过验证,但不执行创建令牌的实际计算。 ``` kubeadm config print init-defaults [flags] @@ -35,14 +50,14 @@ kubeadm config print init-defaults [flags] ---component-configs stringSlice +--component-configs strings -组件配置 API 对象的逗号分隔列表,打印其默认值。可用值:[KubeProxyConfiguration KubeletConfiguration]。如果未设置此参数,则不会打印任何组件配置。 +

组件配置 API 对象的逗号分隔列表,打印其默认值。可用值:[KubeProxyConfiguration KubeletConfiguration]。如果未设置此参数,则不会打印任何组件配置。

@@ -52,9 +67,9 @@ A comma-separated list for component config API objects to print the default val -init-defaults 操作的帮助命令 +

init-defaults 操作的帮助命令

@@ -85,9 +100,9 @@ init-defaults 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 +

与集群通信时使用的 kubeconfig 文件。如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -97,9 +112,9 @@ The kubeconfig file to use when talking to the cluster. If the flag is not set, -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_kubelet.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_kubelet.md index b95587803d..ae4dc9bddb 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_kubelet.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_kubelet.md @@ -1,3 +1,18 @@ + + + +为 kubelet 生成一个 kubeconfig 文件,*仅仅*用于集群引导目的 -API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。

@@ -56,9 +71,9 @@ API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使 -要绑定到 API 服务器的端口。 +

要绑定到 API 服务器的端口。

@@ -73,9 +88,9 @@ Port for the API Server to bind to. -保存和存储证书的路径。 +

保存和存储证书的路径。

@@ -85,9 +100,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -97,9 +112,9 @@ kubeadm 配置文件的路径。 -为控制平面指定一个稳定的 IP 地址或 DNS 名称。 +

为控制平面指定一个稳定的 IP 地址或 DNS 名称。

@@ -109,9 +124,9 @@ Specify a stable IP address or DNS name for the control plane. -kubelet 操作的帮助命令 +

kubelet 操作的帮助命令

@@ -126,9 +141,9 @@ kubelet 操作的帮助命令 -kubeconfig 文件的保存路径。 +

kubeconfig 文件的保存路径。

@@ -143,9 +158,9 @@ kubeconfig 文件的保存路径。 -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

@@ -155,9 +170,9 @@ Choose a specific Kubernetes version for the control plane. -指定节点的名称。 +

指定节点的名称。

@@ -183,9 +198,9 @@ Specify the node name. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join.md index e113203a1a..e341577329 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join.md @@ -1,3 +1,18 @@ + + + +在你希望加入现有集群的任何机器上运行它 -如果该节点托管一个新的控制平面实例,则 API 服务器将公布其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。 +

如果该节点托管一个新的控制平面实例,则 API 服务器将公布其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。

@@ -140,9 +155,9 @@ If the node should host a new control plane instance, the IP address the API Ser -如果节点应该托管新的控制平面实例,则为 API 服务器要绑定的端口。 +

如果节点应该托管新的控制平面实例,则为 API 服务器要绑定的端口。

@@ -152,9 +167,9 @@ If the node should host a new control plane instance, the port for the API Serve -使用此密钥可以解密由 init 上传的证书 secret。 +

使用此密钥可以解密由 init 上传的证书 secret。

@@ -164,9 +179,9 @@ Use this key to decrypt the certificate secrets uploaded by init. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -176,9 +191,9 @@ kubeadm 配置文件的路径。 -在此节点上创建一个新的控制平面实例 +

在此节点上创建一个新的控制平面实例

@@ -188,9 +203,9 @@ Create a new control plane instance on this node -要连接的 CRI 套接字的路径。如果为空,则 kubeadm 将尝试自动检测此值;仅当安装了多个 CRI 或具有非标准 CRI 插槽时,才使用此选项。 +

要连接的 CRI 套接字的路径。如果为空,则 kubeadm 将尝试自动检测此值;仅当安装了多个 CRI 或具有非标准 CRI 插槽时,才使用此选项。

@@ -200,9 +215,9 @@ Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this -对于基于文件的发现,给出用于加载集群信息的文件或者 URL。 +

对于基于文件的发现,给出用于加载集群信息的文件或者 URL。

@@ -212,9 +227,9 @@ For file-based discovery, a file or URL from which to load cluster information. -对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。 +

对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。

@@ -224,9 +239,9 @@ For token-based discovery, the token used to validate cluster information fetche -对基于令牌的发现,验证根 CA 公钥是否与此哈希匹配 (格式: "<type>:<value>")。 +

对基于令牌的发现,验证根 CA 公钥是否与此哈希匹配 (格式: "<type>:<value>")。

@@ -236,26 +251,22 @@ For token-based discovery, validate that the root CA public key matches this has -对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。 +

对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。

---experimental-patches string +--dry-run - - -包含名为 "target[suffix][+patchtype].extension" 的文件的目录的路径。 -例如,"kube-apiserver0+merge.yaml" 或仅仅是 "etcd.json"。 -"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,并且它们与 kubectl 支持的补丁格式匹配。 -默认的 "patchtype" 为 "strategic"。 "extension" 必须为 "json" 或 "yaml"。 -"suffix" 是一个可选字符串,可用于确定首先按字母顺序应用哪些补丁。 - +不会应用任何改动,仅仅输出那些将变动的地方。 +

@@ -264,21 +275,21 @@ Path to a directory that contains files named "target[suffix][+patchtype].extens -join 操作的帮助命令 +

join 操作的帮助命令

---ignore-preflight-errors stringSlice +--ignore-preflight-errors strings -错误将显示为警告的检查列表;例如:'IsPrivilegedUser,Swap'。取值为 'all' 时将忽略检查中的所有错误。 +

错误将显示为警告的检查列表;例如:'IsPrivilegedUser,Swap'。取值为 'all' 时将忽略检查中的所有错误。

@@ -288,21 +299,37 @@ A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedU -指定节点的名称 +

指定节点的名称

---skip-phases stringSlice +--patches string + + + + +

包含名为 "target[suffix][+patchtype].extension" 的文件的目录的路径。 +例如,"kube-apiserver0+merge.yaml" 或仅仅是 "etcd.json"。 +"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,并且它们与 kubectl 支持的补丁格式匹配。 +默认的 "patchtype" 为 "strategic"。 "extension" 必须为 "json" 或 "yaml"。 +"suffix" 是一个可选字符串,可用于确定首先按字母顺序应用哪些补丁。

+ + + + +--skip-phases strings -要跳过的阶段列表 +

要跳过的阶段列表

@@ -312,9 +339,9 @@ List of phases to be skipped -指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。 +

指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。

@@ -324,9 +351,9 @@ Specify the token used to temporarily authenticate with the Kubernetes Control P -如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。 +

如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。

@@ -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 ./ ![wordpress-init](https://raw.githubusercontent.com/kubernetes/examples/master/mysql-wordpress-pd/WordPress.png) - - {{< 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] - ---add-dir-header - - - -如果为 true,则将文件目录添加到日志消息的头部 - - - ---address string     默认值:"0.0.0.0" - - - - -已弃用: 要监听 --port 端口的 IP 地址(将其设置为 0.0.0.0 或者 :: 用于监听所有接口和 IP族)。 -请参阅 --bind-address。 -如果在 --config 中指定了一个配置文件,这个参数将被忽略。 - - - - ---algorithm-provider string - - - - -已弃用: 要使用的调度算法驱动,此标志设置组件配置框架的默认插件。 -可选值:ClusterAutoscalerProvider | DefaultProvider - - --allow-metric-labels stringToString      @@ -97,18 +61,6 @@ The map from metric-label to value allow-list of this label. The key's format is - ---alsologtostderr - - - - -日志记录到标准错误以及文件 - - - --authentication-kubeconfig string @@ -269,17 +221,9 @@ If set, any request presenting a client certificate signed by one of the authori -配置文件的路径。以下标志会覆盖此文件中的值:
---algorithm-provider
---policy-config-file
---policy-configmap
---policy-configmap-namespace +配置文件的路径。 @@ -309,19 +253,6 @@ This flag provides an escape hatch for misbehaving metrics. You must provide the - ---experimental-logging-sanitization - - - - -[试验性功能] 当启用此标志时,标记为敏感的字段(密码、密钥、令牌)等不会被日志 -输出。
-运行时的日志清理操作可能引入相当程度的计算开销,因此不应在生产环境中启用。 - - --feature-gates <逗号分隔的 'key=True|False' 对> @@ -334,98 +265,102 @@ APIListChunking=true|false (BETA - default=true)
APIPriorityAndFairness=true|false (BETA - default=true)
APIResponseCompression=true|false (BETA - default=true)
APIServerIdentity=true|false (ALPHA - default=false)
+APIServerTracing=true|false (ALPHA - default=false)
AllAlpha=true|false (ALPHA - default=false)
AllBeta=true|false (BETA - default=false)
-AnyVolumeDataSource=true|false (ALPHA - default=false)
+AnyVolumeDataSource=true|false (BETA - default=true)
AppArmor=true|false (BETA - default=true)
-BalanceAttachedNodeVolumes=true|false (ALPHA - default=false)
-BoundServiceAccountTokenVolume=true|false (BETA - default=true)
CPUManager=true|false (BETA - default=true)
+CPUManagerPolicyAlphaOptions=true|false (ALPHA - default=false)
+CPUManagerPolicyBetaOptions=true|false (BETA - default=true)
+CPUManagerPolicyOptions=true|false (BETA - default=true)
CSIInlineVolume=true|false (BETA - default=true)
CSIMigration=true|false (BETA - default=true)
CSIMigrationAWS=true|false (BETA - default=false)
-CSIMigrationAzureDisk=true|false (BETA - default=false)
CSIMigrationAzureFile=true|false (BETA - default=false)
-CSIMigrationGCE=true|false (BETA - default=false)
-CSIMigrationOpenStack=true|false (BETA - default=true)
+CSIMigrationGCE=true|false (BETA - default=true)
+CSIMigrationPortworx=true|false (ALPHA - default=false)
+CSIMigrationRBD=true|false (ALPHA - default=false)
CSIMigrationvSphere=true|false (BETA - default=false)
-CSIMigrationvSphereComplete=true|false (BETA - default=false)
-CSIServiceAccountToken=true|false (BETA - default=true)
-CSIStorageCapacity=true|false (BETA - default=true)
-CSIVolumeFSGroupPolicy=true|false (BETA - default=true)
CSIVolumeHealth=true|false (ALPHA - default=false)
-ConfigurableFSGroupPolicy=true|false (BETA - default=true)
-ControllerManagerLeaderMigration=true|false (ALPHA - default=false)
-CronJobControllerV2=true|false (BETA - default=true)
+ContextualLogging=true|false (ALPHA - default=false)
+CronJobTimeZone=true|false (ALPHA - default=false)
CustomCPUCFSQuotaPeriod=true|false (ALPHA - default=false)
-DaemonSetUpdateSurge=true|false (ALPHA - default=false)
-DefaultPodTopologySpread=true|false (BETA - default=true)
+CustomResourceValidationExpressions=true|false (ALPHA - default=false)
+DaemonSetUpdateSurge=true|false (BETA - default=true)
+DelegateFSGroupToCSIDriver=true|false (BETA - default=true)
DevicePlugins=true|false (BETA - default=true)
DisableAcceleratorUsageMetrics=true|false (BETA - default=true)
-DownwardAPIHugePages=true|false (BETA - default=false)
-DynamicKubeletConfig=true|false (BETA - default=true)
-EfficientWatchResumption=true|false (BETA - default=true)
-EndpointSliceProxying=true|false (BETA - default=true)
-EndpointSliceTerminatingCondition=true|false (ALPHA - default=false)
-EphemeralContainers=true|false (ALPHA - default=false)
-ExpandCSIVolumes=true|false (BETA - default=true)
-ExpandInUsePersistentVolumes=true|false (BETA - default=true)
-ExpandPersistentVolumes=true|false (BETA - default=true)
+DisableCloudProviders=true|false (ALPHA - default=false)
+DisableKubeletCloudCredentialProviders=true|false (ALPHA - default=false)
+DownwardAPIHugePages=true|false (BETA - default=true)
+EndpointSliceTerminatingCondition=true|false (BETA - default=true)
+EphemeralContainers=true|false (BETA - default=true)
+ExpandedDNSConfig=true|false (ALPHA - default=false)
ExperimentalHostUserNamespaceDefaulting=true|false (BETA - default=false)
-GenericEphemeralVolume=true|false (BETA - default=true)
+GRPCContainerProbe=true|false (BETA - default=true)
GracefulNodeShutdown=true|false (BETA - default=true)
+GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - default=true)
HPAContainerMetrics=true|false (ALPHA - default=false)
HPAScaleToZero=true|false (ALPHA - default=false)
-HugePageStorageMediumSize=true|false (BETA - default=true)
-IPv6DualStack=true|false (BETA - default=true)
+HonorPVReclaimPolicy=true|false (ALPHA - default=false)
+IdentifyPodOS=true|false (BETA - default=true)
InTreePluginAWSUnregister=true|false (ALPHA - default=false)
InTreePluginAzureDiskUnregister=true|false (ALPHA - default=false)
InTreePluginAzureFileUnregister=true|false (ALPHA - default=false)
InTreePluginGCEUnregister=true|false (ALPHA - default=false)
InTreePluginOpenStackUnregister=true|false (ALPHA - default=false)
+InTreePluginPortworxUnregister=true|false (ALPHA - default=false)
+InTreePluginRBDUnregister=true|false (ALPHA - default=false)
InTreePluginvSphereUnregister=true|false (ALPHA - default=false)
-IndexedJob=true|false (ALPHA - default=false)
-IngressClassNamespacedParams=true|false (ALPHA - default=false)
-KubeletCredentialProviders=true|false (ALPHA - default=false)
+obMutableNodeSchedulingDirectives=true|false (BETA - default=true)
+JobReadyPods=true|false (BETA - default=true)
+JobTrackingWithFinalizers=true|false (BETA - default=false)
+KubeletCredentialProviders=true|false (BETA - default=true)
+KubeletInUserNamespace=true|false (ALPHA - default=false)
KubeletPodResources=true|false (BETA - default=true)
-KubeletPodResourcesGetAllocatable=true|false (ALPHA - default=false)
+KubeletPodResourcesGetAllocatable=true|false (BETA - default=true)
+LegacyServiceAccountTokenNoAutoGeneration=true|false (BETA - default=true)
LocalStorageCapacityIsolation=true|false (BETA - default=true)
LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (ALPHA - default=false)
-LogarithmicScaleDown=true|false (ALPHA - default=false)
-MemoryManager=true|false (ALPHA - default=false)
-MixedProtocolLBService=true|false (ALPHA - default=false)
-NamespaceDefaultLabelName=true|false (BETA - default=true)
-NetworkPolicyEndPort=true|false (ALPHA - default=false)
-NonPreemptingPriority=true|false (BETA - default=true)
-PodAffinityNamespaceSelector=true|false (ALPHA - default=false)
-PodDeletionCost=true|false (ALPHA - default=false)
-PodOverhead=true|false (BETA - default=true)
-PreferNominatedNode=true|false (ALPHA - default=false)
-ProbeTerminationGracePeriod=true|false (ALPHA - default=false)
+LogarithmicScaleDown=true|false (BETA - default=true)
+MaxUnavailableStatefulSet=true|false (ALPHA - default=false)
+MemoryManager=true|false (BETA - default=true)
+MemoryQoS=true|false (ALPHA - default=false)
+MinDomainsInPodTopologySpread=true|false (ALPHA - default=false)
+MixedProtocolLBService=true|false (BETA - default=true)
+NetworkPolicyEndPort=true|false (BETA - default=true)
+NetworkPolicyStatus=true|false (ALPHA - default=false)
+NodeOutOfServiceVolumeDetach=true|false (ALPHA - default=false)
+NodeSwap=true|false (ALPHA - default=false)
+OpenAPIEnums=true|false (BETA - default=true)
+OpenAPIV3=true|false (BETA - default=true)
+PodAndContainerStatsFromCRI=true|false (ALPHA - default=false)
+PodDeletionCost=true|false (BETA - default=true)
+PodSecurity=true|false (BETA - default=true)
+ProbeTerminationGracePeriod=true|false (BETA - default=false)
ProcMountType=true|false (ALPHA - default=false)
+ProxyTerminatingEndpoints=true|false (ALPHA - default=false)
QOSReserved=true|false (ALPHA - default=false)
+ReadWriteOncePod=true|false (ALPHA - default=false)
+RecoverVolumeExpansionFailure=true|false (ALPHA - default=false)
RemainingItemCount=true|false (BETA - default=true)
-RemoveSelfLink=true|false (BETA - default=true)
RotateKubeletServerCertificate=true|false (BETA - default=true)
-ServerSideApply=true|false (BETA - default=true)
-ServiceInternalTrafficPolicy=true|false (ALPHA - default=false)
-ServiceLBNodePortControl=true|false (ALPHA - default=false)
-ServiceLoadBalancerClass=true|false (ALPHA - default=false)
-ServiceTopology=true|false (ALPHA - default=false)
-SetHostnameAsFQDN=true|false (BETA - default=true)
-SizeMemoryBackedVolumes=true|false (ALPHA - default=false)
+SeccompDefault=true|false (ALPHA - default=false)
+ServerSideFieldValidation=true|false (ALPHA - default=false)
+ServiceIPStaticSubrange=true|false (ALPHA - default=false)
+ServiceInternalTrafficPolicy=true|false (BETA - default=true)
+SizeMemoryBackedVolumes=true|false (BETA - default=true)
+StatefulSetAutoDeletePVC=true|false (ALPHA - default=false)
+StatefulSetMinReadySeconds=true|false (BETA - default=true)
StorageVersionAPI=true|false (ALPHA - default=false)
StorageVersionHash=true|false (BETA - default=true)
-SuspendJob=true|false (ALPHA - default=false)
-TTLAfterFinished=true|false (BETA - default=true)
-TopologyAwareHints=true|false (ALPHA - default=false)
+TopologyAwareHints=true|false (BETA - default=true)
TopologyManager=true|false (BETA - default=true)
-ValidateProxyRedirects=true|false (BETA - default=true)
VolumeCapacityPriority=true|false (ALPHA - default=false)
-WarningHeaders=true|false (BETA - default=true)
WinDSR=true|false (ALPHA - default=false)
WinOverlay=true|false (BETA - default=true)
-WindowsEndpointSliceProxying=true|false (BETA - default=true) +WindowsHostProcessContainers=true|false (BETA - default=true) --> 一组 key=value 对,描述了 alpha/experimental 特征开关。选项包括:
A set of key=value pairs that describe feature gates for alpha/experimental features. Options are:
@@ -433,98 +368,102 @@ APIListChunking=true|false (BETA - 默认值=true)
APIPriorityAndFairness=true|false (BETA - 默认值=true)
APIResponseCompression=true|false (BETA - 默认值=true)
APIServerIdentity=true|false (ALPHA - 默认值=false)
+APIServerTracing=true|false (ALPHA - 默认值=false)
AllAlpha=true|false (ALPHA - 默认值=false)
AllBeta=true|false (BETA - 默认值=false)
-AnyVolumeDataSource=true|false (ALPHA - 默认值=false)
+AnyVolumeDataSource=true|false (BETA - 默认值=true)
AppArmor=true|false (BETA - 默认值=true)
-BalanceAttachedNodeVolumes=true|false (ALPHA - 默认值=false)
-BoundServiceAccountTokenVolume=true|false (BETA - 默认值=true)
CPUManager=true|false (BETA - 默认值=true)
+CPUManagerPolicyAlphaOptions=true|false (ALPHA - 默认值=false)
+CPUManagerPolicyBetaOptions=true|false (BETA - 默认值=true)
+CPUManagerPolicyOptions=true|false (BETA - 默认值=true)
CSIInlineVolume=true|false (BETA - 默认值=true)
CSIMigration=true|false (BETA - 默认值=true)
CSIMigrationAWS=true|false (BETA - 默认值=false)
-CSIMigrationAzureDisk=true|false (BETA - 默认值=false)
CSIMigrationAzureFile=true|false (BETA - 默认值=false)
-CSIMigrationGCE=true|false (BETA - 默认值=false)
-CSIMigrationOpenStack=true|false (BETA - 默认值=true)
+CSIMigrationGCE=true|false (BETA - 默认值=true)
+CSIMigrationPortworx=true|false (ALPHA - 默认值=false)
+CSIMigrationRBD=true|false (ALPHA - 默认值=false)
CSIMigrationvSphere=true|false (BETA - 默认值=false)
-CSIMigrationvSphereComplete=true|false (BETA - 默认值=false)
-CSIServiceAccountToken=true|false (BETA - 默认值=true)
-CSIStorageCapacity=true|false (BETA - 默认值=true)
-CSIVolumeFSGroupPolicy=true|false (BETA - 默认值=true)
CSIVolumeHealth=true|false (ALPHA - 默认值=false)
-ConfigurableFSGroupPolicy=true|false (BETA - 默认值=true)
-ControllerManagerLeaderMigration=true|false (ALPHA - 默认值=false)
-CronJobControllerV2=true|false (BETA - 默认值=true)
+ContextualLogging=true|false (ALPHA - 默认值=false)
+CronJobTimeZone=true|false (ALPHA - 默认值=false)
CustomCPUCFSQuotaPeriod=true|false (ALPHA - 默认值=false)
-DaemonSetUpdateSurge=true|false (ALPHA - 默认值=false)
-DefaultPodTopologySpread=true|false (BETA - 默认值=true)
+CustomResourceValidationExpressions=true|false (ALPHA - 默认值=false)
+DaemonSetUpdateSurge=true|false (BETA - 默认值=true)
+DelegateFSGroupToCSIDriver=true|false (BETA - 默认值=true)
DevicePlugins=true|false (BETA - 默认值=true)
DisableAcceleratorUsageMetrics=true|false (BETA - 默认值=true)
-DownwardAPIHugePages=true|false (BETA - 默认值=false)
-DynamicKubeletConfig=true|false (BETA - 默认值=true)
-EfficientWatchResumption=true|false (BETA - 默认值=true)
-EndpointSliceProxying=true|false (BETA - 默认值=true)
-EndpointSliceTerminatingCondition=true|false (ALPHA - 默认值=false)
-EphemeralContainers=true|false (ALPHA - 默认值=false)
-ExpandCSIVolumes=true|false (BETA - 默认值=true)
-ExpandInUsePersistentVolumes=true|false (BETA - 默认值=true)
-ExpandPersistentVolumes=true|false (BETA - 默认值=true)
-ExperimentalHostUserNamespaceDefaulting=true|false (BETA - 默认值=false)
-GenericEphemeralVolume=true|false (BETA - 默认值=true)
+DisableCloudProviders=true|false (ALPHA - 默认值=false)
+DisableKubeletCloudCredentialProviders=true|false (ALPHA - 默认值=false)
+DownwardAPIHugePages=true|false (BETA - 默认值=true)
+EndpointSliceTerminatingCondition=true|false (BETA - 默认值=true)
+EphemeralContainers=true|false (BETA - 默认值=true)
+ExpandedDNSConfig=true|false (ALPHA - 默认值=false)
+ExperimentalHostUserNamespace默认值ing=true|false (BETA - 默认值=false)
+GRPCContainerProbe=true|false (BETA - 默认值=true)
GracefulNodeShutdown=true|false (BETA - 默认值=true)
+GracefulNodeShutdownBasedOnPodPriority=true|false (BETA - 默认值=true)
HPAContainerMetrics=true|false (ALPHA - 默认值=false)
HPAScaleToZero=true|false (ALPHA - 默认值=false)
-HugePageStorageMediumSize=true|false (BETA - 默认值=true)
-IPv6DualStack=true|false (BETA - 默认值=true)
+HonorPVReclaimPolicy=true|false (ALPHA - 默认值=false)
+IdentifyPodOS=true|false (BETA - 默认值=true)
InTreePluginAWSUnregister=true|false (ALPHA - 默认值=false)
InTreePluginAzureDiskUnregister=true|false (ALPHA - 默认值=false)
InTreePluginAzureFileUnregister=true|false (ALPHA - 默认值=false)
InTreePluginGCEUnregister=true|false (ALPHA - 默认值=false)
InTreePluginOpenStackUnregister=true|false (ALPHA - 默认值=false)
+InTreePluginPortworxUnregister=true|false (ALPHA - 默认值=false)
+InTreePluginRBDUnregister=true|false (ALPHA - 默认值=false)
InTreePluginvSphereUnregister=true|false (ALPHA - 默认值=false)
-IndexedJob=true|false (ALPHA - 默认值=false)
-IngressClassNamespacedParams=true|false (ALPHA - 默认值=false)
-KubeletCredentialProviders=true|false (ALPHA - 默认值=false)
+obMutableNodeSchedulingDirectives=true|false (BETA - 默认值=true)
+JobReadyPods=true|false (BETA - 默认值=true)
+JobTrackingWithFinalizers=true|false (BETA - 默认值=false)
+KubeletCredentialProviders=true|false (BETA - 默认值=true)
+KubeletInUserNamespace=true|false (ALPHA - 默认值=false)
KubeletPodResources=true|false (BETA - 默认值=true)
-KubeletPodResourcesGetAllocatable=true|false (ALPHA - 默认值=false)
+KubeletPodResourcesGetAllocatable=true|false (BETA - 默认值=true)
+LegacyServiceAccountTokenNoAutoGeneration=true|false (BETA - 默认值=true)
LocalStorageCapacityIsolation=true|false (BETA - 默认值=true)
LocalStorageCapacityIsolationFSQuotaMonitoring=true|false (ALPHA - 默认值=false)
-LogarithmicScaleDown=true|false (ALPHA - 默认值=false)
-MemoryManager=true|false (ALPHA - 默认值=false)
-MixedProtocolLBService=true|false (ALPHA - 默认值=false)
-NamespaceDefaultLabelName=true|false (BETA - 默认值=true)
-NetworkPolicyEndPort=true|false (ALPHA - 默认值=false)
-NonPreemptingPriority=true|false (BETA - 默认值=true)
-PodAffinityNamespaceSelector=true|false (ALPHA - 默认值=false)
-PodDeletionCost=true|false (ALPHA - 默认值=false)
-PodOverhead=true|false (BETA - 默认值=true)
-PreferNominatedNode=true|false (ALPHA - 默认值=false)
-ProbeTerminationGracePeriod=true|false (ALPHA - 默认值=false)
+LogarithmicScaleDown=true|false (BETA - 默认值=true)
+MaxUnavailableStatefulSet=true|false (ALPHA - 默认值=false)
+MemoryManager=true|false (BETA - 默认值=true)
+MemoryQoS=true|false (ALPHA - 默认值=false)
+MinDomainsInPodTopologySpread=true|false (ALPHA - 默认值=false)
+MixedProtocolLBService=true|false (BETA - 默认值=true)
+NetworkPolicyEndPort=true|false (BETA - 默认值=true)
+NetworkPolicyStatus=true|false (ALPHA - 默认值=false)
+NodeOutOfServiceVolumeDetach=true|false (ALPHA - 默认值=false)
+NodeSwap=true|false (ALPHA - 默认值=false)
+OpenAPIEnums=true|false (BETA - 默认值=true)
+OpenAPIV3=true|false (BETA - 默认值=true)
+PodAndContainerStatsFromCRI=true|false (ALPHA - 默认值=false)
+PodDeletionCost=true|false (BETA - 默认值=true)
+PodSecurity=true|false (BETA - 默认值=true)
+ProbeTerminationGracePeriod=true|false (BETA - 默认值=false)
ProcMountType=true|false (ALPHA - 默认值=false)
+ProxyTerminatingEndpoints=true|false (ALPHA - 默认值=false)
QOSReserved=true|false (ALPHA - 默认值=false)
+ReadWriteOncePod=true|false (ALPHA - 默认值=false)
+RecoverVolumeExpansionFailure=true|false (ALPHA - 默认值=false)
RemainingItemCount=true|false (BETA - 默认值=true)
-RemoveSelfLink=true|false (BETA - 默认值=true)
RotateKubeletServerCertificate=true|false (BETA - 默认值=true)
-ServerSideApply=true|false (BETA - 默认值=true)
-ServiceInternalTrafficPolicy=true|false (ALPHA - 默认值=false)
-ServiceLBNodePortControl=true|false (ALPHA - 默认值=false)
-ServiceLoadBalancerClass=true|false (ALPHA - 默认值=false)
-ServiceTopology=true|false (ALPHA - 默认值=false)
-SetHostnameAsFQDN=true|false (BETA - 默认值=true)
-SizeMemoryBackedVolumes=true|false (ALPHA - 默认值=false)
+Seccomp默认值=true|false (ALPHA - 默认值=false)
+ServerSideFieldValidation=true|false (ALPHA - 默认值=false)
+ServiceIPStaticSubrange=true|false (ALPHA - 默认值=false)
+ServiceInternalTrafficPolicy=true|false (BETA - 默认值=true)
+SizeMemoryBackedVolumes=true|false (BETA - 默认值=true)
+StatefulSetAutoDeletePVC=true|false (ALPHA - 默认值=false)
+StatefulSetMinReadySeconds=true|false (BETA - 默认值=true)
StorageVersionAPI=true|false (ALPHA - 默认值=false)
StorageVersionHash=true|false (BETA - 默认值=true)
-SuspendJob=true|false (ALPHA - 默认值=false)
-TTLAfterFinished=true|false (BETA - 默认值=true)
-TopologyAwareHints=true|false (ALPHA - 默认值=false)
+TopologyAwareHints=true|false (BETA - 默认值=true)
TopologyManager=true|false (BETA - 默认值=true)
-ValidateProxyRedirects=true|false (BETA - 默认值=true)
VolumeCapacityPriority=true|false (ALPHA - 默认值=false)
-WarningHeaders=true|false (BETA - 默认值=true)
WinDSR=true|false (ALPHA - 默认值=false)
WinOverlay=true|false (BETA - 默认值=true)
-WindowsEndpointSliceProxying=true|false (BETA - 默认值=true) +WindowsHostProcessContainers=true|false (BETA - 默认值=true) @@ -666,10 +605,9 @@ The interval between attempts by the acting master to renew a leadership slot be -在领导者选举期间用于锁定的资源对象的类型。支持的选项是 `endpoints`、 -`configmaps`、`leases`、`endpointleases` 和 `configmapsleases`。 +在领导者选举期间用于锁定的资源对象的类型。支持的选项有 `leases`、`endpointleases` 和 `configmapsleases`。 @@ -736,55 +674,6 @@ DEPRECATED: define the namespace of the lock object. Will be removed in favor of - ---log-backtrace-at <a string in the form 'file:N'>      -默认值: 0 - - - - -当记录命中行文件 file 的第 N 行时输出堆栈跟踪。 - - - - ---log-dir string - - - - -如果为非空,则在此目录中写入日志文件。 - - - - ---log-file string - - - - -如果为非空,则使用此文件作为日志文件。 - - - - ---log-file-max-size uint     默认值:1800 - - - - -定义日志文件可以增长到的最大值。单位为兆字节。 -如果值为 0,则最大文件大小为无限制。 - - --log-flush-frequency duration     默认值:5s @@ -804,19 +693,19 @@ Maximum number of seconds between log flushes -设置日志格式。可选格式:“json”,“text”。
+设置日志格式。可选格式:“text”。
采用非默认格式时,以下标识不会生效: --add-dir-header, --alsologtostderr, --log-backtrace-at, --log-dir, --log-file, --log-file-max-size, --logtostderr, --one-output, --skip-headers, --skip-log-headers, ---stderrthreshold, --vmodule, --log-flush-frequency.
+--stderrthreshold, --vmodule.
非默认选项目前处于 Alpha 阶段,有可能会出现变更且无事先警告。 @@ -845,18 +734,6 @@ Kubernetes API 服务器的地址(覆盖 kubeconfig 中的任何值)。 - ---one-output - - - - -若此标志为 true,则日志仅写入其自身的严重性级别,而不会写入所有较低严重性级别。 - - - --permit-address-sharing @@ -887,58 +764,19 @@ If true, SO_REUSEPORT will be used when binding the port, which allows more than ---policy-config-file string - - - - -已弃用:包含调度器策略配置的文件。 -当策略 ConfigMap 为提供时,或者 --use-legacy-policy-config=true 时使用此文件。 -注意:当此标志与插件配置一起使用时,调度器会失败。 - - - ---policy-configmap string +--pod-max-in-unschedulable-pods-duration duration     默认值:5m0s -已弃用: 包含调度器策略配置的 ConfigMap 对象的名称。 -如果 --use-legacy-policy-config=false,则它必须在调度器初始化之前存在于 -系统命名空间中。配置数据必须对应 'data' 映射中键名为 'policy.cfg' 的元素的值。 -注意:如果与插件配置一起使用,调度器会失败。 - - +已弃用:Pod 可以在 unschedulablePods 中停留的最长时间。 +如果 Pod 在 unschedulablePods 中停留的时间超过此值,则该 pod 将被从 +unschedulablePods 移动到 backoffQ 或 activeQ。 +此标志已弃用,将在 1.2 中删除。 - ---policy-configmap-namespace string     默认值:"kube-system" - - - - -已弃用: 策略 ConfigMap 所在的名字空间。如果未提供或为空,则将使用 kube-system 名字空间。 -注意:如果与插件配置一起使用,调度器会失败。 - - - - ---port int     默认值:10251 - - - - -已弃用: 在没有身份验证和鉴权的情况下不安全地为 HTTP 服务的端口。 -如果为 0,则根本不提供 HTTP。请参见 --secure-port。 -如果 --config 指定了一个配置文件,这个参数将被忽略。 @@ -1023,21 +861,6 @@ List of request headers to inspect for usernames. X-Remote-User is common. - ---scheduler-name string      -默认值:"default-scheduler" - - - - -已弃用: 调度器名称,用于根据 Pod 的 “spec.schedulerName” 选择此 -调度器将处理的 Pod。 -如果 --config 指定了一个配置文件,那么这个参数将被忽略 - - - --secure-port int     默认值:10259 @@ -1065,41 +888,6 @@ The previous version for which you want to show hidden metrics. Only the previou - ---skip-headers - - - - -如果为 true,日志消息中不再写入头部前缀。 - - - - ---skip-log-headers - - - - -如果为 true,则在打开日志文件时忽略其头部。 - - - - ---stderrthreshold int     默认值:2 - - - - -达到或超过此阈值的日志会被写入到标准错误输出。 - - --tls-cert-file string @@ -1178,19 +966,6 @@ A pair of x509 certificate and private key file paths, optionally suffixed with - ---use-legacy-policy-config - - - - -已弃用:设置为 true 时,调度程序将忽略策略 ConfigMap 并使用策略配置文件。 -注意:当此标志与插件配置一起使用时,调度器会失败。 - - - -v, --v int @@ -1216,14 +991,14 @@ Print version information and quit ---vmodule <逗号分隔的 ‘模式=N’ 配置列表> +--vmodule pattern=N,... -以逗号分隔的 ‘模式=N’ 设置列表,用于文件过滤的日志记录。 +以逗号分隔的 ‘模式=N’ 设置列表,用于文件过滤的日志记录(仅适用于文本日志格式)。 From e36848aa137695bc296933fdb5af4557931db99d Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 21:39:29 +0800 Subject: [PATCH 061/245] [zh] sync v1.24 kubeadm-15 --- .../generated/kubeadm_certs_renew_all.md | 61 ++++++++----------- ...e_control-plane-join_mark-control-plane.md | 37 +++++++---- .../kubeadm_reset_phase_preflight.md | 33 +++++++--- 3 files changed, 76 insertions(+), 55 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_all.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_all.md index 2ac56da0dd..28a9fbd42f 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_all.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_all.md @@ -1,3 +1,18 @@ + + + +续订所有可用证书 -存储证书的路径。 +

存储证书的路径。

@@ -48,33 +63,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 - - - - ---csr-dir string - - - - -输出 CSR 和私钥的路径 - - - - ---csr-only - - - - -创建 CSR 而不是生成证书 +

kubeadm 配置文件的路径。

@@ -84,9 +75,9 @@ Create CSRs instead of generating certificates -all 操作的帮助命令 +

all 操作的帮助命令

@@ -101,10 +92,10 @@ all 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。 -如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 +

与集群通信时使用的 kubeconfig 文件。 +如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -141,9 +132,9 @@ Use the Kubernetes certificate API to renew certificates -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_mark-control-plane.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_mark-control-plane.md index 3ce1d641a5..ad52e01bbb 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_mark-control-plane.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_mark-control-plane.md @@ -1,3 +1,18 @@ + + + +将节点标记为控制平面节点 -将 Node 节点标记为控制平面节点 +将节点标记为控制平面节点 ``` kubeadm join phase control-plane-join mark-control-plane [flags] @@ -34,9 +49,9 @@ kubeadm join phase control-plane-join mark-control-plane [flags] -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -46,9 +61,9 @@ kubeadm 配置文件的路径。 -在此节点上创建一个新的控制平面实例 +

在此节点上创建一个新的控制平面实例

@@ -58,9 +73,9 @@ Create a new control plane instance on this node -mark-control-plane 操作的帮助命令 +

mark-control-plane 操作的帮助命令

@@ -70,9 +85,9 @@ mark-control-plane 操作的帮助命令 -指定节点的名称 +

指定节点的名称。

@@ -98,9 +113,9 @@ Specify the node name. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_preflight.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_preflight.md index 976749eb5e..acce31aaca 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_preflight.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_preflight.md @@ -1,3 +1,18 @@ + + + +运行重置启动前检查 -在不提示确认的情况下重置节点。 +

在不提示确认的情况下重置节点。

@@ -46,21 +61,21 @@ Reset the node without prompting for confirmation. -preflight 操作的帮助命令 +

preflight 操作的帮助命令

---ignore-preflight-errors stringSlice +--ignore-preflight-errors strings -错误将显示为警告的检查列表;例如:'IsPrivilegedUser,Swap'。取值为 'all' 时将忽略检查中的所有错误。 +

错误将显示为警告的检查列表;例如:'IsPrivilegedUser,Swap'。取值为 'all' 时将忽略检查中的所有错误。

@@ -86,9 +101,9 @@ A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedU -[实验] 指向 '真实' 宿主机根文件系统的路径。 +

[实验] 指向 '真实' 宿主机根文件系统的路径。

From 7cab365265de114a5ca28218657b19836a2631e2 Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 22:11:47 +0800 Subject: [PATCH 062/245] [zh] sync v1.24 kubeadm-16 --- .../kubeadm_init_phase_kubeconfig_admin.md | 51 ++++++++----- ...ase_control-plane-prepare_control-plane.md | 71 +++++++++++-------- 2 files changed, 76 insertions(+), 46 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_admin.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_admin.md index 2384f2f9c0..2521e85e9f 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_admin.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_admin.md @@ -1,3 +1,18 @@ + + + +为管理员(admin)和 kubeadm 本身生成 kubeconfig 文件 -API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。

@@ -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. -admin 操作的帮助命令 +

admin 操作的帮助命令

@@ -121,9 +136,9 @@ admin 操作的帮助命令 -kubeconfig 文件的保存路径。 +

kubeconfig 文件的保存路径。

@@ -138,9 +153,9 @@ kubeconfig 文件的保存路径。 -为控制平面指定特定的 Kubernetes 版本。 +

为控制平面指定特定的 Kubernetes 版本。

@@ -166,9 +181,9 @@ Choose a specific Kubernetes version for the control plane. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_control-plane.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_control-plane.md index 7f3da71e80..98528e9cfc 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_control-plane.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_control-plane.md @@ -1,3 +1,18 @@ + + + +为新的控制平面组件生成清单 -对于将要托管新的控制平面实例的节点,指定 API 服务器将公布的其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。 +

对于将要托管新的控制平面实例的节点,指定 API 服务器将公布的其正在侦听的 IP 地址。如果未设置,则使用默认网络接口。

@@ -51,9 +66,9 @@ If the node should host a new control plane instance, the IP address the API Ser -针对将要托管新的控制平面实例的节点,设置 API 服务器要绑定的端口。 +

针对将要托管新的控制平面实例的节点,设置 API 服务器要绑定的端口。

@@ -63,9 +78,9 @@ If the node should host a new control plane instance, the port for the API Serve -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -75,25 +90,9 @@ kubeadm 配置文件的路径。 -在此节点上创建一个新的控制平面实例 - - - - ---experimental-patches string - - - - -包含名为 "target[suffix][+patchtype].extension" 的文件的目录的路径。 -例如,"kube-apiserver0+merge.yaml" 或仅仅是 "etcd.json"。 -"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,并且它们与 kubectl 支持的补丁格式匹配。 -默认的 "patchtype" 为 "strategic"。 "extension" 必须为 "json" 或 "yaml"。 -"suffix" 是一个可选字符串,可用于确定首先按字母顺序应用哪些补丁。 +

在此节点上创建一个新的控制平面实例

@@ -103,9 +102,25 @@ Path to a directory that contains files named "target[suffix][+patchtype].extens -control-plane 操作的帮助命令 +

control-plane 操作的帮助命令

+ + + + +--patches string + + + + +

包含名为 "target[suffix][+patchtype].extension" 的文件的目录的路径。 +例如,"kube-apiserver0+merge.yaml" 或仅仅是 "etcd.json"。 +"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,并且它们与 kubectl 支持的补丁格式匹配。 +默认的 "patchtype" 为 "strategic"。 "extension" 必须为 "json" 或 "yaml"。 +"suffix" 是一个可选字符串,可用于确定首先按字母顺序应用哪些补丁。

@@ -131,9 +146,9 @@ control-plane 操作的帮助命令 -[实验] 指向 '真实' 宿主机根文件系统的路径。 +

[实验] 指向 '真实' 宿主机根文件系统的路径。

From 3c271d5947002a748d211a3bb203babbd1acd05f Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 22:32:56 +0800 Subject: [PATCH 063/245] [zh] sync v1.24 kubeadm-17 --- .../kubeadm_init_phase_certs_apiserver.md | 67 ++++++++------- ...kubeadm_init_phase_certs_front-proxy-ca.md | 35 +++++--- ..._phase_control-plane_controller-manager.md | 86 +++++++++++++------ 3 files changed, 122 insertions(+), 66 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md index 1b096a7424..84a86e32d3 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md @@ -1,3 +1,18 @@ + + + +生成用于服务 Kubernetes API 的证书 +生成用于服务 Kubernetes API 的证书,并将其保存到 apiserver.crt 和 apiserver.key 文件中。 -生成用于服务 Kubernetes API 的证书,并将其保存到 apiserver.cert 和 apiserver.key 文件中。 - - - -默认 SAN 是 kubernetes、kubernetes.default、kubernetes.default.svc、kubernetes.default.svc.cluster.local、10.96.0.1、127.0.0.1。 -API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。

---apiserver-cert-extra-sans stringSlice +--apiserver-cert-extra-sans strings -用于 API Server 服务证书的可选附加主体备用名称(SAN)。可以是 IP 地址和 DNS 名称。 +

用于 API Server 服务证书的可选附加主体备用名称(SAN)。可以是 IP 地址和 DNS 名称。

@@ -81,9 +90,9 @@ Optional extra Subject Alternative Names (SANs) to use for the API Server servin -证书的存储路径。 +

证书的存储路径。

@@ -93,9 +102,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -105,9 +114,9 @@ kubeadm 配置文件的路径。 -为控制平面指定一个稳定的 IP 地址或 DNS 名称。 +

为控制平面指定一个稳定的 IP 地址或 DNS 名称。

@@ -117,9 +126,9 @@ Specify a stable IP address or DNS name for the control plane. -apiserver 操作的帮助命令 +

apiserver 操作的帮助命令

@@ -134,9 +143,9 @@ apiserver 操作的帮助命令 -为控制平面指定特定的 Kubernetes 版本。 +

为控制平面指定特定的 Kubernetes 版本。

@@ -151,9 +160,9 @@ Choose a specific Kubernetes version for the control plane. -指定服务 VIP 可使用的其他 IP 地址段。 +

指定服务 VIP 可使用的其他 IP 地址段。

@@ -168,9 +177,9 @@ Use alternative range of IP address for service VIPs. -为服务使用其他域名,例如 "myorg.internal"。 +

为服务使用其他域名,例如 "myorg.internal"。

@@ -196,9 +205,9 @@ Use alternative domain for services, e.g. "myorg.internal". -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md index 3baed70fba..94b30d7ca2 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md @@ -1,3 +1,18 @@ + + + +生成自签名 CA 来提供前端代理的身份 -存储证书的路径。 +

存储证书的路径。

@@ -63,9 +78,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -75,9 +90,9 @@ kubeadm 配置文件的路径。 -front-proxy-ca 操作的帮助命令 +

front-proxy-ca 操作的帮助命令

@@ -92,9 +107,9 @@ front-proxy-ca 操作的帮助命令 -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

@@ -120,9 +135,9 @@ Choose a specific Kubernetes version for the control plane. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_controller-manager.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_controller-manager.md index d35b86f363..ed54d6d8e5 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_controller-manager.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_controller-manager.md @@ -1,3 +1,18 @@ + + + +生成 kube-controller-manager 静态 Pod 清单 -存储证书的路径。 +

存储证书的路径。

@@ -44,35 +59,35 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

---controller-manager-extra-args mapStringString +--controller-manager-extra-args <comma-separated 'key=value' pairs> -一组 <flagname>=< 形式的额外参数,传递给控制器管理器(Controller Manager) -或者覆盖其默认配置值 +

一组 <flagname>=< 形式的额外参数,传递给控制器管理器(Controller Manager) +或者覆盖其默认配置值

- - -包含名为 "target[suffix][+patchtype].extension" 的文件的目录。 -例如,"kube-apiserver0+merge.yaml" 或者 "etcd.json"。 -"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,分别与 kubectl -所支持的 patch 格式相匹配。默认的 "patchtype" 是 "strategic"。 -"extension" 必须是 "json" 或 "yaml"。 -"suffix" 是一个可选的字符串,用来确定按字母顺序排序时首先应用哪些 patch。 - +--dry-run + + +

+ +不应用任何变更,仅输出将要执行的操作 +

@@ -81,9 +96,9 @@ A set of extra flags to pass to the Controller Manager or override default ones -controller-manager 操作的帮助命令 +

controller-manager 操作的帮助命令

@@ -98,9 +113,9 @@ controller-manager 操作的帮助命令 -选择要从中拉取控制平面镜像的容器仓库 +

选择要从中拉取控制平面镜像的容器仓库

@@ -115,9 +130,26 @@ Choose a container registry to pull control plane images from -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

+ + + + +--patches string + + + + +

包含名为 "target[suffix][+patchtype].extension" 的文件的目录。 +例如,"kube-apiserver0+merge.yaml" 或者 "etcd.json"。 +"patchtype" 可以是 "strategic"、"merge" 或 "json" 之一,分别与 kubectl +所支持的 patch 格式相匹配。默认的 "patchtype" 是 "strategic"。 +"extension" 必须是 "json" 或 "yaml"。 +"suffix" 是一个可选的字符串,用来确定按字母顺序排序时首先应用哪些 patch。

@@ -127,9 +159,9 @@ Choose a specific Kubernetes version for the control plane. -指定 Pod 网络的 IP 地址范围。如果设置,控制平面将自动为每个节点分配 CIDR。 +

指定 Pod 网络的 IP 地址范围。如果设置,控制平面将自动为每个节点分配 CIDR。

@@ -154,9 +186,9 @@ Specify range of IP addresses for the pod network. If set, the control plane wil -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

From f582ad9b0696dde39cb7229b74f6d7871d049602 Mon Sep 17 00:00:00 2001 From: huangminjie Date: Wed, 18 May 2022 22:46:01 +0800 Subject: [PATCH 064/245] [zh] sync v1.24 kubeadm-18 --- .../kubeadm_init_phase_kubeconfig.md | 23 ++++++-- .../kubeadm_init_phase_kubelet-finalize.md | 23 ++++++-- .../kubeadm_init_phase_mark-control-plane.md | 33 ++++++++--- ...se_control-plane-prepare_download-certs.md | 59 ++++++++++++------- 4 files changed, 99 insertions(+), 39 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig.md index 0a5eaf2f99..753f6fd0bd 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig.md @@ -1,3 +1,18 @@ + + + +生成所有建立控制平面和管理员(admin)所需的 kubeconfig 文件 -kubeconfig 操作的帮助命令 +

kubeconfig 操作的帮助命令

@@ -62,9 +77,9 @@ kubeconfig 操作的帮助命令 -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize.md index 644a8c604e..3b13b77dd5 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-finalize.md @@ -1,3 +1,18 @@ + + + +TLS 引导后更新与 kubelet 相关的设置 ### 概要 @@ -37,8 +52,8 @@ kubeadm init phase kubelet-finalize [flags] -h, --help - -kubelet-finalize 操作的帮助命令 + +

kubelet-finalize 操作的帮助命令

@@ -60,8 +75,8 @@ kubeadm init phase kubelet-finalize [flags] --rootfs string - -[实验] 到'真实'主机根文件系统的路径。 + +

[实验] 到'真实'主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_mark-control-plane.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_mark-control-plane.md index 25cd3de7f7..0ddec0c498 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_mark-control-plane.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_mark-control-plane.md @@ -1,3 +1,18 @@ + + + +标记节点为控制平面节点 -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -63,9 +78,9 @@ kubeadm 配置文件的路径。 -mark-control-plane 操作的帮助命令 +

mark-control-plane 操作的帮助命令

@@ -75,9 +90,9 @@ mark-control-plane 操作的帮助命令 -指定节点名称。 +

指定节点名称。

@@ -103,9 +118,9 @@ Specify the node name. -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_download-certs.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_download-certs.md index 975f69e966..a0d501c29e 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_download-certs.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_download-certs.md @@ -1,3 +1,18 @@ + + + +[实验]从 kubeadm-certs Secret 下载控制平面节点之间共享的证书 -使用此密钥可以解密由 init 上传的证书 secret。 +

使用此密钥可以解密由 init 上传的证书 secret。

@@ -46,9 +61,9 @@ Use this key to decrypt the certificate secrets uploaded by init. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -58,9 +73,9 @@ kubeadm 配置文件的路径。 -在此节点上创建一个新的控制平面实例 +

在此节点上创建一个新的控制平面实例

@@ -70,9 +85,9 @@ Create a new control plane instance on this node -对于基于文件的发现,给出用于加载集群信息的文件或者 URL。 +

对于基于文件的发现,给出用于加载集群信息的文件或者 URL。

@@ -82,9 +97,9 @@ For file-based discovery, a file or URL from which to load cluster information. -对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。 +

对于基于令牌的发现,该令牌用于验证从 API 服务器获取的集群信息。

@@ -94,9 +109,9 @@ For token-based discovery, the token used to validate cluster information fetche -对于基于令牌的发现,请验证根 CA 公钥是否匹配此哈希值(格式:"<type>:<value>")。 +

对于基于令牌的发现,请验证根 CA 公钥是否匹配此哈希值(格式:"<type>:<value>")。

@@ -106,9 +121,9 @@ For token-based discovery, validate that the root CA public key matches this has -对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。 +

对于基于令牌的发现,允许在未关联 --discovery-token-ca-cert-hash 参数的情况下添加节点。

@@ -118,9 +133,9 @@ For token-based discovery, allow joining without --discovery-token-ca-cert-hash -kubeconfig 操作的帮助命令 +

download-certs 操作的帮助命令

@@ -130,9 +145,9 @@ kubeconfig 操作的帮助命令 -指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。 +

指定在加入节点时用于临时通过 Kubernetes 控制平面进行身份验证的令牌。

@@ -142,9 +157,9 @@ Specify the token used to temporarily authenticate with the Kubernetes Control P -如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。 +

如果未提供这些值,则将它们用于 discovery-token 令牌和 tls-bootstrap 令牌。

@@ -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.

criSocket: "/var/run/dockershim.sock" taints: - key: "kubeadmNode" - value: "master" + value: "someValue" effect: "NoSchedule" kubeletExtraArgs: v: 4 @@ -876,7 +876,9 @@ cluster information.

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.

From 1928ca2e9fe2334c2baa344cdf8581f188a954c2 Mon Sep 17 00:00:00 2001 From: song Date: Thu, 19 May 2022 22:31:17 +0800 Subject: [PATCH 070/245] [zh] sync memory-default-namespace.md and reconfigure-kubelet.md Signed-off-by: song --- .../memory-default-namespace.md | 133 ++-- .../administer-cluster/reconfigure-kubelet.md | 666 ++---------------- 2 files changed, 131 insertions(+), 668 deletions(-) diff --git a/content/zh/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md b/content/zh/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md index 2a1345364c..a88e74255d 100644 --- a/content/zh/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md +++ b/content/zh/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md @@ -2,35 +2,55 @@ title: 为命名空间配置默认的内存请求和限制 content_type: task weight: 10 +description: >- + 为命名空间定义默认的内存资源限制,在该命名空间中每个新建的 Pod 都会被配置上内存资源限制。 --- +本章介绍如何为{{< glossary_tooltip text="命名空间" term_id="namespace" >}}配置默认的内存请求和限制。 + +一个 Kubernetes 集群可被划分为多个命名空间。 +如果你在具有默认内存[限制](/zh/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) +的命名空间内尝试创建一个 Pod,并且这个 Pod 中的容器没有声明自己的内存资源限制, +那么{{< glossary_tooltip text="控制面" term_id="control-plane" >}}会为该容器设定默认的内存限制。 -本文介绍怎样给命名空间配置默认的内存请求和限制。 -如果在一个有默认内存限制的命名空间创建容器,该容器没有声明自己的内存限制时, -将会被指定默认内存限制。 Kubernetes 还为某些情况指定了默认的内存请求,本章后面会进行介绍。 ## {{% heading "prerequisites" %}} -{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} +{{< include "task-tutorial-prereqs.md" >}} +在你的集群里你必须要有创建命名空间的权限。 + 你的集群中的每个节点必须至少有 2 GiB 的内存。 @@ -52,12 +72,14 @@ kubectl create namespace default-mem-example ## 创建 LimitRange 和 Pod -这里给出了一个限制范围对象的配置文件。该配置声明了一个默认的内存请求和一个默认的内存限制。 +以下为 {{< glossary_tooltip text="LimitRange" term_id="limitrange" >}} 的示例清单。 +清单中声明了默认的内存请求和默认的内存限制。 {{< codenew file="admin/resource/memory-defaults.yaml" >}} @@ -71,19 +93,20 @@ kubectl apply -f https://k8s.io/examples/admin/resource/memory-defaults.yaml --n ``` -现在,如果在 default-mem-example 命名空间创建容器,并且该容器没有声明自己的内存请求和限制值, -它将被指定默认的内存请求 256 MiB 和默认的内存限制 512 MiB。 +现在如果你在 default-mem-example 命名空间中创建一个 Pod, +并且该 Pod 中所有容器都没有声明自己的内存请求和内存限制, +{{< glossary_tooltip text="控制面" term_id="control-plane" >}} +会将内存的默认请求值 256MiB 和默认限制值 512MiB 应用到 Pod 上。 -下面是具有一个容器的 Pod 的配置文件。 -容器未指定内存请求和限制。 +以下为只包含一个容器的 Pod 的清单。该容器没有声明内存请求和限制。 {{< codenew file="admin/resource/memory-defaults-pod.yaml" >}} @@ -106,7 +129,7 @@ kubectl get pod default-mem-demo --output=yaml --namespace=default-mem-example ``` 输出内容显示该 Pod 的容器有 256 MiB 的内存请求和 512 MiB 的内存限制。 @@ -134,14 +157,14 @@ kubectl delete pod default-mem-demo --namespace=default-mem-example ``` ## 声明容器的限制而不声明它的请求会怎么样? -这里给出了包含一个容器的 Pod 的配置文件。该容器声明了内存限制,而没有声明内存请求: +以下为只包含一个容器的 Pod 的清单。该容器声明了内存限制,而没有声明内存请求。 {{< codenew file="admin/resource/memory-defaults-pod-2.yaml" >}} @@ -164,8 +187,8 @@ kubectl get pod default-mem-demo-2 --output=yaml --namespace=default-mem-example ``` 输出结果显示容器的内存请求被设置为它的内存限制相同的值。注意该容器没有被指定默认的内存请求值 256MiB。 @@ -178,15 +201,15 @@ resources: ``` ## 声明容器的内存请求而不声明内存限制会怎么样? -这里给出了一个包含一个容器的 Pod 的配置文件。该容器声明了内存请求,但没有内存限制: +以下为只包含一个容器的 Pod 的清单。该容器声明了内存请求,但没有内存限制: {{< codenew file="admin/resource/memory-defaults-pod-3.yaml" >}} @@ -209,12 +232,12 @@ kubectl get pod default-mem-demo-3 --output=yaml --namespace=default-mem-example ``` -输出结果显示该容器的内存请求被设置为了容器配置文件中声明的数值。 -容器的内存限制被设置为 512MiB,即命名空间的默认内存限制。 +输出结果显示所创建的 Pod 中,容器的内存请求为 Pod 清单中声明的值。 +然而同一容器的内存限制被设置为 512MiB,此值是该命名空间的默认内存限制值。 ``` resources: @@ -227,27 +250,45 @@ resources: ## 设置默认内存限制和请求的动机 -如果你的命名空间有资源配额,那么默认内存限制是很有帮助的。 -下面是一个例子,通过资源配额为命名空间设置两项约束: +如果你的命名空间设置了内存 {{< glossary_tooltip text="资源配额" term_id="resource-quota" >}}, +那么为内存限制设置一个默认值会很有帮助。 +以下是内存资源配额对命名空间的施加的三条限制: + +* 命名空间中运行的每个 Pod 中的容器都必须有内存限制。 + (如果为 Pod 中的每个容器声明了内存限制, + Kubernetes 可以通过将其容器的内存限制相加推断出 Pod 级别的内存限制)。 + +* 内存限制用来在 Pod 被调度到的节点上执行资源预留。 + 预留给命名空间中所有 Pod 使用的内存总量不能超过规定的限制。 + +* 命名空间中所有 Pod 实际使用的内存总量也不能超过规定的限制。 -* 运行在命名空间中的每个容器必须有自己的内存限制。 -* 命名空间中所有容器的内存使用量之和不能超过声明的限制值。 +When you add a LimitRange: - -如果一个容器没有声明自己的内存限制,会被指定默认限制,然后它才会被允许在限定了配额的命名空间中运行。 +当你添加 LimitRange 时: + +如果该命名空间中的任何 Pod 的容器未指定内存限制, +控制面将默认内存限制应用于该容器, +这样 Pod 可以在受到内存 ResourceQuota 限制的命名空间中运行。 {{< caution >}} [动态 kubelet 配置](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/281-dynamic-kubelet-configuration) -已经废弃不建议使用。请选择其他方法将配置分发到集群中的节点。 +功能在 Kubernetes 1.22 版本弃用,并在 1.24 版本中移除。 +请选择其他方法将配置分发到集群中的节点。 {{< /caution >}} [动态 kubelet 配置](https://github.com/kubernetes/enhancements/issues/281) -允许你通过部署一个所有节点都会使用的 ConfigMap -达到在运行中的 Kubernetes 集群中更改 kubelet 配置的目的。 +允许你通过部署并配置{{< glossary_tooltip text="节点" term_id="node" >}}使用的 +{{< glossary_tooltip text="ConfigMap" term_id="configmap" >}}, +达到更改正在运行的 Kubernetes 集群的 {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} 配置的目的。 -{{< warning >}} -所有 kubelet 配置参数都可以被动态更改,但对某些参数来说这类更改是不安全的。 -在决定动态更改参数之前,你需要深刻理解这个改动将会如何影响集群的行为。 -在将变更扩散到整个集群之前,你需要先在小规模的节点集合上仔细地测试这些配置变动。 -特定字段相关的配置建议可以在文档 -[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)中找到。 -{{< /warning >}} - -## {{% heading "prerequisites" %}} +请在 [早期版本的文档](https://v1-23.docs.kubernetes.io/zh/docs/tasks/administer-cluster/reconfigure-kubelet/) 中找到有关此功能的文档。 -你需要一个 Kubernetes 集群。 -你还需要 `kubectl`,[安装](/zh/docs/tasks/tools/#kubectl)并配置好与集群的通信。 -{{< version-check >}} -确保你使用的 `kubectl` 版本与集群 [兼容](/releases/version-skew-policy/)。 +## 不再使用动态 Kubelet 配置 + +这里没有跨不同的 Kubernetes 发行版替换这个功能的建议方法。 +如果你使用托管 Kubernetes 版本, +请咨询托管 Kubernetes 的供应商,以获得自定义 Kubernetes 的最佳实践。 +如果你使用的是 `kubeadm`,请参考 +[使用 kubeadm 配置集群中的每个 kubelet](/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration/)。 -在某些例子中使用了命令行工具 [jq](https://stedolan.github.io/jq/)。 -你并不一定需要 `jq` 才能完成这些任务,因为总是有一些手工替代的方式。 - -针对你重新配置的每个节点,你必须设置 kubelet 的标志 -`-dynamic-config-dir`,使之指向一个可写的目录。 - - +为了停止使用动态 Kubelet 配置功能, +应该使用替代机制分发 kubelet 配置文件。 +为了使配置生效,必须更新配置文件并重新启动 kubelet。 +请参考[通过配置文件设置 Kubelet 参数](/zh/docs/tasks/administer-cluster/kubelet-config-file/)。 -## 重配置 集群中运行节点上的 kubelet - -### 基本工作流程概览 - - -在运行中的集群中配置 kubelet 的基本工作流程如下: - -1. 编写一个包含 kubelet 配置的 YAML 或 JSON 文件。 -2. 将此文件包装在 ConfigMap 中并将其保存到 Kubernetes 控制平面。 -3. 更新 kubelet 所在节点对象以使用此 ConfigMap。 - - -每个 kubelet 都会在其各自的节点对象上监测(Watch)配置引用。当引用更改时,kubelet 将下载新的配置文件, -更新本地引用指向该文件,然后退出。 -为了使该功能正常地工作,你必须运行操作系统级别的服务管理器(如 systemd), -它将会在 kubelet 退出后将其重启。 -kubelet 重新启动时,将开始使用新配置。 - - -新配置将会完全地覆盖 `--config` 所提供的配置,并被命令行标志覆盖。 -新配置中未指定的值将收到适合配置版本的默认值 -(e.g. `kubelet.config.k8s.io/v1beta1`),除非被命令行标志覆盖。 - - -节点 kubelet 配置状态可通过 `node.spec.status.config` 获取。 -一旦你更新了一个节点去使用新的 ConfigMap, -就可以通过观察此状态来确认该节点是否正在使用预期配置。 - - -本文中使用命令 `kubectl edit` 来编辑节点,还有其他的方式可以修改节点的规约, -比如更利于脚本化工作流程的 `kubectl patch`。 - - -本文仅仅讲述在单节点上使用每个 ConfigMap。请注意对于多个节点使用相同的 ConfigMap -也是合法的。 - - -{{< warning >}} -尽管通过就地更新 ConfigMap 来更改配置是 *可能的*。 -但是这样做会导致所有使用该 ConfigMap 配置的 kubelet 同时更新。 -更安全的做法是按惯例将 ConfigMap 视为不可变更的,借助于 -`kubectl` 的 `--append-hash` 选项逐步把更新推广到 `node.spec.configSource`。 -{{< /warning >}} - - -### 节点鉴权器的自动 RBAC 规则 - -以前,你需要手动创建 RBAC 规则以允许节点访问其分配的 ConfigMap。节点鉴权器现在 -能够自动配置这些规则。 - - -### 生成包含当前配置的文件 - -动态 kubelet 配置特性允许你为整个配置对象提供一个重载配置,而不是靠单个字段的叠加。 -这是一个更简单的模型,可以更轻松地跟踪配置值的来源,更便于调试问题。 -然而,相应的代价是你必须首先了解现有配置,以确保你只更改你打算修改的字段。 - - -组件 kubelet 从其配置文件中加载配置数据,不过你可以通过设置命令行标志 -来重载文件中的一些配置。这意味着,如果你仅知道配置文件的内容,而你不知道 -命令行重载了哪些配置,你就无法知道 kubelet 的运行时配置是什么。 - - -因为你需要知道运行时所使用的配置才能重载之,你可以从 kubelet 取回其运行时配置。 -你可以通过访问 kubelet 的 `configz` 末端来生成包含节点当前配置的配置文件; -这一操作可以通过 `kubectl proxy` 来完成。 -下一节解释如何完成这一操作。 - - -{{< caution >}} -组件 `kubelet` 上的 `configz` 末端是用来协助调试的,并非 kubelet 稳定行为的一部分。 -请不要在产品环境下依赖此末端的行为,也不要在自动化工具中使用此末端。 -{{< /caution >}} - - -关于如何使用配置文件来配置 kubelet 行为的更多信息可参见 -[通过配置文件设置 kubelet 参数](/zh/docs/tasks/administer-cluster/kubelet-config-file) -文档。 - - -#### 生成配置文件 - - -{{< note >}} -下面的任务步骤中使用了 `jq` 命令以方便处理 JSON 数据。为了完成这里讲述的任务, -你需要安装 `jq`。如果你更希望手动提取 `kubeletconfig` 子对象,也可以对这里 -的对应步骤做一些调整。 -{{< /note >}} - - -1. 选择要重新配置的节点。在本例中,此节点的名称为 `NODE_NAME`。 -2. 使用以下命令在后台启动 kubectl 代理: - - ```shell - kubectl proxy --port=8001 & - ``` - -3. 运行以下命令从 `configz` 端点中下载并解压配置。这个命令很长,因此在复制粘贴时要小心。 - **如果你使用 zsh**,请注意常见的 zsh 配置要添加反斜杠转义 URL 中变量名称周围的大括号。 - 例如:在粘贴时,`${NODE_NAME}` 将被重写为 `$\{NODE_NAME\}`。 - 你必须在运行命令之前删除反斜杠,否则命令将失败。 - - ```bash - NODE_NAME="the-name-of-the-node-you-are-reconfiguring"; curl -sSL "http://localhost:8001/api/v1/nodes/${NODE_NAME}/proxy/configz" | jq '.kubeletconfig|.kind="KubeletConfiguration"|.apiVersion="kubelet.config.k8s.io/v1beta1"' > kubelet_configz_${NODE_NAME} - ``` - - -{{< note >}} -你需要手动将 `kind` 和 `apiVersion` 添加到下载对象中,因为它们不是由 `configz` 末端 -返回的。 -{{< /note >}} - - -#### 修改配置文件 - -使用文本编辑器,改变上述操作生成的文件中一个参数。 -例如,你或许会修改 QPS 参数 `eventRecordQPS`。 - - -#### 把配置文件推送到控制平面 - -用以下命令把编辑后的配置文件推送到控制平面: - -```bash -kubectl -n kube-system create configmap my-node-config \ - --from-file=kubelet=kubelet_configz_${NODE_NAME} \ - --append-hash -o yaml -``` - - -下面是合法响应的一个例子: - -```yaml -apiVersion: v1 -kind: ConfigMap -metadata: - creationTimestamp: 2017-09-14T20:23:33Z - name: my-node-config-gkt4c2m4b2 - namespace: kube-system - resourceVersion: "119980" - selfLink: /api/v1/namespaces/kube-system/configmaps/my-node-config-gkt4c2m4b2 - uid: 946d785e-998a-11e7-a8dd-42010a800006 -data: - kubelet: | - {...} -``` - - -你会在 `kube-system` 命名空间中创建 ConfigMap,因为 kubelet 是 Kubernetes 的系统组件。 - - -`--append-hash` 选项给 ConfigMap 内容附加了一个简短校验和。 -这对于先编辑后推送的工作流程很方便, -因为它自动并确定地为新 ConfigMap 生成新的名称。 -在以下示例中,包含生成的哈希字符串的对象名被称为 `CONFIG_MAP_NAME`。 - - -#### 配置节点使用新的配置 - -```bash -kubectl edit node ${NODE_NAME} -``` - - -在你的文本编辑器中,在 `spec` 下增添以下 YAML: - -```yaml -configSource: - configMap: - name: CONFIG_MAP_NAME - namespace: kube-system - kubeletConfigKey: kubelet -``` - - -你必须同时指定 `name`、`namespace` 和 `kubeletConfigKey` 这三个属性。 -`kubeletConfigKey` 这个参数通知 kubelet ConfigMap 中的哪个键下面包含所要的配置。 - - -#### 观察节点开始使用新配置 - -用 `kubectl get node ${NODE_NAME} -o yaml` 命令读取节点并检查 `node.status.config` 内容。 -状态部分报告了对应 `active`(使用中的)配置、`assigned`(被赋予的)配置和 -`lastKnownGood`(最近已知可用的)配置的配置源。 - -- `active` 是 kubelet 当前运行时所使用的版本。 -- `assigned` 参数是 kubelet 基于 `node.spec.configSource` 所解析出来的最新版本。 -- `lastKnownGood` 参数是 kubelet 的回退版本;如果在 `node.spec.configSource` 中 - 包含了无效的配置值,kubelet 可以回退到这个版本。 - - -如果用本地配置部署节点,使其设置成默认值,这个 `lastKnownGood` 配置可能不存在。 -在 kubelet 配置好后,将更新 `lastKnownGood` 为一个有效的 `assigned` 配置。 -决定如何确定某配置成为 `lastKnownGood` 配置的细节并不在 API 保障范畴, -不过目前实现中采用了 10 分钟的宽限期。 - - -你可以使用以下命令(使用 `jq`)过滤出配置状态: - -```bash -kubectl get no ${NODE_NAME} -o json | jq '.status.config' -``` - - -以下是一个响应示例: - -```json -{ - "active": { - "configMap": { - "kubeletConfigKey": "kubelet", - "name": "my-node-config-9mbkccg2cc", - "namespace": "kube-system", - "resourceVersion": "1326", - "uid": "705ab4f5-6393-11e8-b7cc-42010a800002" - } - }, - "assigned": { - "configMap": { - "kubeletConfigKey": "kubelet", - "name": "my-node-config-9mbkccg2cc", - "namespace": "kube-system", - "resourceVersion": "1326", - "uid": "705ab4f5-6393-11e8-b7cc-42010a800002" - } - }, - "lastKnownGood": { - "configMap": { - "kubeletConfigKey": "kubelet", - "name": "my-node-config-9mbkccg2cc", - "namespace": "kube-system", - "resourceVersion": "1326", - "uid": "705ab4f5-6393-11e8-b7cc-42010a800002" - } - } -} -``` - - -如果你没有安装 `jq`,你可以查看整个响应对象,查找其中的 `node.status.config` -部分。 - - -如果发生错误,kubelet 会在 `Node.Status.Config.Error` 中显示出错误信息的结构体。 -错误可能出现在列表[理解节点状态配置错误信息](#understanding-node-config-status-errors)中。 -你可以在 kubelet 日志中搜索相同的文本以获取更多详细信息和有关错误的上下文。 - - -#### 做出更多的改变 {#make-more-changes} - -按照下面的工作流程做出更多的改变并再次推送它们。 -你每次推送一个 ConfigMap 的新内容时,kubectl 的 `--append-hash` 选项都会给 -ConfigMap 创建一个新的名称。 -最安全的上线策略是首先创建一个新的 ConfigMap,然后更新节点以使用新的 ConfigMap。 - - -#### 重置节点以使用其本地默认配置 - -要重置节点,使其使用节点创建时使用的配置,可以用 -`kubectl edit node $ {NODE_NAME}` 命令编辑节点,并删除 `node.spec.configSource` -字段。 - - -#### 观察节点正在使用本地默认配置 - -在删除此字段后,`node.status.config` 最终变成空,所有配置源都已重置为 `nil`。 -这表示本地默认配置成为了 `assigned`、`active` 和 `lastKnownGood` 配置, -并且没有报告错误。 - - - - -## `kubectl patch` 示例 - -你可以使用几种不同的机制来更改节点的 configSource。 - -本例使用`kubectl patch`: - -```bash -kubectl patch node ${NODE_NAME} -p "{\"spec\":{\"configSource\":{\"configMap\":{\"name\":\"${CONFIG_MAP_NAME}\",\"namespace\":\"kube-system\",\"kubeletConfigKey\":\"kubelet\"}}}}" -``` - -## 了解 Kubelet 如何为配置生成检查点 - -当为节点赋予新配置时,kubelet 会下载并解压配置负载为本地磁盘上的一组文件。 -kubelet 还记录一些元数据,用以在本地跟踪已赋予的和最近已知良好的配置源,以便 -kubelet 在重新启动时知道使用哪个配置,即使 API 服务器变为不可用。 -在为配置信息和相关元数据生成检查点之后,如果检测到已赋予的配置发生改变,则 kubelet 退出。 -当 kubelet 被 OS 级服务管理器(例如 `systemd`)重新启动时,它会读取新的元数据并使用新配置。 - - -当记录的元数据已被完全解析时,意味着它包含选择一个指定的配置版本所需的所有信息 --- 通常是 `UID` 和 `ResourceVersion`。 -这与 `node.spec.configSource` 形成对比,后者通过幂等的 `namespace/name` 声明来标识 -目标 ConfigMap;kubelet 尝试使用此 ConfigMap 的最新版本。 - - -当你在调试节点上问题时,可以检查 kubelet 的配置元数据和检查点。kubelet 的检查点目录结构是: - - - -```none -- --dynamic-config-dir (用于管理动态配置的根目录) -|-- meta - | - assigned (编码后的 kubeletconfig/v1beta1.SerializedNodeConfigSource 对象,对应赋予的配置) - | - last-known-good (编码后的 kubeletconfig/v1beta1.SerializedNodeConfigSource 对象,对应最近已知可用配置) -| - checkpoints - | - uid1 (用 uid1 来标识的对象版本目录) - | - resourceVersion1 (uid1 对象 resourceVersion1 版本下所有解压文件的目录) - | - ... - | - ... -``` - - -## 理解 `Node.Status.Config.Error` 消息 {#understanding-node-config-status-errors} - -下表描述了使用动态 kubelet 配置时可能发生的错误消息。 -你可以在 kubelet 日志中搜索相同的文本来获取有关错误的其他详细信息和上下文。 - - - -{{< table caption = "理解 node.status.config.error 消息" >}} - 错误信息 | 可能的原因 -:----------------| :---------------- -failed to load config, see Kubelet log for details | kubelet 可能无法解析下载配置的有效负载,或者当尝试从磁盘中加载有效负载时,遇到文件系统错误。 -failed to validate config, see Kubelet log for details | 有效负载中的配置,与命令行标志所产生的覆盖配置以及特行门控的组合、配置文件本身、远程负载被 kubelet 判定为无效。 -invalid NodeConfigSource, exactly one subfield must be non-nil, but all were nil | 由于 API 服务器负责对 node.spec.configSource 执行验证,检查其中是否包含至少一个非空子字段,这个消息可能意味着 kubelet 比 API 服务器版本低,因而无法识别更新的源类型。 -failed to sync: failed to download config, see Kubelet log for details | kubelet 无法下载配置数据。可能是 node.spec.configSource 无法解析为具体的 API 对象,或者网络错误破坏了下载。处于此错误状态时,kubelet 将重新尝试下载。 -failed to sync: internal failure, see Kubelet log for details | kubelet 遇到了一些内部问题,因此无法更新其配置。 例如:发生文件系统错误或无法从内部缓存中读取对象。 -internal failure, see Kubelet log for details | 在对配置进行同步的循环之外操作配置时,kubelet 遇到了一些内部问题。 - -{{< /table >}} - -## {{% heading "whatsnext" %}} - - -- [使用配置文件设置 kubelet 参数](/zh/docs/tasks/administer-cluster/kubelet-config-file)说明了配置 kubelet 的方法。 -- 阅读 Node 的参考文档,包括 [.spec](/docs/reference/kubernetes-api/cluster-resources/node-v1/#NodeSpec) 里的 `configSource` 字段 -- 查阅[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)文献进一步了解 kubelet - 配置信息。 \ No newline at end of file +请注意,从 v1.24 开始 `DynamicKubeletConfig` 特性门控无法在 kubelet 上设置, +因为不会生效。在 v1.26 之前 API 服务器和控制器管理器不会移除该特性门控。 +这是专为控制面支持有旧版本 kubelet 的节点以及满足 [Kubernetes 版本偏差策略](/releases/version-skew-policy/)。 \ No newline at end of file From 6c8214b895d39ffca23c5b044ad316e6abb4c6a5 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 May 2022 20:42:26 +0800 Subject: [PATCH 071/245] [zh] sync v1.24 cluster-role-binding-v1.md --- .../cluster-role-binding-v1.md | 619 ++++++++++++++++++ 1 file changed, 619 insertions(+) create mode 100644 content/zh/docs/reference/kubernetes-api/authorization-resources/cluster-role-binding-v1.md diff --git a/content/zh/docs/reference/kubernetes-api/authorization-resources/cluster-role-binding-v1.md b/content/zh/docs/reference/kubernetes-api/authorization-resources/cluster-role-binding-v1.md new file mode 100644 index 0000000000..fbfa9dd428 --- /dev/null +++ b/content/zh/docs/reference/kubernetes-api/authorization-resources/cluster-role-binding-v1.md @@ -0,0 +1,619 @@ +--- +api_metadata: + apiVersion: "rbac.authorization.k8s.io/v1" + import: "k8s.io/api/rbac/v1" + kind: "ClusterRoleBinding" +content_type: "api_reference" +description: "ClusterRoleBinding 引用 ClusterRole,但不包含它。" +title: "ClusterRoleBinding" +weight: 6 +auto_generated: false +--- + + +`apiVersion: rbac.authorization.k8s.io/v1` + +`import "k8s.io/api/rbac/v1"` + +## ClusterRoleBinding {#ClusterRoleBinding} + +ClusterRoleBinding 引用 ClusterRole,但不包含它。 +它可以引用全局命名空间中的 ClusterRole,并通过 Subject 添加主体信息。 + +
+ +- **apiVersion**: rbac.authorization.k8s.io/v1 + +- **kind**: ClusterRoleBinding + +- **metadata** (}}">ObjectMeta) + + 标准对象的元数据。 + +- **roleRef** (RoleRef),必需 + + RoleRef 只能引用全局命名空间中的 ClusterRole。 + 如果无法解析 RoleRef,则 Authorizer 必定返回一个错误。 + + + **RoleRef 包含指向正被使用的角色的信息。** + + - **roleRef.apiGroup** (string),必需 + + apiGroup 是被引用资源的组 + + - **roleRef.kind** (string),必需 + + kind 是被引用的资源的类别 + + - **roleRef.name** (string),必需 + + name 是被引用的资源的名称 + +- **subjects** ([]Subject) + + Subjects 包含角色所适用的对象的引用。 + + + **Subject 包含对角色绑定所适用的对象或用户标识的引用。其中可以包含直接 API 对象的引用或非对象(如用户名和组名)的值。** + + - **subjects.kind** (string),必需 + + 被引用的对象的类别。这个 API 组定义的值是 `User`、`Group` 和 `ServiceAccount`。 + 如果 Authorizer 无法识别类别值,则 Authorizer 应报告一个错误。 + + - **subjects.name** (string),必需 + + 被引用的对象的名称。 + + - **subjects.apiGroup** (string) + + apiGroup 包含被引用主体的 API 组。对于 ServiceAccount 主体默认为 ""。 + 对于 User 和 Group 主体,默认为 "rbac.authorization.k8s.io"。 + + - **subjects.namespace** (string) + + 被引用对象的命名空间。 + 如果对象类别是 "User" 或 "Group" 等非命名空间作用域的对象且该值不为空, + 则 Authorizer 应报告一个错误。 + +## ClusterRoleBindingList {#ClusterRoleBindingList} + +ClusterRoleBindingList 是 ClusterRoleBinding 的集合。 + +
+ +- **apiVersion**: rbac.authorization.k8s.io/v1 + +- **kind**: ClusterRoleBindingList + +- **metadata** (}}">ListMeta) + + 标准的对象元数据。 + +- **items** ([]}}">ClusterRoleBinding),必需 + + items 是 ClusterRoleBindings 的列表。 + +## 操作 {#Operations} + +
+ + +### `get` 读取指定的 ClusterRoleBinding + +#### HTTP 请求 + +GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} + +#### 参数 + +- **name** (**路径参数**): string,必需 + + ClusterRoleBinding 的名称 + +- **pretty** (**查询参数**): string + + }}">pretty + +#### 响应 + +200 (}}">ClusterRoleBinding): OK + +401: Unauthorized + +### `list` 列出或观测类别为 ClusterRoleBinding 的对象 + +#### HTTP 请求 + +GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings + +#### 参数 + +- **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 (}}">ClusterRoleBindingList): OK + +401: Unauthorized + +### `create` 创建 ClusterRoleBinding + +#### HTTP 请求 + +POST /apis/rbac.authorization.k8s.io/v1/clusterrolebindings + +#### 参数 + +- **body**: }}">ClusterRoleBinding,必需 + +- **dryRun** (**查询参数**): string + + }}">dryRun + +- **fieldManager** (**查询参数**): string + + }}">fieldManager + +- **fieldValidation** (**查询参数**): string + + }}">fieldValidation + +- **pretty** (**查询参数**): string + + }}">pretty + +#### 响应 + +200 (}}">ClusterRoleBinding): OK + +201 (}}">ClusterRoleBinding): Created + +202 (}}">ClusterRoleBinding): Accepted + +401: Unauthorized + +### `update` 替换指定的 ClusterRoleBinding + +#### HTTP 请求 + +PUT /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} + +#### 参数 + +- **name** (**路径参数**): string,必需 + + ClusterRoleBinding 的名称 + +- **body**: }}">ClusterRoleBinding,必需 + +- **dryRun** (**查询参数**): string + + }}">dryRun + +- **fieldManager** (**查询参数**): string + + }}">fieldManager + +- **fieldValidation** (**查询参数**): string + + }}">fieldValidation + +- **pretty** (**查询参数**): string + + }}">pretty + +#### 响应 + +200 (}}">ClusterRoleBinding): OK + +201 (}}">ClusterRoleBinding): Created + +401: Unauthorized + +### `patch` 部分更新指定的 ClusterRoleBinding + +#### HTTP 请求 + +PATCH /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} + +#### 参数 + +- **name** (**路径参数**): string,必需 + + ClusterRoleBinding 的名称 + +- **body**: }}">Patch,必需 + +- **dryRun** (**查询参数**): string + + }}">dryRun + +- **fieldManager** (**查询参数**): string + + }}">fieldManager + +- **fieldValidation** (**查询参数**): string + + }}">fieldValidation + +- **force** (**查询参数**): boolean + + }}">force + +- **pretty** (**查询参数**): string + + }}">pretty + +#### 响应 + +200 (}}">ClusterRoleBinding): OK + +201 (}}">ClusterRoleBinding): Created + +401: Unauthorized + +### `delete` 删除 ClusterRoleBinding + +#### HTTP 请求 + +DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} + +#### 参数 + +- **name** (**路径参数**): string,必需 + + ClusterRoleBinding 的名称 + +- **body**: }}">DeleteOptions + +- **dryRun** (**查询参数**): string + + }}">dryRun + +- **gracePeriodSeconds** (**查询参数**): integer + + }}">gracePeriodSeconds + +- **pretty** (**查询参数**): string + + }}">pretty + +- **propagationPolicy** (**查询参数**): string + + }}">propagationPolicy + +#### 响应 + +200 (}}">Status): OK + +202 (}}">Status): Accepted + +401: Unauthorized + +### `deletecollection` 删除 ClusterRoleBinding 的集合 + +#### HTTP 请求 + +DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings + +#### 参数 + +- **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 3201e8404561026f4d6cc05fcab46ca3a0461663 Mon Sep 17 00:00:00 2001 From: ut003055 Date: Fri, 20 May 2022 10:35:58 +0800 Subject: [PATCH 072/245] translate binding page --- .../cluster-resources/binding-v1.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md diff --git a/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md b/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md new file mode 100644 index 0000000000..a76cc3071a --- /dev/null +++ b/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md @@ -0,0 +1,228 @@ +--- +api_metadata: + apiVersion: "v1" + import: "k8s.io/api/core/v1" + kind: "Binding" +content_type: "api_reference" +description: "Binding 即将一个对象与另一个对象联系起来;例如,一个 pod 被调度程序绑定到一个节点。" +title: "Binding" +weight: 9 +auto_generated: true +--- + + + +`apiVersion: v1` + +`import "k8s.io/api/core/v1"` + + +## Binding {#Binding} + +Binding 即将一个对象与另一个对象联系起来;例如,一个 pod 被调度程序绑定到一个节点。1.7已弃用,请使用 pods 的 bindings 子资源。 +
+ +- **apiVersion**: v1 + + +- **kind**: Binding + + +- **metadata** (}}">ObjectMeta) + + 标准对象的元数据 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + +- **target** (}}">ObjectReference), 必需的 + + 要绑定到标准对象的目标对象。 + +## Operations {#Operations} + +
+ + +### `创建` 创建一个 Binding + +#### HTTP 请求 + +POST /api/v1/namespaces/{namespace}/bindings + +#### 参数 + + +- **namespace** (**在路径上**): string, 必需的 + + }}">namespace + + +- **body**: }}">Binding, 必需的 + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **fieldManager** (**查询字符串**): string + + }}">fieldManager + + + + +- **fieldValidation** (**查询字符串**): string + + }}">fieldValidation + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +#### 响应 + +200 (}}">Binding): OK + +201 (}}">Binding): Created + +202 (}}">Binding): Accepted + +401: Unauthorized + + +### `create` 创建Pod的绑定 + +#### HTTP 请求 + +POST /api/v1/namespaces/{namespace}/pods/{name}/binding + +#### 参数 + +- **name** (*在路径内*): string, 必需的 + + Binding 的名称 + +- **namespace** (*在路径内*): string, 必需的 + + }}">namespace + +- **body**: }}">Binding, 必需的 + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **fieldManager** (**查询字符串**): string + + }}">fieldManager + +- **fieldValidation** (**查询字符串**): string + + }}">fieldValidation + +- **pretty** (**查询字符串**): string + + }}">pretty + +#### 响应 + +200 (}}">Binding): OK + +201 (}}">Binding): Created + +202 (}}">Binding): Accepted + +401: Unauthorized From b22767686e8d7a1eb52039a642c65b2a04645609 Mon Sep 17 00:00:00 2001 From: Guangwen Feng Date: Thu, 19 May 2022 17:08:34 +0800 Subject: [PATCH 073/245] [zh] Fix incorrect description for Service in endpoint-slices.md Signed-off-by: Guangwen Feng --- .../services-networking/endpoint-slices.md | 95 +++++++++---------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/content/zh/docs/concepts/services-networking/endpoint-slices.md b/content/zh/docs/concepts/services-networking/endpoint-slices.md index 447caae39c..05f808a1a9 100644 --- a/content/zh/docs/concepts/services-networking/endpoint-slices.md +++ b/content/zh/docs/concepts/services-networking/endpoint-slices.md @@ -52,11 +52,11 @@ significant amounts of network traffic and processing when Endpoints changed. EndpointSlices help you mitigate those issues as well as provide an extensible platform for additional features such as topological routing. --> -由于任一服务的所有网络端点都保存在同一个 Endpoints 资源中,这类资源可能变得 -非常巨大,而这一变化会影响到 Kubernetes 组件(比如主控组件)的性能,并 -在 Endpoints 变化时产生大量的网络流量和额外的处理。 -EndpointSlice 能够帮助你缓解这一问题,还能为一些诸如拓扑路由这类的额外 -功能提供一个可扩展的平台。 +由于任一 Service 的所有网络端点都保存在同一个 Endpoints 资源中, +这类资源可能变得非常巨大,而这一变化会影响到 Kubernetes +组件(比如主控组件)的性能,并在 Endpoints 变化时产生大量的网络流量和额外的处理。 +EndpointSlice 能够帮助你缓解这一问题, +还能为一些诸如拓扑路由这类的额外功能提供一个可扩展的平台。 -在 v1 API 中,逐个端点设置的 `topology` 实际上被去除,以鼓励使用专用 -的字段 `nodeName` 和 `zone`。 +在 v1 API 中,逐个端点设置的 `topology` 实际上被去除, +以鼓励使用专用的字段 `nodeName` 和 `zone`。 -对 `EndpointSlice` 对象的 `endpoint` 字段设置任意的拓扑结构信息这一操作已被 -废弃,不再被 v1 API 所支持。取而代之的是 v1 API 所支持的 `nodeName` 和 `zone` +对 `EndpointSlice` 对象的 `endpoint` 字段设置任意的拓扑结构信息这一操作已被废弃, +不再被 v1 API 所支持。取而代之的是 v1 API 所支持的 `nodeName` 和 `zone` 这些独立的字段。这些字段可以在不同的 API 版本之间自动完成转译。 -例如,v1beta1 API 中 `topology` 字段的 `topology.kubernetes.io/zone` 取值可以 -在 v1 API 中通过 `zone` 字段访问。 +例如,v1beta1 API 中 `topology` 字段的 `topology.kubernetes.io/zone` +取值可以在 v1 API 中通过 `zone` 字段访问。 {{< /note >}} ### 属主关系 {#ownership} -在大多数场合下,EndpointSlice 都由某个 Service 所有,(因为)该端点切片正是 -为该服务跟踪记录其端点。这一属主关系是通过为每个 EndpointSlice 设置一个 -属主(owner)引用,同时设置 `kubernetes.io/service-name` 标签来标明的, -目的是方便查找隶属于某服务的所有 EndpointSlice。 +在大多数场合下,EndpointSlice 都由某个 Service 所有, +(因为)该端点切片正是为该服务跟踪记录其端点。这一属主关系是通过为每个 EndpointSlice +设置一个属主(owner)引用,同时设置 `kubernetes.io/service-name` 标签来标明的, +目的是方便查找隶属于某 Service 的所有 EndpointSlice。 ### EndpointSlice 镜像 {#endpointslice-mirroring} -在某些场合,应用会创建定制的 Endpoints 资源。为了保证这些应用不需要并发 -的更改 Endpoints 和 EndpointSlice 资源,集群的控制面将大多数 Endpoints +在某些场合,应用会创建定制的 Endpoints 资源。为了保证这些应用不需要并发的更改 +Endpoints 和 EndpointSlice 资源,集群的控制面将大多数 Endpoints 映射到对应的 EndpointSlice 之上。 -控制面尝试尽量将 EndpointSlice 填满,不过不会主动地在若干 EndpointSlice 之间 -执行再平衡操作。这里的逻辑也是相对直接的: +控制面尝试尽量将 EndpointSlice 填满,不过不会主动地在若干 EndpointSlice +之间执行再平衡操作。这里的逻辑也是相对直接的: -1. 列举所有现有的 EndpointSlices,移除那些不再需要的端点并更新那些已经 - 变化的端点。 +1. 列举所有现有的 EndpointSlices,移除那些不再需要的端点并更新那些已经变化的端点。 2. 列举所有在第一步中被更改过的 EndpointSlices,用新增加的端点将其填满。 3. 如果还有新的端点未被添加进去,尝试将这些端点添加到之前未更改的切片中, 或者创建新切片。 @@ -403,11 +402,11 @@ this approach will create a new EndpointSlice instead of filling up the 2 existing EndpointSlices. In other words, a single EndpointSlice creation is preferrable to multiple EndpointSlice updates. --> -这里比较重要的是,与在 EndpointSlice 之间完成最佳的分布相比,第三步中更看重 -限制 EndpointSlice 更新的操作次数。例如,如果有 10 个端点待添加,有两个 -EndpointSlice 中各有 5 个空位,上述方法会创建一个新的 EndpointSlice 而不是 -将现有的两个 EndpointSlice 都填满。换言之,与执行多个 EndpointSlice 更新操作 -相比较,方法会优先考虑执行一个 EndpointSlice 创建操作。 +这里比较重要的是,与在 EndpointSlice 之间完成最佳的分布相比,第三步中更看重限制 +EndpointSlice 更新的操作次数。例如,如果有 10 个端点待添加,有两个 EndpointSlice +中各有 5 个空位,上述方法会创建一个新的 EndpointSlice 而不是将现有的两个 +EndpointSlice 都填满。换言之,与执行多个 EndpointSlice 更新操作相比较, +方法会优先考虑执行一个 EndpointSlice 创建操作。 -由于 kube-proxy 在每个节点上运行并监视 EndpointSlice 状态,EndpointSlice 的 -每次变更都变得相对代价较高,因为这些状态变化要传递到集群中每个节点上。 -这一方法尝试限制要发送到所有节点上的变更消息个数,即使这样做可能会导致有 -多个 EndpointSlice 没有被填满。 +由于 kube-proxy 在每个节点上运行并监视 EndpointSlice 状态,EndpointSlice +的每次变更都变得相对代价较高,因为这些状态变化要传递到集群中每个节点上。 +这一方法尝试限制要发送到所有节点上的变更消息个数,即使这样做可能会导致有多个 +EndpointSlice 没有被填满。 -在实践中,上面这种并非最理想的分布是很少出现的。大多数被 EndpointSlice 控制器 -处理的变更都是足够小的,可以添加到某已有 EndpointSlice 中去的。并且,假使无法 -添加到已有的切片中,不管怎样都会快就会需要一个新的 EndpointSlice 对象。 -Deployment 的滚动更新为重新为 EndpointSlice 打包提供了一个自然的机会,所有 -Pod 及其对应的端点在这一期间都会被替换掉。 +在实践中,上面这种并非最理想的分布是很少出现的。大多数被 EndpointSlice +控制器处理的变更都是足够小的,可以添加到某已有 EndpointSlice 中去的。 +并且,假使无法添加到已有的切片中,不管怎样都会快就会需要一个新的 +EndpointSlice 对象。Deployment 的滚动更新为重新为 EndpointSlice +打包提供了一个自然的机会,所有 Pod 及其对应的端点在这一期间都会被替换掉。 -* 阅读[使用服务连接应用](/zh/docs/concepts/services-networking/connect-applications-service/) +* 阅读[使用 Service 连接到应用](/zh/docs/concepts/services-networking/connect-applications-service/) From 8fe03cc9fd08e908e19b7b97b77485b5c5da5fb5 Mon Sep 17 00:00:00 2001 From: ut003055 Date: Fri, 20 May 2022 14:19:53 +0800 Subject: [PATCH 074/245] Modify according to review --- .../kubernetes-api/cluster-resources/binding-v1.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md b/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md index a76cc3071a..78d827364f 100644 --- a/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md +++ b/content/zh/docs/reference/kubernetes-api/cluster-resources/binding-v1.md @@ -4,7 +4,7 @@ api_metadata: import: "k8s.io/api/core/v1" kind: "Binding" content_type: "api_reference" -description: "Binding 即将一个对象与另一个对象联系起来;例如,一个 pod 被调度程序绑定到一个节点。" +description: "Binding 将一个对象与另一个对象联系起来; 例如,一个 Pod 被调度程序绑定到一个节点。" title: "Binding" weight: 9 auto_generated: true @@ -30,7 +30,7 @@ guide. You can file document formatting bugs against the -Binding 即将一个对象与另一个对象联系起来;例如,一个 pod 被调度程序绑定到一个节点。1.7已弃用,请使用 pods 的 bindings 子资源。 +Binding 将一个对象与另一个对象联系起来; 例如,一个 Pod 被调度程序绑定到一个节点。1.7 已弃用,请使用 Pod 的 Binding 子资源。
- **apiVersion**: v1 @@ -47,7 +47,7 @@ Binding 即将一个对象与另一个对象联系起来;例如,一个 pod 被 The target object that you want to bind to the standard object. --> - 标准对象的元数据 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + 标准对象的元数据, 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - **target** (}}">ObjectReference), 必需的 @@ -66,7 +66,7 @@ POST /api/v1/namespaces/{namespace}/bindings #### Parameters --> -### `创建` 创建一个 Binding +### `create` 创建一个 Binding #### HTTP 请求 @@ -150,7 +150,7 @@ POST /api/v1/namespaces/{namespace}/bindings POST /api/v1/namespaces/{namespace}/pods/{name}/binding --> -### `create` 创建Pod的绑定 +### `create` 创建 Pod 的绑定 #### HTTP 请求 From 90ff6b5e1de5aee0a0f325745e8cbff650941429 Mon Sep 17 00:00:00 2001 From: Abirdcfly Date: Fri, 20 May 2022 16:05:38 +0800 Subject: [PATCH 075/245] fix kubee-system to kube-system Signed-off-by: Abirdcfly --- .../production-environment/tools/kubeadm/kubelet-integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md b/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md index 9b694bef41..260154f7d0 100644 --- a/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md +++ b/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md @@ -223,7 +223,7 @@ If the reload and restart are successful, the normal `kubeadm init` workflow con ### 当使用 `kubeadm init`时的工作流程 当调用 `kubeadm init` 时,kubelet 的配置会被写入磁盘 `/var/lib/kubelet/config.yaml`, -并上传到集群 `kubee-system` 命名空间的 `kubelet-config` ConfigMap。 +并上传到集群 `kube-system` 命名空间的 `kubelet-config` ConfigMap。 kubelet 配置信息也被写入 `/etc/kubernetes/kubelet.conf`,其中包含集群内所有 kubelet 的基线配置。 此配置文件指向允许 kubelet 与 API 服务器通信的客户端证书。 这解决了[将集群级配置传播到每个 kubelet](#propagating-cluster-level-configuration-to-each-kubelet) 的需求。 From 39ba66ed6e8ef2930def5ede30b716e45ab0bde6 Mon Sep 17 00:00:00 2001 From: Yang Bin Date: Fri, 20 May 2022 16:42:16 +0800 Subject: [PATCH 076/245] Fix spelling error --- .../zh/docs/tasks/manage-kubernetes-objects/kustomization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/zh/docs/tasks/manage-kubernetes-objects/kustomization.md b/content/zh/docs/tasks/manage-kubernetes-objects/kustomization.md index 796b20b85b..d93a75c979 100644 --- a/content/zh/docs/tasks/manage-kubernetes-objects/kustomization.md +++ b/content/zh/docs/tasks/manage-kubernetes-objects/kustomization.md @@ -1271,7 +1271,7 @@ deployment.apps "dev-my-nginx" deleted | vars | [][Var](https://github.com/kubernetes-sigs/kustomize/blob/master/api/types/var.go#L19) | 每个条目用来从某资源的字段来析取文字 | | images | [][Image](https://github.com/kubernetes-sigs/kustomize/blob/master/api/types/image.go#L8) | 每个条目都用来更改镜像的名称、标记与/或摘要,不必生成补丁 | | configurations | []string | 列表中每个条目都应能解析为一个包含 [Kustomize 转换器配置](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/transformerconfigs) 的文件 | -| crds | []string | 列表中每个条目都赢能够解析为 Kubernetes 类别的 OpenAPI 定义文件 | +| crds | []string | 列表中每个条目都应能够解析为 Kubernetes 类别的 OpenAPI 定义文件 | ## {{% heading "whatsnext" %}} From 7cac06da0311bb4018210c72d1bb9023a5714f4f Mon Sep 17 00:00:00 2001 From: huangminjie Date: Fri, 20 May 2022 21:00:30 +0800 Subject: [PATCH 077/245] [zh] sync v1.24 kubeadm-14a --- ...beadm_certs_renew_apiserver-etcd-client.md | 75 +++++++++---------- .../kubeadm_certs_renew_scheduler.conf.md | 73 +++++++----------- .../generated/kubeadm_init_phase_certs_all.md | 58 ++++++++------ ...kubeadm_init_phase_kubeconfig_scheduler.md | 51 ++++++++----- 4 files changed, 129 insertions(+), 128 deletions(-) diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-etcd-client.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-etcd-client.md index 2e5c428da3..235206573c 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-etcd-client.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_apiserver-etcd-client.md @@ -1,3 +1,18 @@ + + + +续订 apiserver 用于访问 etcd 的证书 -存储证书的路径。 + +

存储证书的路径。

@@ -59,28 +76,10 @@ kubeadm certs renew apiserver-etcd-client [flags] - -kubeadm 配置文件的路径。 - - - - ---csr-dir string - - - - -输出 CSR 和私钥的路径 - - - - ---csr-only - - - - -创建 CSR 而不是生成证书 + +

kubeadm 配置文件的路径。

@@ -89,8 +88,10 @@ kubeadm 配置文件的路径。 - -apiserver-etcd-client 操作的帮助命令 + +

apiserver-etcd-client 操作的帮助命令

@@ -105,20 +106,10 @@ apiserver-etcd-client 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。 -如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 - - - - ---use-api - - - - -使用 Kubernetes 证书 API 续订证书 +

与集群通信时使用的 kubeconfig 文件。 +如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -144,8 +135,10 @@ The kubeconfig file to use when talking to the cluster. If the flag is not set, - -[实验] 到 '真实' 主机根文件系统的路径。 + +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_scheduler.conf.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_scheduler.conf.md index 9898202f48..33a13fb95c 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_scheduler.conf.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_renew_scheduler.conf.md @@ -1,3 +1,18 @@ + + + +续订 kubeconfig 文件中嵌入的证书,以供调度管理器使用 -保存证书的路径。 +

保存证书的路径。

@@ -64,33 +79,9 @@ The path where to save the certificates. -kubeadm 配置文件的路径。 - - - - ---csr-dir string - - - - -CSR 和私钥的输出路径 - - - - ---csr-only - - - - -创建 CSR 而不是生成证书 +

kubeadm 配置文件的路径。

@@ -100,9 +91,9 @@ Create CSRs instead of generating certificates -scheduler.conf 操作的帮助命令 +

scheduler.conf 操作的帮助命令

@@ -117,22 +108,10 @@ scheduler.conf 操作的帮助命令 -与集群通信时使用的 kubeconfig 文件。 -如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。 - - - - ---use-api - - - - -使用 Kubernetes 证书 API 续订证书 +

与集群通信时使用的 kubeconfig 文件。 +如果未设置该参数,则可以在一组标准位置中搜索现有的 kubeconfig 文件。

@@ -157,9 +136,9 @@ Use the Kubernetes certificate API to renew certificates -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_all.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_all.md index f56cec6086..38a7fb842d 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_all.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_all.md @@ -1,3 +1,18 @@ + + + +生成所有证书 - 生成所有证书 ``` @@ -34,21 +48,21 @@ kubeadm init phase certs all [flags] -API 服务器所公布的其正在监听的 IP 地址。如果未设置,将使用默认网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,将使用默认网络接口。

---apiserver-cert-extra-sans stringSlice +--apiserver-cert-extra-sans strings -用于 API 服务器服务证书的可选额外替代名称(SAN)。可以同时使用 IP 地址和 DNS 名称。 +

用于 API 服务器服务证书的可选额外替代名称(SAN)。可以同时使用 IP 地址和 DNS 名称。

@@ -63,9 +77,9 @@ Optional extra Subject Alternative Names (SANs) to use for the API Server servin -证书的存储路径。 +

证书的存储路径。

@@ -75,9 +89,9 @@ The path where to save and store the certificates. -kubeadm 配置文件的路径。 +

kubeadm 配置文件的路径。

@@ -87,9 +101,9 @@ kubeadm 配置文件的路径。 -为控制平面指定一个稳定的 IP 地址或 DNS 名称。 +

为控制平面指定一个稳定的 IP 地址或 DNS 名称。

@@ -99,9 +113,9 @@ Specify a stable IP address or DNS name for the control plane. -all 操作的帮助命令 +

all 操作的帮助命令

@@ -116,9 +130,9 @@ all 操作的帮助命令 -为控制平面选择特定的 Kubernetes 版本。 +

为控制平面选择特定的 Kubernetes 版本。

@@ -133,9 +147,9 @@ Choose a specific Kubernetes version for the control plane. -VIP 服务使用其它的 IP 地址范围。 +

VIP 服务使用其它的 IP 地址范围。

@@ -150,9 +164,9 @@ VIP 服务使用其它的 IP 地址范围。 -服务使用其它的域名,例如:"myorg.internal"。 +

服务使用其它的域名,例如:"myorg.internal"。

@@ -178,9 +192,9 @@ Use alternative domain for services, e.g. "myorg.internal". -[实验] 到 '真实' 主机根文件系统的路径。 +

[实验] 到 '真实' 主机根文件系统的路径。

diff --git a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_scheduler.md b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_scheduler.md index 452247b6de..38d951e51a 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_scheduler.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_scheduler.md @@ -1,3 +1,18 @@ + + + +生成调度器使用的 kubeconfig 文件 -API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。 +

API 服务器所公布的其正在监听的 IP 地址。如果未设置,则使用默认的网络接口。

@@ -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 - - [试验特性] json 中包含 "json" 日志格式的选项。 + + [试验特性] json 中包含 "json" 日志格式的选项。 @@ -58,9 +56,9 @@ FormatOptions 包含为不同类型日志格式提供的选项。 - [FormatOptions](#FormatOptions) -JSONOptions 包含用于 "json" 日志格式的选项。 +JSONOptions 包含用于 "json" 日志格式的选项。 @@ -104,8 +102,6 @@ using split streams. The default is zero, which disables buffering.--> --> **出现在:** -- [LoggingConfiguration](#LoggingConfiguration) - ## 资源类型 +- [CredentialProviderConfig](#kubelet-config-k8s-io-v1beta1-CredentialProviderConfig) - [KubeletConfiguration](#kubelet-config-k8s-io-v1beta1-KubeletConfiguration) - [SerializedNodeConfigSource](#kubelet-config-k8s-io-v1beta1-SerializedNodeConfigSource) +## `CredentialProviderConfig` {#kubelet-config-k8s-io-v1beta1-CredentialProviderConfig} + + +CredentialProviderConfig 包含有关每个 exec 凭据提供者的配置信息。 +Kubelet 从磁盘上读取这些配置信息,并根据 CredentialProvider 类型启用各个提供者。 + +
字段描述
+ + + + + + + + + + + +
字段描述
apiVersion
string
kubelet.config.k8s.io/v1beta1
kind
string
CredentialProviderConfig
providers [必需]
+[]CredentialProvider +
+ +

+ providers 是一组凭据提供者插件,这些插件会被 kubelet 启用。 + 多个提供者可以匹配到同一镜像上,这时,来自所有提供者的凭据信息都会返回给 kubelet。 + 如果针对同一镜像调用了多个提供者,则结果会被组合起来。如果提供者返回的认证主键有重复, + 列表中先出现的提供者所返回的值将被使用。 +

+
+ ## `KubeletConfiguration` {#kubelet-config-k8s-io-v1beta1-KubeletConfiguration}

enableServer 会启用 kubelet 的安全服务器。

注意:kubelet 的不安全端口由 readOnlyPort 选项控制。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能会影响到与 kubelet 服务器交互的组件。

默认值:true

@@ -57,77 +93,47 @@ Default: true--> +Default: ""-->

staticPodPath 是指向要运行的本地(静态)Pod 的目录, 或者指向某个静态 Pod 文件的路径。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑新路径下所给的静态 Pod 集合可能与 kubelet -启动时所看到的集合不同,而这一差别可能会扰乱节点状态。

-

默认值:""

+

默认值:""

syncFrequency
-meta/v1.Duration +meta/v1.Duration +Default: "1m"-->

syncFrequency 是对运行中的容器和配置进行同步的最长周期。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短这一同步周期可能会带来负面的性能影响, -尤其当节点上 Pod 个数增加时。相反,增加此周期长度时可能会导致 ConfigMap、 -Secret 这类资源未被及时更新。

-

默认值:"1m"

+

默认值:"1m"

fileCheckFrequency
-meta/v1.Duration +meta/v1.Duration +Default: "20s"-->

fileCheckFrequency 是对配置文件中新数据进行检查的时间间隔值。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短此时长会导致 kubelet 更为频繁地重新加载其静态 Pod 配置, -而这会带来负面的性能影响。

-

默认值:"20s"

+

默认值:"20s"

httpCheckFrequency
-meta/v1.Duration +meta/v1.Duration

httpCheckFrequency 是对 HTTP 服务器上新数据进行检查的时间间隔值。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短此时长会导致 kubelet 更为频繁地轮询 -staticPodURL,而这会带来负面的性能影响。

-

默认值:"20s"

+

默认值:"20s"

@@ -136,17 +142,10 @@ Default: "20s"

staticPodURL 是访问要运行的静态 Pod 的 URL 地址。 -

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,新的 URL 上包含的静态 Pod 集合可能与 kubelet -初始启动时看到的不同,而这种差异可能会扰乱节点状态。

-

默认值:""

+

默认值:""

@@ -156,16 +155,10 @@ Default: ""

staticPodURLHeader是一个由字符串组成的映射表,其中包含的 HTTP 头部信息用于访问podURL

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,要考虑可能导致无法从staticPodURL -读取最新的静态 Pod 集合。

默认值:nil

@@ -177,15 +170,10 @@ Default: nil

address 是 kubelet 提供服务所用的 IP 地址(设置为 0.0.0.0 使用所有网络接口提供服务)。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

默认值:"0.0.0.0"

@@ -197,15 +185,10 @@ Default: "0.0.0.0"

port 是 kubelet 用来提供服务所使用的端口号。 这一端口号必须介于 1 到 65535 之间,包含 1 和 65535。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

默认值:10250

@@ -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) -->

readOnlyPort 是 kubelet 用来提供服务所使用的只读端口号。 此端口上的服务不支持身份认证或鉴权。这一端口号必须介于 1 到 65535 之间, 包含 1 和 65535。将此字段设置为 0 会禁用只读服务。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

默认值:0(禁用)

@@ -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; -->

tlsCertFile是包含 HTTPS 所需要的 x509 证书的文件 (如果有 CA 证书,会串接到服务器证书之后)。如果tlsCertFiletlsPrivateKeyFile都没有设置,则系统会为节点的公开地址生成自签名的证书和私钥, 并将其保存到 kubelet --cert-dir参数所指定的目录下。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

默认值:""

@@ -261,15 +234,10 @@ Default:"quot;

tlsPrivateKeyFile是一个包含与tlsCertFile 证书匹配的 X509 私钥的文件。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

默认值:""

@@ -280,15 +248,10 @@ Default: ""

tlsCipherSuites是一个字符串列表,其中包含服务器所接受的加密包名称。 列表中的每个值来自于tls包中定义的常数(https://golang.org/pkg/crypto/tls/#pkg-constants)。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰到与 kubelet 服务器交互的组件。

默认值:nil

@@ -299,15 +262,10 @@ Default: nil

tlsMinVersion给出所支持的最小 TLS 版本。 字段取值来自于tls包中的常数定义(https://golang.org/pkg/crypto/tls/#pkg-constants)。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰到与 kubelet 服务器交互的组件。

默认值:""

@@ -319,17 +277,10 @@ Default: ""

rotateCertificates用来启用客户端证书轮换。kubelet 会调用 certificates.k8s.io API 来请求新的证书。需要有一个批复人批准证书签名请求。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑禁用此行为时可能导致 kubelet 无法在当前证书过期时向 -API 服务器执行身份认证。

默认值: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特性必须被启用。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑禁用此特性会导致 kubelet 的服务器证书无法被续约, -长期上这会干扰到与 kubelet 服务器交互的组件,因为证书会过期。

默认值:false

@@ -366,26 +309,21 @@ kubelet 会调用certificates.k8s.io API 来请求证书。

authorization设置发送给 kubelet 服务器的请求是如何进行身份认证的。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

默认值:


   anonymous:
     enabled: false
   webhook:
     enabled: true
-    cacheTTL: "2m"
+    cacheTTL: "2m"
   
@@ -395,24 +333,19 @@ Defaults:

authorization设置发送给 kubelet 服务器的请求是如何进行鉴权的。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能会干扰到与 kubelet 服务器交互的组件。

默认值:


   mode: Webhook
   webhook:
-    cacheAuthorizedTTL: "5m"
-    cacheUnauthorizedTTL: "30s"
+    cacheAuthorizedTTL: "5m"
+    cacheUnauthorizedTTL: "30s"
   
@@ -424,16 +357,10 @@ Defaults:

registryPullQPS是每秒钟可以执行的镜像仓库拉取操作限值。 此值必须不能为负数。将其设置为 0 表示没有限值。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这类更新可能会因为镜像拉取所产生的流量变化而导致集群可扩缩能力问题。

默认值: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 -->

registryBurst是突发性镜像拉取的上限值,允许镜像拉取临时上升到所指定数量, 不过仍然不超过registryPullQPS所设置的约束。此值必须是非负值。 只有registryPullQPS参数值大于 0 时才会使用此设置。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能因为镜像拉取所造成的流量变化,导致集群可扩缩能力受影响。

默认值:10

@@ -467,16 +388,10 @@ Default: 10

eventRecordQPS设置每秒钟可创建的事件个数上限。如果此值为 0, 则表示没有限制。此值不能设置为负数。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能因为生成事件所造成的流量变化,导致集群可扩缩能力受影响。

默认值:5

@@ -485,21 +400,16 @@ Default: 5 int32 -

eventBurst是突发性事件创建的上限值,允许事件创建临时上升到所指定数量, 不过仍然不超过eventRecordQPS所设置的约束。此值必须是非负值, -且只有eventRecordQPS大于 0 时才会使用此设置。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能因为事件创建所造成的流量变化,导致集群可扩缩能力受影响。

+且只有eventRecordQPS > 0 时才会使用此设置。

默认值:10

@@ -511,16 +421,11 @@ Default: 10

enableDebuggingHandlers启用服务器上用来访问日志、 在本地运行容器和命令的端点,包括execattachlogsportforward等功能。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑禁用此能力可能干扰到与 kubelet 服务器交互的组件。

默认值:true

@@ -529,16 +434,12 @@ Default: true bool -

enableContentionProfiling用于启用锁竞争性能分析, 仅用于enableDebuggingHandlerstrue的场合。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑启用此分析可能隐含着一定的性能影响。

默认值:false @@ -547,17 +448,13 @@ Default: false int32 -

healthzPort是本地主机上提供healthz端点的端口 (设置值为 0 时表示禁止)。合法值介于 1 和 65535 之间。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰到监控 kubelet 健康状况的组件。

默认值:10248

@@ -566,15 +463,11 @@ Default: 10248 string -

healthzBindAddresshealthz服务器用来提供服务的 IP 地址。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能影响到监测 kubelet 健康状况的组件。

默认值:"127.0.0.1"

@@ -585,15 +478,10 @@ Default: "127.0.0.1"

oomScoreAdj 是为 kubelet 进程设置的oom-score-adj值。 所设置的取值要在 [-1000, 1000] 范围之内。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能影响到内存压力较大时节点的稳定性。

默认值:-999

@@ -605,14 +493,10 @@ Default: -999

clusterDomain是集群的 DNS 域名。如果设置了此字段,kubelet 会配置所有容器,使之在搜索主机的搜索域的同时也搜索这里指定的 DNS 域。

-

DynamicKubeletConfig (已弃用,默认为关闭): -不建议动态更新此字段,因为这一设置值要与整个集群中的其他组件保持一致。

默认值:""

@@ -624,43 +508,30 @@ Default: ""

clusterDNS是集群 DNS 服务器的 IP 地址的列表。 如果设置了,kubelet 将会配置所有容器使用这里的 IP 地址而不是宿主系统上的 DNS 服务器来完成 DNS 解析。 -

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑变更仅会对更新后创建的 Pod 起作用。建议在更改此字段之前腾空节点。

默认值:nil

streamingConnectionIdleTimeout
-meta/v1.Duration +meta/v1.Duration

streamingConnectionIdleTimeout设置流式连接在被自动关闭之前可以空闲的最长时间。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能影响到依赖于通过与 kubelet -服务器间流式连接来接受非频繁更新事件的组件。

默认值:"4h"

nodeStatusUpdateFrequency
-meta/v1.Duration +meta/v1.Duration

nodeStatusUpdateFrequency是 kubelet 计算节点状态的频率。 如果未启用节点租约特性,这一字段设置的也是 kubelet 向控制面投递节点状态的频率。

注意:如果节点租约特性未被启用,更改此参数设置时要非常小心, 所设置的参数值必须与节点控制器的nodeMonitorGracePeriod协同。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑变更可能影响节点的可扩缩性。还要注意节点控制器的 -nodeMonitorGracePeriod必须设置为N∗nodeStatusUpdateFrequency, -其中N是节点控制器标记节点不健康之前执行重试的次数。

默认值:"10s"

nodeStatusReportFrequency
-meta/v1.Duration +meta/v1.Duration

nodeLeaseDurationSeconds是 kubelet 会在其对应的 Lease 对象上设置的时长值。 @@ -735,27 +592,19 @@ Default: 40

如果租约过期,则节点可被视作不健康。根据 KEP-0009 约定,目前的租约每 10 秒钟续约一次。 在将来,租约的续约时间间隔可能会根据租约的时长来设置。

此字段的取值必须大于零。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短租约期限可能降低节点对那些暂时导致 kubelet -无法续约的问题的容忍度(例如,时延很短的网络问题)。

默认值:40

imageMinimumGCAge
-meta/v1.Duration +meta/v1.Duration

imageMinimumGCAge是对未使用镜像进行垃圾搜集之前允许其存在的时长。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这种变更可能触发垃圾收集或者延迟垃圾收集, -并且可能影响节点上镜像的额外开销。

默认值:"2m"

@@ -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 -->

imageGCHighThresholdPercent所给的是镜像的磁盘用量百分数, 一旦镜像用量超过此阈值,则镜像垃圾收集会一直运行。百分比是用这里的值除以 100 得到的,所以此字段取值必须介于 0 和 100 之间,包括 0 和 100。如果设置了此字段, 则取值必须大于imageGCLowThresholdPercent取值。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这种变更可能触发垃圾收集或者延迟垃圾收集, -并且可能影响节点上镜像的额外开销。

默认值: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 -->

imageGCLowThresholdPercent所给的是镜像的磁盘用量百分数, 镜像用量低于此阈值时不会执行镜像垃圾收集操作。垃圾收集操作也将此作为最低磁盘用量边界。 百分比是用这里的值除以 100 得到的,所以此字段取值必须介于 0 和 100 之间,包括 0 和 100。 如果设置了此字段,则取值必须小于imageGCHighThresholdPercent取值。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这种变更可能触发垃圾收集或者延迟垃圾收集, -并且可能影响节点上镜像的额外开销。

默认值:80

volumeStatsAggPeriod
-meta/v1.Duration +meta/v1.Duration

volumeStatsAggPeriod是计算和缓存所有 Pod 磁盘用量的频率。

-

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短此周期长度可能产生性能影响。

默认值:"1m"

@@ -835,13 +665,9 @@ Default: "1m"

kubeletCgroups是用来隔离 kubelet 的控制组(CGroup)的绝对名称。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:""

@@ -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; -->

systemCgroups是用来放置那些未被容器化的、非内核的进程的控制组 (CGroup)的绝对名称。设置为空字符串表示没有这类容器。回滚此字段设置需要重启节点。 当此字段非空时,必须设置cgroupRoot字段。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:""

@@ -873,15 +695,9 @@ Default: "&qout;

cgroupRoot是用来运行 Pod 的控制组 (CGroup)。 容器运行时会尽可能处理此字段的设置值。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

-

默认值:""

@@ -892,15 +708,11 @@ Default: ""

cgroupsPerQOS用来启用基于 QoS 的控制组(CGroup)层次结构: 顶层的控制组用于不同 QoS 类,所有BurstableBestEffort Pod 都会被放置到对应的顶级 QoS 控制组下。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:true

@@ -911,14 +723,10 @@ Default: true

cgroupDriver是 kubelet 用来操控宿主系统上控制组 (CGroup) 的驱动程序(cgroupfs 或 systemd)。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:"cgroupfs"

@@ -929,14 +737,10 @@ Default: "cgroupfs"

cpuManagerPolicy是要使用的策略名称。需要启用CPUManager 特性门控。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:"None"

@@ -947,36 +751,26 @@ Default: "None"

cpuManagerPolicyOptions是一组key=value键值映射, 容许通过额外的选项来精细调整 CPU 管理器策略的行为。需要CPUManagerCPUManagerPolicyOptions两个特性门控都被启用。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:nil

cpuManagerReconcilePeriod
-meta/v1.Duration +meta/v1.Duration

cpuManagerReconcilePeriod是 CPU 管理器的协调周期时长。 需要启用CPUManager特性门控。

-

DynamicKubeletConfig (已弃用): -

DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短周期时长可能带来的性能影响。

默认值:"10s"

@@ -987,14 +781,10 @@ Default: "10s"

memoryManagerPolicy是内存管理器要使用的策略的名称。 要求启用MemoryManager特性门控。

-

DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

默认值:"none"

@@ -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。
  • 如果策略不是 "none",则要求启用TopologyManager特性门控。

    -

    DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

    默认值:"none"

    @@ -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 -->

    qosReserved是一组从资源名称到百分比值的映射,用来为Guaranteed QoS 类型的负载预留供其独占使用的资源百分比。目前支持的资源为:"memory"。 需要启用QOSReserved特性门控。

    -

    DynamicKubeletConfig (已弃用): -更新此字段时需要对整个节点执行重启。最安全的做法是确保此值与本地配置相同。

    默认值:nil

    runtimeRequestTimeout
    -meta/v1.Duration +meta/v1.Duration

    runtimeRequestTimeout用来设置除长期运行的请求(pulllogsexecattach)之外所有运行时请求的超时时长。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能干扰与 kubelet 服务器交互的组件。

    默认值:"2m"

    @@ -1123,15 +900,10 @@ themselves if they should try to access their own Service. Values:

    一般而言,用户必须设置--hairpin-mode=hairpin-veth才能实现发夹模式的网络地址转译 (NAT),因为混杂模式的网桥要求存在一个名为cbr0的容器网桥。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑取决于网络插件,可能需要重启节点。

    默认值:"promiscuous-bridge"

    @@ -1142,20 +914,9 @@ Default: "promiscuous-bridge"

    maxPods是此 kubelet 上课运行的 Pod 个数上限。此值必须为非负整数。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑变更可能导致 kubelet 重启时 Pod 无法被准入, -而且可能改变Node.status.capacity[v1.ResourcePods]中报告的数值, -从而影响将来的调度决策。增大此个数值也可能会降低性能,因为会有更多的 Pod -塞到同一节点运行。

    默认值:110

    @@ -1166,15 +927,10 @@ Default: 110

    podCIDR是用来设置 Pod IP 地址的 CIDR 值,仅用于独立部署模式。 运行于集群模式时,这一数值会从控制面获得。

    -

    DynamicKubeletConfig (已弃用): -此字段应该总是设置为默认的空字符串值。并且仅用来设置独立运行的 kubelet, -因为这种 kubelet 模式下无法利用动态 kubelet 配置能力。

    默认值:""

    @@ -1184,14 +940,9 @@ Default: ""

    podPidsLimit是每个 Pod 中可使用的 PID 个数上限。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑减小此值可能会导致变更后无法创建容器进程。

    默认值:-1

    @@ -1202,17 +953,11 @@ Default: -1

    resolvConf是一个域名解析配置文件,用作容器 DNS 解析配置的基础。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑变更仅会对更新完成后所创建的 Pod 起作用。 -建议在变更此字段之前先腾空节点。如果此值设置为空字符串,则会覆盖 DNS 解析的默认配置, +

    如果此值设置为空字符串,则会覆盖 DNS 解析的默认配置, 本质上相当于禁用了 DNS 查询。

    默认值:"/etc/resolv.conf"

    @@ -1238,37 +983,25 @@ Default: false

    cpuCFSQuota允许为设置了 CPU 限制的容器实施 CPU CFS 配额约束。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑禁止此功能可能会降低节点稳定性。

    默认值:true

    cpuCFSQuotaPeriod
    -meta/v1.Duration +meta/v1.Duration

    cpuCFSQuotaPeriod设置 CPU CFS 配额周期值,cpu.cfs_period_us。 此值需要介于 1 微秒和 1 秒之间,包含 1 微秒和 1 秒。 此功能要求启用CustomCPUCFSQuotaPeriod特性门控被启用。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑为容器所设置的限制值可能导致cpu.cfs_period_us -设置发生变化。这一变化会在节点被重新配置时触发容器重启。

    默认值:"100ms"

    @@ -1280,16 +1013,11 @@ Default: "100ms"

    nodeStatusMaxImages限制Node.status.images中报告的镜像数量。 此值必须大于 -2。

    注意:如果设置为 -1,则不会对镜像数量做限制;如果设置为 0,则不会返回任何镜像。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑节点状态中可能报告不同的数值。

    默认值:50

    @@ -1300,14 +1028,9 @@ Default: 50

    maxOpenFiles是 kubelet 进程可以打开的文件个数。此值必须不能为负数。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能影响到 kubelet 与节点文件系统间交互的能力。

    默认值:1000000

    @@ -1317,18 +1040,9 @@ Default: 1000000

    contentType是向 API 服务器发送请求时使用的内容类型。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这样做可能影响 kubelet 与 API 服务器通信的能力。 -如果 kubelet 因为此字段的变更而失去与 API 服务器间的连接, -则之前所作的变更无法通过动态 kubelet 配置来实现回退。

    默认值:"application/vnd.kubernetes.protobuf"

    @@ -1338,15 +1052,9 @@ Default: "application/vnd.kubernetes.protobuf"

    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 -->

    serializeImagePulls被启用时会通知 kubelet 每次仅拉取一个镜像。 我们建议不要在所运行的 docker 守护进程版本低于 1.9、使用 aufs 存储后端的节点上更改默认值。详细信息可参见 Issue #10959。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这可能会影响镜像拉取的性能。

    默认值:true

    @@ -1400,26 +1097,21 @@ Default: true

    evictionHard是一个映射,是从信号名称到定义硬性驱逐阈值的映射。 例如:{"memory.available": "300Mi"}。 如果希望显式地禁用,可以在任意资源上将其阈值设置为 0% 或 100%。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这可能会触发或延迟 Pod 驱逐操作。

    默认值:

    -  memory.available:  "100Mi"
    -  nodefs.available:  "10%"
    -  nodefs.inodesFree: "5%"
    -  imagefs.available: "15%"
    +   memory.available:  "100Mi"
    +   nodefs.available:  "10%"
    +   nodefs.inodesFree: "5%"
    +   imagefs.available: "15%"
       
    @@ -1430,17 +1122,10 @@ Default:

    evictionSoft是一个映射,是从信号名称到定义软性驱逐阈值的映射。 例如:{"memory.available": "300Mi"}

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这可能会触发或延迟 Pod 驱逐操作, -并且可能造成节点所报告的可分配资源数量发生变化。

    默认值:nil

    @@ -1451,34 +1136,24 @@ Default: nil

    evictionSoftGracePeriod是一个映射,是从信号名称到每个软性驱逐信号的宽限期限。 例如:{"memory.available": "30s"}

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这可能会触发或延迟 Pod 驱逐操作。

    默认值:nil

    evictionPressureTransitionPeriod
    -meta/v1.Duration +meta/v1.Duration

    evictionPressureTransitionPeriod设置 kubelet 离开驱逐压力状况之前必须要等待的时长。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑减少此字段值可能会在节点过量分配时降低节点稳定性。

    默认值:"5m"

    @@ -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"}

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这可能会改变驱逐操作应对资源压力的效果。

    默认值:nil

    @@ -1541,20 +1204,10 @@ Default: nil

    podsPerCore设置的是每个核上 Pod 个数上限。此值不能超过maxPods。 所设值必须是非负整数。如果设置为 0,则意味着对 Pod 个数没有限制。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑变更可能导致 kubelet 重启时 Pod 无法被准入, -还可能导致Node.status.capacity.pods所报告的数值发生变化, -进而影响到将来的调度决策。增大此值也会降低性能,因为在同一个处理器核上需要运行更多的 Pod。

    默认值:0

    @@ -1566,24 +1219,15 @@ Default: 0

    enableControllerAttachDetach用来允许 Attach/Detach 控制器管理调度到本节点的卷的挂接(attachment)和解除挂接(detachement), 并且禁止 kubelet 执行任何 attach/detach 操作。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑在运行中的节点上更改由哪个组件来负责卷管理时, -这一变更可能导致节点在被更新前尚未腾空时卷无法被解除挂接。 -如果 kubelet 尚未更新volumes.kubernetes.io/controller-managed-attach-detach -注解时 Pod 已经被调度到了该节点,节点上的卷也会无法解除挂接。 -一般而言,最安全的做法是将此字段设置为与本地配置相同的值。

    +

    注意:kubelet 不支持挂接 CSI 卷和解除挂接, +因此对于该用例,此选项必须为 true。

    默认值:true

    @@ -1595,18 +1239,11 @@ Default: true

    protectKernelDefaults设置为true时,会令 kubelet 在发现内核参数与预期不符时出错退出。若此字段设置为false,则 kubelet 会尝试更改内核参数以满足其预期。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑启用此设置会在内核参数与 kubelet 预期不匹配时导致 -kubelet 进入崩溃循环(Crash-Loop)状态。

    默认值:false

    @@ -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 -->

    makeIPTablesUtilChains设置为true时,相当于允许 kubelet 确保一组 iptables 规则存在于宿主机上。这些规则会为不同的组件(例如 kube-proxy) 提供工具性质的规则。它们是基于iptablesMasqueradeBitiptablesDropBit 来创建的。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑禁用此行为会导致 kubelet 无法在本地 iptables -规则出错时实现自愈。

    默认值: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 -->

    iptablesMasqueradeBit是 iptables fwmark 空间中用来为 SNAT 作标记的位。此值必须介于[0, 31]区间,必须与其他标记位不同。

    警告:请确保此值设置与 kube-proxy 中对应的参数设置取值相同。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑此处的变更要与其他组件(如 kube-proxy)相应的变更协调一致。 -只有当makeIPTablesUtilChains能力被启用时,这里的更新才会起作用。

    默认值:14

    @@ -1665,17 +1289,10 @@ Default: 14

    iptablesDropBit是 iptables fwmark 空间中用来标记丢弃包的数据位。 此值必须介于[0, 31]区间,必须与其他标记位不同。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑此处的变更要与其他组件(如 kube-proxy)相应的变更协调一致。 -只有当makeIPTablesUtilChains能力被启用时,这里的更新才会起作用。

    默认值:15

    @@ -1686,22 +1303,12 @@ Default: 15

    featureGates是一个从功能特性名称到布尔值的映射,用来启用或禁用实验性的功能。 此字段可逐条更改文件 "k8s.io/kubernetes/pkg/features/kube_features.go" 中所给的内置默认值。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑你所启用或禁止的功能特性的文档。 -尽管我们鼓励功能特性的开发人员使动态启用或禁用功能特性成为可能, -某些变更可能要求重新启动节点,某些特性可能要求在从启用到禁用切换时作出精细的协调。

    默认值:nil

    @@ -1711,14 +1318,9 @@ Default: nil

    failSwapOn通知 kubelet 在节点上启用交换分区时拒绝启动。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑缩短此周期长度可能产生性能影响。

    默认值:true

    @@ -1739,15 +1341,10 @@ Default: true

    containerLogMaxSize是定义容器日志文件被轮转之前可以到达的最大尺寸。 例如:"5Mi" 或 "256Ki"。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能会触发日志轮转。

    默认值:"10Mi"

    @@ -1758,14 +1355,9 @@ Default: "10Mi"

    containerLogMaxFiles设置每个容器可以存在的日志文件个数上限。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑降低此值可能导致日志文件被删除。

    默认值:"5"

    @@ -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 -->

    systemReserved是一组资源名称=资源数量对, 用来描述为非 Kubernetes 组件预留的资源(例如:'cpu=200m,memory=150G')。

    目前仅支持 CPU 和内存。更多细节可参见 http://kubernetes.io/zh/docs/user-guide/compute-resources。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑增加预留资源也许是不可能的,因为需要改变控制组大小。 -在更改了此字段之后,应该总是关注NodeAllocatableEnforced事件, -以确保更新是成功的。

    默认值: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 -->

    kubeReserved是一组资源名称=资源数量对, 用来描述为 Kubernetes 系统组件预留的资源(例如:'cpu=200m,memory=150G')。 目前支持 CPU、内存和根文件系统的本地存储。 更多细节可参见 https://kubernetes.io/zh/docs/concepts/configuration/manage-resources-containers/。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑增加预留资源也许是不可能的,因为需要改变控制组大小。 -在更改了此字段之后,应该总是关注NodeAllocatableEnforced事件, -以确保更新是成功的。

    默认值:Nil

    @@ -1893,18 +1467,14 @@ Default: ""

    systemReservedCgroup帮助 kubelet 识别用来为 OS 系统级守护进程实施 systemReserved计算资源预留时使用的顶级控制组(CGroup)。 -参考[Node Allocatable](https://git.k8s.io/community/contributors/design-proposals/node/node-allocatable.md) +参考 Node Allocatable 以了解详细信息。

    -

    DynamicKubeletConfig(已弃用): -此字段更新时需要整个节点重启。最安全的做法是保持此值与本地配置相同。

    默认值:""

    @@ -1916,18 +1486,14 @@ Default: ""

    kubeReservedCgroup 帮助 kubelet 识别用来为 Kubernetes 节点系统级守护进程实施 kubeReserved计算资源预留时使用的顶级控制组(CGroup)。 -参阅Node Allocatable +参阅 Node Allocatable 了解进一步的信息。

    -

    DynamicKubeletConfig(已弃用): -此字段更新时需要整个节点重启。最安全的做法是保持此值与本地配置相同。

    默认值:""

    @@ -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"] -->

    此标志设置 kubelet 需要执行的各类节点可分配资源策略。此字段接受一组选项列表。 @@ -1963,11 +1522,6 @@ Default: ["pods"]

    这个字段只有在cgroupsPerQOS被设置为true才被支持。

    参阅Node Allocatable 了解进一步的信息。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑去掉此机制可能会降低节点稳定性。 -反之,添加此机制可能会降低原来使用资源超出预留量的组件的稳定性。 -例如,实施 kube-reserved 在 kubelet 使用资源超出预留量时可能导致 kubelet 发生 OOM, -而实施 system-reserved 机制可能导致使用资源超出预留量的系统守护进程发生 OOM。

    默认值:["pods"]

    @@ -1996,14 +1550,9 @@ Default: []

    volumePluginDir是用来搜索其他第三方卷插件的目录的路径。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑更改volumePluginDir可能干扰使用第三方卷插件的负载。

    默认值:"/usr/libexec/kubernetes/kubelet-plugins/volume/exec/"

    @@ -2014,15 +1563,10 @@ Default: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/"

    providerID字段被设置时,指定的是一个外部提供者(即云驱动)实例的唯一 ID, 该提供者可用来唯一性地标识特定节点。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑可能影响到 kubelet 与云驱动之间进行交互的能力。

    默认值:""

    @@ -2034,15 +1578,10 @@ Default: "quot;

    kernelMemcgNotification字段如果被设置了,会告知 kubelet 集成内核的 memcg 通知机制来确定是否超出内存逐出阈值,而不是使用轮询机制来判定。

    -

    DynamicKubeletConfig (已弃用,默认为关闭)被启用时, -如果动态更新了此字段,请考虑这样做可能影响到 kubelet 与内核的交互方式。

    默认值:false

    @@ -2078,7 +1617,7 @@ Default: true shutdownGracePeriod
    -meta/v1.Duration +meta/v1.Duration +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.-->

  • priority: 0 shutdownGracePeriodSeconds: 30
  • +

    在退出之前,kubelet 要等待的时间上限为节点上所有优先级类的 shutdownGracePeriodSeconds的最大值。 当所有 Pod 都退出或者到达其宽限期限时,kubelet 会释放关闭防护锁。 @@ -2314,6 +1866,202 @@ SerializedNodeConfigSource 允许对 `v1.NodeConfigSource` 执行序列化操作 +## `CredentialProvider` {#kubelet-config-k8s-io-v1beta1-CredentialProvider} + + +**出现在:** + +- [CredentialProviderConfig](#kubelet-config-k8s-io-v1beta1-CredentialProviderConfig) + + +CredentialProvider 代表的是要被 kubelet 调用的一个 exec 插件。 +这一插件只会在所拉取的镜像与该插件所处理的镜像匹配时才会被调用(参见 matchImages)。 + + + + + + + + + + + + + + + + + + + + + + + + +
    字段描述
    name [必需]
    +string +
    + +

    + name 是凭据提供者的名称(必需)。此名称必须与 kubelet + 所看到的提供者可执行文件的名称匹配。可执行文件必须位于 kubelet 的 + bin 目录(通过 --image-credential-provider-bin-dir 设置)下。 +

    +
    matchImages [必需]
    +[]string +
    + +

    matchImages 是一个必须设置的字符串列表,用来匹配镜像以便确定是否要调用此提供者。 +如果字符串之一与 kubelet 所请求的镜像匹配,则此插件会被调用并给予提供凭证的机会。 +镜像应该包含镜像库域名和 URL 路径。

    + +

    matchImages 中的每个条目都是一个模式字符串,其中可以包含端口号和路径。 +域名部分可以包含统配符,但端口或路径部分不可以。通配符可以用作子域名,例如 +'*.k8s.io' 或 'k8s.*.io',以及顶级域名,如 'k8s.*'。

    +

    对类似 'app*.k8s.io' 这类部分子域名的匹配也是支持的。 +每个通配符只能用来匹配一个子域名段,所以 '*.io' 不会匹配 '*.k8s.io'。

    + +

    镜像与 matchImages 之间存在匹配时,以下条件都要满足:

    +
      + +
    • 二者均包含相同个数的域名部分,并且每个域名部分都对应匹配;
    • +
    • matchImages 条目中的 URL 路径部分必须是目标镜像的 URL 路径的前缀;
    • +
    • 如果 matchImages 条目中包含端口号,则端口号也必须与镜像端口号匹配。
    • +
    + +

    matchImages 的一些示例如下:

    +
      +
    • 123456789.dkr.ecr.us-east-1.amazonaws.com
    • +
    • *.azurecr.io
    • +
    • gcr.io
    • +
    • ..registry.io
    • +
    • registry.io:8080/path
    • +
    +
    defaultCacheDuration [必需]
    +meta/v1.Duration +
    + +

    + defaultCacheDuration 是插件在内存中缓存凭据的默认时长, + 在插件响应中没有给出缓存时长时,使用这里设置的值。此字段是必需的。 +

    +
    apiVersion [必需]
    +string +
    + +

    + 要求 exec 插件 CredentialProviderRequest 请求的输入版本。 + 所返回的 CredentialProviderResponse 必须使用与输入相同的编码版本。当前支持的值有: +

    +
      +
    • credentialprovider.kubelet.k8s.io/v1beta1
    • +
    +
    args
    +[]string +
    + +

    在执行插件可执行文件时要传递给命令的参数。

    +
    env
    +[]ExecEnvVar +
    + +

    + env 定义要提供给插件进程的额外的环境变量。 + 这些环境变量会与主机上的其他环境变量以及 client-go 所使用的环境变量组合起来, + 一起传递给插件。 +

    +
    + +## `ExecEnvVar` {#kubelet-config-k8s-io-v1beta1-ExecEnvVar} + + +**出现在:** + +- [CredentialProvider](#kubelet-config-k8s-io-v1beta1-CredentialProvider) + + +ExecEnvVar 用来在执行基于 exec 的凭据插件时设置环境变量。 + + + + + + + + + + + + +
    字段描述
    name [必需]
    +string +
    + + + 无描述 + +
    value [必需]
    +string +
    + + + 无描述 + +
    + + ## `KubeletAnonymousAuthentication` {#kubelet-config-k8s-io-v1beta1-KubeletAnonymousAuthentication} @@ -2491,7 +2239,7 @@ API 来提供持有者令牌身份认证。

    cacheAuthorizedTTL
    -meta/v1.Duration +meta/v1.Duration cacheUnauthorizedTTL
    -meta/v1.Duration +meta/v1.Duration flushFrequency [必需]
    -time.Duration +time.Duration

    - - 对日志进行清洗的最大间隔秒数。如果所选的日志后端在写入日志消息时不提供缓存, -则此配置会被忽略。 + + 对日志进行清洗的最大间隔纳秒数(例如,1s = 1000000000)。 + 如果所选的日志后端在写入日志消息时不提供缓存,则此配置会被忽略。

    @@ -2827,19 +2578,6 @@ Only supported for "text" log format.--> -sanitization [必需]
    -bool - - -

    - - [试验功能] 当启用此选项时,被标记为敏感的字段(密码、秘钥、令牌)不会被日志记录。 -运行时日志过滤功能可能会引入非常大的计算开销,因此在生产环境中不应启用。 -

    - - - options [必需]
    FormatOptions From aea9e7b7a1aa7d4644e93f89b39a995f9960c935 Mon Sep 17 00:00:00 2001 From: Sean Wei Date: Sat, 21 May 2022 02:27:18 +0800 Subject: [PATCH 081/245] [zh] Sync contribute --- .../contribute/participate/pr-wranglers.md | 8 ++--- .../zh/docs/contribute/style/content-guide.md | 33 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/content/zh/docs/contribute/participate/pr-wranglers.md b/content/zh/docs/contribute/participate/pr-wranglers.md index d9af8cc1d3..20230e4d3b 100644 --- a/content/zh/docs/contribute/participate/pr-wranglers.md +++ b/content/zh/docs/contribute/participate/pr-wranglers.md @@ -11,11 +11,11 @@ weight: 20 -SIG Docs 的[批准人(Approvers)](/zh/docs/contribute/participate/roles-and-responsibilites/#approvers)们每周轮流负责 +SIG Docs 的[批准人(Approvers)](/zh/docs/contribute/participate/roles-and-responsibilities/#approvers)们每周轮流负责 [管理仓库的 PR](https://github.com/kubernetes/website/wiki/PR-Wranglers)。 本节介绍 PR 管理者的职责。关于如何提供较好的评审意见, @@ -206,7 +206,7 @@ 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). +- Once you've signed up to shadow a PR Wrangler, introduce yourself to the PR Wrangler on the [Kubernetes Slack](https://slack.k8s.io). --> ### 成为一名影子 @@ -221,4 +221,4 @@ In late 2021, SIG Docs introduced the PR Wrangler Shadow Program. The program wa [SIG Docs 联席主席/主管](https://github.com/kubernetes/community/tree/master/sig-docs#leadership)。 - 注册成为一名 PR 管理者的影子时, - 请你在 [Kubernetes Slack](slack.k8s.io) 向这名 PR 管理者做一次自我介绍。 + 请你在 [Kubernetes Slack](https://slack.k8s.io) 向这名 PR 管理者做一次自我介绍。 diff --git a/content/zh/docs/contribute/style/content-guide.md b/content/zh/docs/contribute/style/content-guide.md index 1f787a1b93..91e9d0ee96 100644 --- a/content/zh/docs/contribute/style/content-guide.md +++ b/content/zh/docs/contribute/style/content-guide.md @@ -15,19 +15,19 @@ weight: 10 本页包含 Kubernetes 文档的一些指南。 -如果你不清楚哪些事情是可以做的,请加入到 -[Kubernetes Slack](http://slack.k8s.io/) 的 `#sig-docs` 频道提问! -你可以在 http://slack.k8s.io 注册到 Kubernetes Slack。 +如果你不清楚哪些事情是可以做的,请加入到 +[Kubernetes Slack](https://slack.k8s.io/) 的 `#sig-docs` 频道提问! +你可以在 https://slack.k8s.io 注册到 Kubernetes Slack。 关于为 Kubernetes 文档创建新内容的更多信息,可参考 [样式指南](/zh/docs/contribute/style/style-guide)。 @@ -42,7 +42,7 @@ Source for the Kubernetes website, including the docs, resides in the Located in the `kubernetes/website/content//docs` folder, the majority of Kubernetes documentation is specific to the [Kubernetes -project](https://github.com/kubernetes/kubernetes). +project](https://github.com/kubernetes/kubernetes). ## What's allowed @@ -72,12 +72,12 @@ Kubernetes 网站(包括其文档)源代码位于 ### Third party content Kubernetes documentation includes applied examples of projects in the Kubernetes project—projects that live in the [kubernetes](https://github.com/kubernetes) and -[kubernetes-sigs](https://github.com/kubernetes-sigs) GitHub organizations. +[kubernetes-sigs](https://github.com/kubernetes-sigs) GitHub organizations. -Links to active content in the Kubernetes project are always allowed. +Links to active content in the Kubernetes project are always allowed. -Kubernetes requires some third party content to function. Examples include container runtimes (containerd, CRI-O, Docker), -[networking policy](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) (CNI plugins), [Ingress controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/), and [logging](https://kubernetes.io/docs/concepts/cluster-administration/logging/). +Kubernetes requires some third party content to function. Examples include container runtimes (containerd, CRI-O, Docker), +[networking policy](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) (CNI plugins), [Ingress controllers](/docs/concepts/services-networking/ingress-controllers/), and [logging](/docs/concepts/cluster-administration/logging/). Docs can link to third-party open source software (OSS) outside the Kubernetes project only if it's necessary for Kubernetes to function. --> @@ -94,7 +94,7 @@ Kubernetes 需要某些第三方内容才能正常工作。例如 容器运行时(containerd、CRI-O、Docker), [联网策略](/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) (CNI 插件),[Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers/) -以及[日志](https://kubernetes.io/zh/docs/concepts/cluster-administration/logging/)等。 +以及[日志](/zh/docs/concepts/cluster-administration/logging/)等。 只有对应的第三方开源软件(OSS)是运行 Kubernetes 所必需的,才可以在文档中包含 指向这些 Kubernetes 项目之外的软件的链接。 @@ -109,7 +109,8 @@ Dual-sourced content requires double the effort (or more!) to maintain and grows stale more quickly. {{< note >}} -If you're a maintainer for a Kubernetes project and need help hosting your own docs, + +If you're a maintainer for a Kubernetes project and need help hosting your own docs, ask for help in [#sig-docs on Kubernetes Slack](https://kubernetes.slack.com/messages/C1J0BPD2M/). {{< /note >}} --> @@ -128,15 +129,13 @@ ask for help in [#sig-docs on Kubernetes Slack](https://kubernetes.slack.com/mes ### 更多信息 {#more-information} -如果你对允许出现的内容有疑问,请加入到 [Kubernetes Slack](http://slack.k8s.io/) +如果你对允许出现的内容有疑问,请加入到 [Kubernetes Slack](https://slack.k8s.io/) 的 `#sig-docs` 频道提问! ## {{% heading "whatsnext" %}} * 阅读[样式指南](/zh/docs/contribute/style/style-guide)。 - - From 18578288959f949ed9cf0418b2d72e34bc485797 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 21 May 2022 09:53:34 +0100 Subject: [PATCH 082/245] Revert pull request 33842 This reverts commit a5907b3e72bbd7865346e72975d64d0163f0f935 due to an issue that has caused build failures. Verified locally. --- .../docs/reference/using-api/api-concepts.md | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/content/zh/docs/reference/using-api/api-concepts.md b/content/zh/docs/reference/using-api/api-concepts.md index 729eefae64..bf31ae7a78 100644 --- a/content/zh/docs/reference/using-api/api-concepts.md +++ b/content/zh/docs/reference/using-api/api-concepts.md @@ -1066,6 +1066,8 @@ 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} @@ -1138,11 +1140,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](/docs/concepts/overview/working-with-objects/names/#uids) the object and is randomly generated (non-deterministic) +* `creationTimestamp`/`deletionTimestamp`: records the time of creation/deletion +* `UID`: uniquely identifies 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 IP addresses that the kube-apiserver assigns to Service objects +* For the `Service` resource: Ports or IPs that kube-apiserver assigns to v1.Service objects --> ### 生成值 {#generated-values} @@ -1151,12 +1153,11 @@ Some values of an object are typically generated before the object is persisted. 值很可能不同。这类字段有: * `name`:如果设置了 `generateName` 字段,则 `name` 会获得一个唯一的随机名称 -* `creationTimestamp` / `deletionTimestamp`:记录对象的创建/删除时间 -* `UID`:[唯一标识](/zh/docs/concepts/overview/working-with-objects/names/#uids)对象, - 取值随机生成(非确定性) +* `creationTimestamp`/`deletionTimestamp`:记录对象的创建/删除时间 +* `UID`:唯一性标识对象,取值随机生成(非确定性) * `resourceVersion`: 跟踪对象的持久化(存储)版本 * 变更性准入控制器所设置的字段 -* 对于 `Service` 资源:`kube-apiserver` 为 `Service` 对象分配的端口和 IP 地址 +* 对于 `Service` 资源:`kube-apiserver` 为 `v1.Service` 对象分配的端口和 IP {{< table caption="list 操作的 resourceVersionMatch 与分页参数" >}} From 8b29e8229be8d6cb2a4c723d98e8e42009c3acf8 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Sat, 21 May 2022 16:56:00 +0530 Subject: [PATCH 083/245] Update container-runtimes.md (#33851) * Update container-runtimes.md * Update content/en/docs/setup/production-environment/container-runtimes.md Co-authored-by: Tim Bannister Co-authored-by: Tim Bannister --- .../setup/production-environment/container-runtimes.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/en/docs/setup/production-environment/container-runtimes.md b/content/en/docs/setup/production-environment/container-runtimes.md index 6f9b174631..4e6c2885fa 100644 --- a/content/en/docs/setup/production-environment/container-runtimes.md +++ b/content/en/docs/setup/production-environment/container-runtimes.md @@ -200,6 +200,14 @@ To use the `systemd` cgroup driver in `/etc/containerd/config.toml` with `runc`, [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] SystemdCgroup = true ``` +{{< note >}} +If you installed containerd from a package (for example, RPM or `.deb`), you may find +that the CRI integration plugin is disabled by default. + +You need CRI support enabled to use containerd with Kubernetes. Make sure that `cri` +is not included in the`disabled_plugins` list within `/etc/containerd/config.toml`; +if you made changes to that file, also restart `containerd`. +{{< /note >}} If you apply this change, make sure to restart containerd: From 58aae61611d07b65278e05c699ee08608f97dd78 Mon Sep 17 00:00:00 2001 From: Tom Kivlin <52716470+tomkivlin@users.noreply.github.com> Date: Sat, 21 May 2022 12:59:36 +0100 Subject: [PATCH 084/245] Remove refs to dockershim - Removed refs deprecated with dockershim - Tweaked header levels --- .../compute-storage-net/network-plugins.md | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 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 dc3940d5e9..b6736d745d 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 @@ -24,26 +24,19 @@ CNI specification (plugins can be compatible with multiple spec versions). ## Installation -A CNI plugin is required to implement the [Kubernetes network model](/docs/concepts/services-networking/#the-kubernetes-network-model). The CRI manages its own CNI plugins. There are two Kubelet command line parameters to keep in mind when using plugins: - -* `cni-bin-dir`: Kubelet probes this directory for plugins on startup -* `network-plugin`: The network plugin to use from `cni-bin-dir`. It must match the name reported by a plugin probed from the plugin directory. For CNI plugins, this is `cni`. +A CNI plugin is required to implement the [Kubernetes network model](/docs/concepts/services-networking/#the-kubernetes-network-model). The CRI manages its own CNI plugins, meaning the Kubelet isn't involved in installing or managing the plugins. Plugins are installed according to their own documentation. ## Network Plugin Requirements -Besides providing the [`NetworkPlugin` interface](https://github.com/kubernetes/kubernetes/tree/{{< param "fullversion" >}}/pkg/kubelet/dockershim/network/plugins.go) to configure and clean up pod networking, the plugin may also need specific support for kube-proxy. The iptables proxy obviously depends on iptables, and the plugin may need to ensure that container traffic is made available to iptables. For example, if the plugin connects containers to a Linux bridge, the plugin must set the `net/bridge/bridge-nf-call-iptables` sysctl to `1` to ensure that the iptables proxy functions correctly. If the plugin does not use a Linux bridge (but instead something like Open vSwitch or some other mechanism) it should ensure container traffic is appropriately routed for the proxy. +The plugin may also need specific support for kube-proxy. The iptables proxy obviously depends on iptables, and the plugin may need to ensure that container traffic is made available to iptables. For example, if the plugin connects containers to a Linux bridge, the plugin must set the `net/bridge/bridge-nf-call-iptables` sysctl to `1` to ensure that the iptables proxy functions correctly. If the plugin does not use a Linux bridge (but instead something like Open vSwitch or some other mechanism) it should ensure container traffic is appropriately routed for the proxy. By default if no kubelet network plugin is specified, the `noop` plugin is used, which sets `net/bridge/bridge-nf-call-iptables=1` to ensure simple configurations (like Docker with a bridge) work correctly with the iptables proxy. -### CNI +### Loopback CNI -The CNI plugin is selected by passing Kubelet the `--network-plugin=cni` command-line option. Kubelet reads a file from `--cni-conf-dir` (default `/etc/cni/net.d`) and uses the CNI configuration from that file to set up each pod's network. The CNI configuration file must match the [CNI specification](https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration), and any required CNI plugins referenced by the configuration must be present in `--cni-bin-dir` (default `/opt/cni/bin`). +In addition to the CNI plugin installed on the nodes, Kubernetes requires the standard CNI [`lo`](https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback/loopback.go) plugin, at minimum version 0.2.0 -If there are multiple CNI configuration files in the directory, the kubelet uses the configuration file that comes first by name in lexicographic order. - -In addition to the CNI plugin specified by the configuration file, Kubernetes requires the standard CNI [`lo`](https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback/loopback.go) plugin, at minimum version 0.2.0 - -#### Support hostPort +### Support hostPort The CNI networking plugin supports `hostPort`. You can use the official [portmap](https://github.com/containernetworking/plugins/tree/master/plugins/meta/portmap) plugin offered by the CNI plugin team or use your own plugin with portMapping functionality. @@ -80,7 +73,7 @@ For example: } ``` -#### Support traffic shaping +### Support traffic shaping **Experimental Feature** @@ -134,6 +127,6 @@ metadata: ## Usage Summary -* `--network-plugin=cni` specifies that we use the `cni` network plugin with actual CNI plugin binaries located in `--cni-bin-dir` (default `/opt/cni/bin`) and CNI plugin configuration located in `--cni-conf-dir` (default `/etc/cni/net.d`). +Once the Kubelet is installed and communicating with the Kubernetes API Server, a CNI plugin can be installed using the instructions for that plugin. ## {{% heading "whatsnext" %}} From 3b60dec955cdf3c66f6c6d81af59c099171938fa Mon Sep 17 00:00:00 2001 From: Tom Kivlin <52716470+tomkivlin@users.noreply.github.com> Date: Sat, 21 May 2022 13:20:51 +0100 Subject: [PATCH 085/245] Added info about v1.24 changes --- .../extend-kubernetes/compute-storage-net/network-plugins.md | 4 +++- 1 file changed, 3 insertions(+), 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 b6736d745d..799b4c0850 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 @@ -24,7 +24,9 @@ CNI specification (plugins can be compatible with multiple spec versions). ## Installation -A CNI plugin is required to implement the [Kubernetes network model](/docs/concepts/services-networking/#the-kubernetes-network-model). The CRI manages its own CNI plugins, meaning the Kubelet isn't involved in installing or managing the plugins. Plugins are installed according to their own documentation. +A CNI plugin is required to implement the [Kubernetes network model](/docs/concepts/services-networking/#the-kubernetes-network-model). +The CRI manages its own CNI plugins, with Kubelet no longer managing the plugins since the [dockershim was removed in v1.24](https://github.com/kubernetes/kubernetes/pull/106907). +CNI plugins are installed according to their own documentation. ## Network Plugin Requirements From 4c6c5ba3eb4cd9051a8c85e8a7a4c943ca9e8696 Mon Sep 17 00:00:00 2001 From: yuli Date: Fri, 20 May 2022 00:43:43 +0800 Subject: [PATCH 086/245] [zh]Sync reference-13 [zh]Sync reference-13 [zh]Sync reference-13 [zh]Sync reference-13 [zh]Sync reference-13 --- content/zh/docs/reference/kubectl/_index.md | 1083 ++++++++++++++++++- 1 file changed, 1082 insertions(+), 1 deletion(-) diff --git a/content/zh/docs/reference/kubectl/_index.md b/content/zh/docs/reference/kubectl/_index.md index 5c679220a6..38659b2e8d 100644 --- a/content/zh/docs/reference/kubectl/_index.md +++ b/content/zh/docs/reference/kubectl/_index.md @@ -1,4 +1,1085 @@ --- -title: "kubectl" +title: 命令行工具 (kubectl) +content_type: reference weight: 60 +no_list: true +card: + name: reference + weight: 20 --- + + + +{{< glossary_definition prepend="Kubernetes 提供" term_id="kubectl" length="short" >}} + + +这个工具叫做 `kubectl`。 + + +`针对配置信息,`kubectl` 在 `$HOME/.kube` 目录中查找一个名为 `config` 的配置文件。 +你可以通过设置 `KUBECONFIG` 环境变量或设置 +[`--kubeconfig`](/zh/docs/concepts/configuration/organize-cluster-access-kubeconfig/) +参数来指定其它 [kubeconfig](/zh/docs/concepts/configuration/organize-cluster-access-kubeconfig/) 文件。 + + +本文概述了 `kubectl` 语法和命令操作描述,并提供了常见的示例。 +有关每个命令的详细信息,包括所有受支持的参数和子命令, +请参阅 [kubectl](/docs/reference/generated/kubectl/kubectl-commands/) 参考文档。 + + +有关安装说明,请参见[安装 kubectl](/zh/docs/tasks/tools/#kubectl); +如需快速指南,请参见[备忘单](/zh/docs/reference/kubectl/cheatsheet/)。 +如果你更习惯使用 `docker` 命令行工具, +[Docker 用户的 `kubectl`](/zh/docs/reference/kubectl/docker-cli-to-kubectl/) +介绍了一些 Kubernetes 的等价命令。 + + + +## 语法 + +使用以下语法从终端窗口运行 `kubectl` 命令: + +```shell +kubectl [command] [TYPE] [NAME] [flags] +``` + + +其中 `command`、`TYPE`、`NAME` 和 `flags` 分别是: + + +* `command`:指定要对一个或多个资源执行的操作,例如 `create`、`get`、`describe`、`delete`。 + +* `TYPE`:指定[资源类型](#resource-types)。资源类型不区分大小写, + 可以指定单数、复数或缩写形式。例如,以下命令输出相同的结果: + + ```shell + kubectl get pod pod1 + kubectl get pods pod1 + kubectl get po pod1 + ``` + + +* `NAME`:指定资源的名称。名称区分大小写。 + 如果省略名称,则显示所有资源的详细信息。例如:`kubectl get pods`。 + + 在对多个资源执行操作时,你可以按类型和名称指定每个资源,或指定一个或多个文件: + + + * 要按类型和名称指定资源: + + * 要对所有类型相同的资源进行分组,请执行以下操作:`TYPE1 name1 name2 name<#>`。
    + 例子:`kubectl get pod example-pod1 example-pod2` + + * 分别指定多个资源类型:`TYPE1/name1 TYPE1/name2 TYPE2/name3 TYPE<#>/name<#>`。
    + 例子:`kubectl get pod/example-pod1 replicationcontroller/example-rc1` + + * 用一个或多个文件指定资源:`-f file1 -f file2 -f file<#>` + + * [使用 YAML 而不是 JSON](/zh/docs/concepts/configuration/overview/#general-configuration-tips), + 因为 YAML 对用户更友好, 特别是对于配置文件。
    + 例子:`kubectl get -f ./pod.yaml` + + +* `flags`: 指定可选的参数。例如,可以使用 `-s` 或 `--server` 参数指定 + Kubernetes API 服务器的地址和端口。 + + +{{< caution >}} +从命令行指定的参数会覆盖默认值和任何相应的环境变量。 +{{< /caution >}} + + +如果你需要帮助,在终端窗口中运行 `kubectl help`。 + + +## 集群内身份验证和命名空间覆盖 + + +默认情况下,`kubectl` 命令首先确定它是否在 Pod 中运行,从而被视为在集群中运行。 +它首先检查 `KUBERNETES_SERVICE_HOST` 和 `KUBERNETES_SERVICE_PORT` 环境变量以及 +`/var/run/secrets/kubernetes.io/serviceaccount/token` 中是否存在服务帐户令牌文件。 +如果三个条件都被满足,则假定在集群内进行身份验证。 + + +为保持向后兼容性,如果在集群内身份验证期间设置了 `POD_NAMESPACE` +环境变量,它将覆盖服务帐户令牌中的默认命名空间。 +任何依赖默认命名空间的清单或工具都会受到影响。 + + +**`POD_NAMESPACE` 环境变量** + + +如果设置了 `POD_NAMESPACE` 环境变量,对命名空间资源的 CLI 操作对象将使用该变量值作为默认值。 +例如,如果该变量设置为 `seattle`,`kubectl get pods` 将返回 `seattle` 命名空间中的 Pod。 +这是因为 Pod 是一个命名空间资源,且命令中没有提供命名空间。 + + +直接使用 `--namespace ` 会覆盖此行为。 + + +**kubectl 如何处理 ServiceAccount 令牌** + + +假设: +* 有 Kubernetes 服务帐户令牌文件挂载在 + `/var/run/secrets/kubernetes.io/serviceaccount/token` 上,并且 +* 设置了 `KUBERNETES_SERVICE_HOST` 环境变量,并且 +* 设置了 `KUBERNETES_SERVICE_PORT` 环境变量,并且 +* 你没有在 kubectl 命令行上明确指定命名空间。 + + +然后 kubectl 假定它正在你的集群中运行。 +kubectl 工具查找该 ServiceAccount 的命名空间 +(该命名空间与 Pod 的命名空间相同)并针对该命名空间进行操作。 +这与集群外运行的情况不同; +当 kubectl 在集群外运行并且你没有指定命名空间时, +kubectl 命令会针对 `default` 命名空间进行操作。 + + +## 操作 + + +下表包含所有 kubectl 操作的简短描述和普通语法: + + +操作 | 语法 | 描述 +-------------------- | -------------------- | -------------------- +`alpha` | `kubectl alpha SUBCOMMAND [flags]` | 列出与 alpha 特性对应的可用命令,这些特性在 Kubernetes 集群中默认情况下是不启用的。 +`annotate` | kubectl annotate (-f FILENAME | TYPE NAME | TYPE/NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--overwrite] [--all] [--resource-version=version] [flags] | 添加或更新一个或多个资源的注解。 +`api-resources` | `kubectl api-resources [flags]` | 列出可用的 API 资源。 +`api-versions` | `kubectl api-versions [flags]` | 列出可用的 API 版本。 + +`apply` | `kubectl apply -f FILENAME [flags]`| 从文件或 stdin 对资源应用配置更改。 +`attach` | `kubectl attach POD -c CONTAINER [-i] [-t] [flags]` | 挂接到正在运行的容器,查看输出流或与容器(stdin)交互。 +`auth` | `kubectl auth [flags] [options]` | 检查授权。 +`autoscale` | kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [flags] | 自动扩缩由副本控制器管理的一组 pod。 +`certificate` | `kubectl certificate SUBCOMMAND [options]` | 修改证书资源。 +`cluster-info` | `kubectl cluster-info [flags]` | 显示有关集群中主服务器和服务的端口信息。 +`completion` | `kubectl completion SHELL [options]` | 为指定的 Shell(Bash 或 Zsh)输出 Shell 补齐代码。 +`config` | `kubectl config SUBCOMMAND [flags]` | 修改 kubeconfig 文件。有关详细信息,请参阅各个子命令。 + +`convert` | `kubectl convert -f FILENAME [options]` | 在不同的 API 版本之间转换配置文件。配置文件可以是 YAML 或 JSON 格式。注意 - 需要安装 `kubectl-convert` 插件。 +`cordon` | `kubectl cordon NODE [options]` | 将节点标记为不可调度。 +`cp` | `kubectl cp [options]` | 从容器复制文件、目录或将文件、目录复制到容器。 +`create` | `kubectl create -f FILENAME [flags]` | 从文件或 stdin 创建一个或多个资源。 +`delete` | kubectl delete (-f FILENAME | TYPE [NAME | /NAME | -l label | --all]) [flags] | 基于文件、标准输入或通过指定标签选择器、名称、资源选择器或资源本身,删除资源。 +`describe` | kubectl describe (-f FILENAME | TYPE [NAME_PREFIX | /NAME | -l label]) [flags] | 显示一个或多个资源的详细状态。 +`diff` | `kubectl diff -f FILENAME [flags]`| 在当前起作用的配置和文件或标准输之间作对比 (**BETA**) + +`drain` | `kubectl drain NODE [options]` | 腾空节点以准备维护。 +`edit` | kubectl edit (-f FILENAME | TYPE NAME | TYPE/NAME) [flags] | 使用默认编辑器编辑和更新服务器上一个或多个资源的定义。 +`exec` | `kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]` | 对 Pod 中的容器执行命令。 +`explain` | `kubectl explain [--recursive=false] [flags]` | 获取多种资源的文档。例如 Pod、Node、Service 等。 +`expose` | kubectl expose (-f FILENAME | TYPE NAME | TYPE/NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [flags] | 将副本控制器、服务或 Pod 作为新的 Kubernetes 服务暴露。 +`get` | kubectl get (-f FILENAME | TYPE [NAME | /NAME | -l label]) [--watch] [--sort-by=FIELD] [[-o | --output]=OUTPUT_FORMAT] [flags] | 列出一个或多个资源。 +`kustomize` | kubectl kustomize [flags] [options]` | 列出从 kustomization.yaml 文件中的指令生成的一组 API 资源。参数必须是包含文件的目录的路径,或者是 git 存储库 URL,其路径后缀相对于存储库根目录指定了相同的路径。 + +`label` | kubectl label (-f FILENAME | TYPE NAME | TYPE/NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--overwrite] [--all] [--resource-version=version] [flags] | 添加或更新一个或多个资源的标签。 +`logs` | `kubectl logs POD [-c CONTAINER] [--follow] [flags]` | 打印 Pod 中容器的日志。 +`options` | `kubectl options` | 全局命令行选项列表,这些选项适用于所有命令。 +`patch` | kubectl patch (-f FILENAME | TYPE NAME | TYPE/NAME) --patch PATCH [flags] | 使用策略合并流程更新资源的一个或多个字段。 +`plugin` | `kubectl plugin [flags] [options]` | 提供用于与插件交互的实用程序。 +`port-forward` | `kubectl port-forward POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N] [flags]` | 将一个或多个本地端口转发到一个 Pod。 +`proxy` | `kubectl proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix] [flags]` | 运行访问 Kubernetes API 服务器的代理。 +`replace` | `kubectl replace -f FILENAME` | 基于文件或标准输入替换资源。 +`rollout` | `kubectl rollout SUBCOMMAND [options]` | 管理资源的上线。有效的资源类型包括:Deployment、 DaemonSet 和 StatefulSet。 +`run` | kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server | client | none] [--overrides=inline-json] [flags] | 在集群上运行指定的镜像。 + +`scale` | kubectl scale (-f FILENAME | TYPE NAME | TYPE/NAME) --replicas=COUNT [--resource-version=version] [--current-replicas=count] [flags] | 更新指定副本控制器的大小。 +`set` | `kubectl set SUBCOMMAND [options]` | 配置应用资源。 +`taint` | `kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N [options]` | 更新一个或多个节点上的污点。 +`top` | `kubectl top [flags] [options]` | 显示资源(CPU、内存、存储)的使用情况。 +`uncordon` | `kubectl uncordon NODE [options]` | 将节点标记为可调度。 +`version` | `kubectl version [--client] [flags]` | 显示运行在客户端和服务器上的 Kubernetes 版本。 +`wait` | kubectl wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=delete|--for condition=available] [options] | 实验特性:等待一种或多种资源的特定状况。 + + +了解更多有关命令操作的信息, +请参阅 [kubectl](/zh/docs/reference/kubectl/kubectl/) 参考文档。 + + +## 资源类型 + + +下表列出所有受支持的资源类型及其缩写别名。 + + +(以下输出可以通过 `kubectl api-resources` 获取,内容以 Kubernetes 1.19.1 版本为准。) + + +| 资源名 | 缩写名 | API 分组 | 按命名空间 | 资源类型 | +|---|---|---|---|---| +| `bindings` | | | true | Binding | +| `componentstatuses` | `cs` | | false | ComponentStatus | +| `configmaps` | `cm` | | true | ConfigMap | +| `endpoints` | `ep` | | true | Endpoints | +| `events` | `ev` | | true | Event | +| `limitranges` | `limits` | | true | LimitRange | +| `namespaces` | `ns` | | false | Namespace | +| `nodes` | `no` | | false | Node | +| `persistentvolumeclaims` | `pvc` | | true | PersistentVolumeClaim | +| `persistentvolumes` | `pv` | | false | PersistentVolume | +| `pods` | `po` | | true | Pod | +| `podtemplates` | | | true | PodTemplate | +| `replicationcontrollers` | `rc` | | true | ReplicationController | +| `resourcequotas` | `quota` | | true | ResourceQuota | +| `secrets` | | | true | Secret | +| `serviceaccounts` | `sa` | | true | ServiceAccount | +| `services` | `svc` | | true | Service | +| `mutatingwebhookconfigurations` | | admissionregistration.k8s.io | false | MutatingWebhookConfiguration | +| `validatingwebhookconfigurations` | | admissionregistration.k8s.io | false | ValidatingWebhookConfiguration | +| `customresourcedefinitions` | `crd,crds` | apiextensions.k8s.io | false | CustomResourceDefinition | +| `apiservices` | | apiregistration.k8s.io | false | APIService | +| `controllerrevisions` | | apps | true | ControllerRevision | +| `daemonsets` | `ds` | apps | true | DaemonSet | +| `deployments` | `deploy` | apps | true | Deployment | +| `replicasets` | `rs` | apps | true | ReplicaSet | +| `statefulsets` | `sts` | apps | true | StatefulSet | +| `tokenreviews` | | authentication.k8s.io | false | TokenReview | +| `localsubjectaccessreviews` | | authorization.k8s.io | true | LocalSubjectAccessReview | +| `selfsubjectaccessreviews` | | authorization.k8s.io | false | SelfSubjectAccessReview | +| `selfsubjectrulesreviews` | | authorization.k8s.io | false | SelfSubjectRulesReview | +| `subjectaccessreviews` | | authorization.k8s.io | false | SubjectAccessReview | +| `horizontalpodautoscalers` | `hpa` | autoscaling | true | HorizontalPodAutoscaler | +| `cronjobs` | `cj` | batch | true | CronJob | +| `jobs` | | batch | true | Job | +| `certificatesigningrequests` | `csr` | certificates.k8s.io | false | CertificateSigningRequest | +| `leases` | | coordination.k8s.io | true | Lease | +| `endpointslices` | | discovery.k8s.io | true | EndpointSlice | +| `events` | `ev` | events.k8s.io | true | Event | +| `ingresses` | `ing` | extensions | true | Ingress | +| `flowschemas` | | flowcontrol.apiserver.k8s.io | false | FlowSchema | +| `prioritylevelconfigurations` | | flowcontrol.apiserver.k8s.io | false | PriorityLevelConfiguration | +| `ingressclasses` | | networking.k8s.io | false | IngressClass | +| `ingresses` | `ing` | networking.k8s.io | true | Ingress | +| `networkpolicies` | `netpol` | networking.k8s.io | true | NetworkPolicy | +| `runtimeclasses` | | node.k8s.io | false | RuntimeClass | +| `poddisruptionbudgets` | `pdb` | policy | true | PodDisruptionBudget | +| `podsecuritypolicies` | `psp` | policy | false | PodSecurityPolicy | +| `clusterrolebindings` | | rbac.authorization.k8s.io | false | ClusterRoleBinding | +| `clusterroles` | | rbac.authorization.k8s.io | false | ClusterRole | +| `rolebindings` | | rbac.authorization.k8s.io | true | RoleBinding | +| `roles` | | rbac.authorization.k8s.io | true | Role | +| `priorityclasses` | `pc` | scheduling.k8s.io | false | PriorityClass | +| `csidrivers` | | storage.k8s.io | false | CSIDriver | +| `csinodes` | | storage.k8s.io | false | CSINode | +| `storageclasses` | `sc` | storage.k8s.io | false | StorageClass | +| `volumeattachments` | | storage.k8s.io | false | VolumeAttachment | + + + +## 输出选项 + + +有关如何格式化或排序某些命令的输出的信息,请参阅以下章节。有关哪些命令支持不同输出选项的详细信息, +请参阅 [kubectl](/zh/docs/reference/kubectl/kubectl/) 参考文档。 + + +### 格式化输出 + + +所有 `kubectl` 命令的默认输出格式都是人类可读的纯文本格式。要以特定格式在终端窗口输出详细信息, +可以将 `-o` 或 `--output` 参数添加到受支持的 `kubectl` 命令中。 + + +#### 语法 + +```shell +kubectl [command] [TYPE] [NAME] -o +``` + + +取决于具体的 `kubectl` 操作,支持的输出格式如下: + + +输出格式 | 描述 +--------------| ----------- +`-o custom-columns=` | 使用逗号分隔的[自定义列](#custom-columns)列表打印表。 +`-o custom-columns-file=` | 使用 `` 文件中的[自定义列](#custom-columns)模板打印表。 +`-o json` | 输出 JSON 格式的 API 对象 +`-o jsonpath=