add zh pages

This commit is contained in:
Karen Bradshaw
2020-06-01 09:23:39 -04:00
parent 21fd0a12f9
commit 4b35d4d401
303 changed files with 2764 additions and 2439 deletions
@@ -1,22 +1,23 @@
---
title: 使用 Kubernetes API 访问集群
content_template: templates/task
content_type: task
---
<!-- ---
title: Access Clusters Using the Kubernetes API
content_template: templates/task
content_type: task
--- -->
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to access clusters using the Kubernetes API. -->
本页展示了如何使用 Kubernetes API 访问集群
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- ## Accessing the cluster API -->
@@ -349,4 +350,4 @@ securely with the API server. -->
在每种情况下,Pod 的服务账号凭证被用于与 API 服务器的安全通信。
{{% /capture %}}
@@ -1,20 +1,21 @@
---
title: 访问集群上运行的服务
content_template: templates/task
content_type: task
---
{{% capture overview %}}
<!-- overview -->
本文展示了如何连接 Kubernetes 集群上运行的服务。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
## 访问集群上运行的服务
@@ -103,6 +104,6 @@ $ kubectl cluster-info
- Web 服务器不总是能够传递令牌,所以你可能需要使用基本(密码)认证。 Apiserver 可以配置为接受基本认证,但你的集群可能并没有这样配置。
- 某些 web 应用可能不能工作,特别是那些使用客户端侧 javascript 的应用,它们构造 url 的方式可能不能理解代理路径前缀。
{{% /capture %}}
@@ -1,22 +1,23 @@
---
title: 改变默认 StorageClass
content_template: templates/task
content_type: task
---
{{% capture overview %}}
<!-- overview -->
本文展示了如何改变默认的 Storage Class,它用于为没有特殊需求的 PersistentVolumeClaims 配置 volumes。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
## 为什么要改变默认 storage class
@@ -92,11 +93,12 @@ content_template: templates/task
gold (default) kubernetes.io/gce-pd 1d
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
* 了解更多关于 [StorageClasses](/docs/concepts/storage/persistent-volumes/)。
{{% /capture %}}
@@ -1,21 +1,22 @@
---
title: 更改 PersistentVolume 的回收策略
content_template: templates/task
content_type: task
---
{{% capture overview %}}
<!-- overview -->
本文展示了如何更改 Kubernetes PersistentVolume 的回收策略。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
## 为什么要更改 PersistentVolume 的回收策略
@@ -66,9 +67,10 @@ content_template: templates/task
在前面的输出中,你可以看到绑定到 claim `default/claim3` 的 volume 拥有的回收策略为 `Retain`。当用户删除 claim `default/claim3` 时,它不会被自动删除。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
* 了解更多关于 [PersistentVolumes](/docs/concepts/storage/persistent-volumes/)的信息。
* 了解更多关于 [PersistentVolumeClaims](/docs/user-guide/persistent-volumes/#persistentvolumeclaims) 的信息。
@@ -80,6 +82,6 @@ content_template: templates/task
* [PersistentVolumeClaim](/docs/api-reference/{{< param "version" >}}/#persistentvolumeclaim-v1-core)
* 查阅 [PersistentVolumeSpec](/docs/api-reference/{{< param "version" >}}/#persistentvolumeclaim-v1-core) 的 `persistentVolumeReclaimPolicy` 字段。
{{% /capture %}}
@@ -1,6 +1,6 @@
---
title: 配置多个调度器
content_template: templates/task
content_type: task
---
<!--
---
@@ -8,11 +8,11 @@ reviewers:
- davidopp
- madhusudancs
title: Configure Multiple Schedulers
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
Kubernetes ships with a default scheduler that is described [here](/docs/admin/kube-scheduler/).
@@ -34,16 +34,17 @@ A detailed description of how to implement a scheduler is outside the scope of t
关于实现调度器的具体细节描述超出了本文范围。
请参考 kube-scheduler 的实现,规范示例代码位于 [pkg/scheduler](https://github.com/kubernetes/kubernetes/tree/{{< param "githubbranch" >}}/pkg/scheduler)。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Package the scheduler
@@ -281,9 +282,9 @@ kubectl create -f pod3.yaml
kubectl get pods
```
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
### Verifying that the pods were scheduled using the desired schedulers
@@ -307,4 +308,4 @@ Alternatively, one could just look at the "Scheduled" entries in the event logs
kubectl get events
```
{{% /capture %}}
@@ -3,7 +3,7 @@ reviewers:
- mml
- wojtek-t
title: 为 Kubernetes 运行 etcd 集群
content_template: templates/task
content_type: task
---
<!--
---
@@ -11,27 +11,28 @@ reviewers:
- mml
- wojtek-t
title: Operating etcd clusters for Kubernetes
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
{{< glossary_definition term_id="etcd" length="all" prepend="etcd is a ">}}
-->
{{< glossary_definition term_id="etcd" length="all" prepend="etcd 是一个">}}
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Prerequisites
@@ -477,4 +478,4 @@ See ["kube-apiserver 1.13.x refuses to work when first etcd-server is not availa
请看 ["kube-apiserver 1.13.x refuses to work when first etcd-server is not available"](https://github.com/kubernetes/kubernetes/issues/72102).
{{% /capture %}}
@@ -3,7 +3,7 @@ reviewers:
- johnbelamaric
title: 使用 CoreDNS 进行服务发现
min-kubernetes-server-version: v1.9
content_template: templates/task
content_type: task
---
<!--
@@ -12,24 +12,25 @@ reviewers:
- johnbelamaric
title: Using CoreDNS for Service Discovery
min-kubernetes-server-version: v1.9
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page describes the CoreDNS upgrade process and how to install CoreDNS instead of kube-dns.
-->
此页面介绍了 CoreDNS 升级过程以及如何安装 CoreDNS 而不是 kube-dns。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## About CoreDNS
@@ -174,9 +175,10 @@ When resource utilisation is a concern, it may be useful to tune the configurati
-->
当涉及到资源利用时,优化内核的配置可能是有用的。有关详细信息,请参阅 [关于扩展 CoreDNS 的文档](https://github.com/coredns/deployment/blob/master/kubernetes/Scaling_CoreDNS.md)。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
You can configure [CoreDNS](https://coredns.io) to support many more use cases than
@@ -185,6 +187,6 @@ kube-dns by modifying the `Corefile`. For more information, see the
-->
您可以通过修改 `Corefile` 来配置 [CoreDNS](https://coredns.io),以支持比 ku-dns 更多的用例。有关更多信息,请参考 [CoreDNS 网站](https://coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/)。
{{% /capture %}}
@@ -4,7 +4,7 @@ reviewers:
- sjenning
- ConnorDoyle
- balajismaniam
content_template: templates/task
content_type: task
---
<!--
@@ -13,10 +13,10 @@ reviewers:
- sjenning
- ConnorDoyle
- balajismaniam
content_template: templates/task
content_type: task
--->
{{% capture overview %}}
<!-- overview -->
{{< feature-state for_k8s_version="v1.12" state="beta" >}}
@@ -31,15 +31,16 @@ directives.
按照设计,Kubernetes 对 pod 执行相关的很多方面进行了抽象,使得用户不必关心。然
而,为了正常运行,有些工作负载要求在延迟和/或性能方面有更强的保证。 为此,kubelet 提供方法来实现更复杂的负载放置策略,同时保持抽象,避免显式的放置指令。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## CPU Management Policies
@@ -311,4 +312,4 @@ equal to one. The `nginx` container is granted 2 exclusive CPUs.
--->
该 pod 属于 `Guaranteed` QoS 类型,因其指定了 `limits` 值,同时当未显式指定时,`requests` 值被设置为与 `limits` 值相等。同时,容器对 CPU 资源的限制值是一个大于或等于 1 的整数值。所以,该 `nginx` 容器被赋予 2 个独占 CPU。
{{% /capture %}}
@@ -3,17 +3,18 @@ approvers:
- caseydavenport
- danwinship
title: 声明网络策略
content_template: templates/task
content_type: task
---
{{% capture overview %}}
<!-- overview -->
本文可以帮助您开始使用 Kubernetes 的 [NetworkPolicy API](/docs/concepts/services-networking/network-policies/) 声明网络策略去管理 Pod 之间的通信
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
您首先需要有一个支持网络策略的 Kubernetes 集群。已经有许多支持 NetworkPolicy 的网络提供商,包括:
@@ -25,9 +26,9 @@ content_template: templates/task
**注意**:以上列表是根据产品名称按字母顺序排序,而不是按推荐或偏好排序。下面示例对于使用了上面任何提供商的 Kubernetes 集群都是有效的
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
## 创建一个`nginx` deployment 并且通过服务将其暴露
@@ -143,6 +144,6 @@ Hit enter for command prompt
Connecting to nginx (10.100.0.16:80)
/ #
```
{{% /capture %}}
@@ -4,7 +4,7 @@ reviewers:
- thockin
- wlan0
title: 开发云控制器管理器
content_template: templates/concept
content_type: concept
---
<!--
@@ -14,13 +14,13 @@ reviewers:
- thockin
- wlan0
title: Developing Cloud Controller Manager
content_template: templates/concept
content_type: concept
---
-->
{{% capture overview %}}
<!-- overview -->
{{< feature-state for_k8s_version="v1.11" state="beta" >}}
<!--
@@ -42,10 +42,10 @@ To dive a little deeper into implementation details, all cloud controller manage
-->
为了深入了解实施细节,所有云控制器管理器都将从 Kubernetes 核心导入依赖包,唯一的区别是每个项目都会通过调用 [cloudprovider.RegisterCloudProvider](https://github.com/kubernetes/cloud-provider/blob/master/plugins.go#L56-L66) 来注册自己的驱动,更新可用驱动的全局变量。
{{% /capture %}}
{{% capture body %}}
<!-- body -->
<!--
## Developing
@@ -81,4 +81,4 @@ For in-tree cloud providers, you can run the in-tree cloud controller manager as
-->
对于 in-tree 驱动,您可以将 in-tree 云控制器管理器作为群集中的 [Daemonset](/examples/admin/cloud/ccm-example.yaml) 运行。有关详细信息,请参阅 [运行的云控制器管理器文档](/docs/tasks/administer-cluster/running-cloud-controller.md)。
{{% /capture %}}
@@ -3,7 +3,7 @@ reviewers:
- bowei
- zihongz
title: 自定义 DNS 服务
content_template: templates/task
content_type: task
---
<!--
---
@@ -11,11 +11,11 @@ reviewers:
- bowei
- zihongz
title: Customizing DNS Service
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page explains how to configure your DNS Pod and customize the
DNS resolution process. In Kubernetes version 1.11 and later, CoreDNS is at GA
@@ -25,9 +25,10 @@ and [Using CoreDNS for Service Discovery](/docs/tasks/administer-cluster/coredns
本页说明如何配置 DNS Pod 和自定义 DNS 解析过程。 在 Kubernetes 1.11 和更高版本中,CoreDNS 位于 GA
并且默认情况下与 kubeadm 一起安装。 请参见[CoreDNS 的 ConfigMap 选项](#coredns-configmap-options)
and [使用 CoreDNS 进行服务发现](/docs/tasks/administer-cluster/coredns/)。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!--
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
* Kubernetes version 1.6 or later. To work with CoreDNS, version 1.9 or later.
@@ -37,9 +38,9 @@ see [the kubeadm reference documentation](/docs/reference/setup-tools/kubeadm/ku
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
* Kubernetes 版本 1.6 或更新。如果与 CoreDNS 匹配,版本 1.9 或更新。
* 合适的 add-on 插件: kube-dns 或 CoreDNS. 使用 kubeadm 安装,请参见 [kubeadm 帮助文档](/docs/reference/setup-tools/kubeadm/kubeadm-alpha/#cmd-phase-addon).
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Introduction
@@ -351,9 +352,9 @@ details about the configuration option format.
请参见 [ConfigMap options](#configmap-options) 有关配置选项格式的详细信息。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
#### Effects on Pods
@@ -498,7 +499,7 @@ data:
["172.16.0.1"]
```
{{% /capture %}}
<!--
## CoreDNS configuration equivalent to kube-dns
@@ -5,42 +5,44 @@ reviewers:
- bowei
- zihongz
title: Debug DNS 方案
content_template: templates/task
content_type: task
---
<!--
{{% capture overview %}}
<!-- overview -->
This page provides hints on diagnosing DNS problems.
{{% /capture %}}
-->
{{% capture overview %}}
<!-- overview -->
这篇文章提供了一些关于 DNS 问题诊断的方法。
{{% /capture %}}
<!--
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
* Kubernetes version 1.6 and above.
* The cluster must be configured to use the `coredns` (or `kube-dns`) addons.
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
-->
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
- {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
- Kubernetes 1.6 或者以上版本。
- 集群必须使用了 `coredns` (或者 `kube-dns`)插件。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
@@ -582,7 +584,7 @@ for more details on Cluster Federation and multi-site support.
## What's next
- [Autoscaling the DNS Service in a Cluster](/docs/tasks/administer-cluster/dns-horizontal-autoscaling/).
{{% /capture %}}
## -->
@@ -595,7 +597,7 @@ for more details on Cluster Federation and multi-site support.
- [集群里自动伸缩 DNS Service](/docs/tasks/administer-cluster/dns-horizontal-autoscaling/).
{{% /capture %}}
@@ -1,23 +1,24 @@
---
title: 集群 DNS 服务自动伸缩
content_template: templates/task
content_type: task
---
<!--
---
title: Autoscale the DNS Service in a Cluster
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to enable and configure autoscaling of the DNS service in a
Kubernetes cluster.
-->
本页展示了如何在集群中启用和配置 DNS 服务的自动伸缩功能。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -34,9 +35,9 @@ Kubernetes cluster.
* 建议使用 Kubernetes 1.4.0 或更高版本。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Determining whether DNS horizontal autoscaling is already enabled
@@ -414,9 +415,9 @@ dns-autoscaler 的路径一般为:
当 manifest 文件删除后,插件管理器将删除 dns-autoscaler Deployment。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## Understanding how DNS horizontal autoscaling works
@@ -476,12 +477,13 @@ is under consideration as a future development.
支持自定义 metric,类似于 [Horizontal Pod 自动伸缩](/docs/tasks/run-application/horizontal-pod-autoscale/) 所提供的,考虑未来进行开发。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
* Learn more about the
[implementation of cluster-proportional-autoscaler](https://github.com/kubernetes-incubator/cluster-proportional-autoscaler).
-->
* 了解更多关于 [cluster-proportional-autoscaler 实现](https://github.com/kubernetes-incubator/cluster-proportional-autoscaler)的相关信息。
{{% /capture %}}
@@ -3,7 +3,7 @@ reviewers:
- bowei
- freehan
title: 启用端点切片
content_template: templates/task
content_type: task
---
<!--
@@ -12,28 +12,29 @@ reviewers:
- bowei
- freehan
title: Enabling Endpoint Slices
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page provides an overview of enabling Endpoint Slices in Kubernetes.
-->
本页提供启用 Kubernetes 端点切片的总览
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Introduction
@@ -2,7 +2,7 @@
reviewers:
- smarterclayton
title: 静态加密 Secret 数据
content_template: templates/task
content_type: task
---
<!--
@@ -10,18 +10,19 @@ content_template: templates/task
reviewers:
- smarterclayton
title: Encrypting Secret Data at Rest
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to enable and configure encryption of secret data at rest.
-->
本文展示如何启用和配置静态 Secret 数据的加密
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -38,17 +39,18 @@ This page shows how to enable and configure encryption of secret data at rest.
* 静态数据加密在 1.7.0 中仍然是 alpha 版本,这意味着它可能会在没有通知的情况下进行更改。在升级到 1.8.0 之前,用户可能需要解密他们的数据。
{{% /capture %}}
{{< toc >}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Configuration and determining whether encryption at rest is already enabled
@@ -319,6 +321,6 @@ to force all secrets to be decrypted.
-->
并重新启动所有 `kube-apiserver` 进程。然后运行命令 `kubectl get secrets --all-namespaces -o json | kubectl replace -f -` 强制解密所有 secret。
{{% /capture %}}
@@ -1,15 +1,15 @@
---
title: 为节点发布扩展资源
content_template: templates/task
content_type: task
---
<!--
---
title: Advertise Extended Resources for a Node
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to specify extended resources for a Node.
@@ -19,17 +19,18 @@ resources that would otherwise be unknown to Kubernetes.
本文展示了如何为节点指定扩展资源。 扩展资源允许集群管理员发布节点级别的资源,这些资源在不进行发布的情况下无法被 Kubernetes 感知。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Get the names of your Nodes
@@ -342,10 +343,11 @@ http://localhost:8001/api/v1/nodes/<your-node-name>/status
kubectl describe node <your-node-name> | grep dongle
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
(你不应该看到任何输出)
@@ -368,4 +370,4 @@ kubectl describe node <your-node-name> | grep dongle
* [为 Namespace 配置最小和最大内存约束](/docs/tasks/administer-cluster/memory-constraint-namespace/)
* [为 Namespace 配置最小和最大 CPU 约束](/docs/tasks/administer-cluster/cpu-constraint-namespace/)
{{% /capture %}}
@@ -1,9 +1,9 @@
---
title: 关键插件 Pod 的调度保证
content_template: templates/concept
content_type: concept
---
{{% capture overview %}}
<!-- overview -->
<!--
In addition to Kubernetes core components like api-server, scheduler, controller-manager running on a master machine
@@ -19,9 +19,9 @@ vacated by the evicted critical add-on pod or the amount of resources available
如果关键插件被逐出(手动或作为升级等其他操作的副作用)或者变成挂起状态,群集可能会停止正常工作。
关键插件进入挂起状态的例子有:集群利用率过高;被逐出的关键插件 Pod 释放了空间,但该空间被之前悬决的 Pod 占用;由于其它原因导致节点上可用资源的总量发生变化。
{{% /capture %}}
{{% capture body %}}
<!-- body -->
<!--
### Marking pod as critical
@@ -37,4 +37,4 @@ To be considered critical, the pod has to run in the `kube-system` namespace (co
或者,也可以为 Pod 添加名为 `scheduler.alpha.kubernetes.io/critical-pod`、值为空字符串的注解。
不过,这一注解从 1.13 版本开始不再推荐使用,并将在 1.14 中删除。
{{% /capture %}}
@@ -4,7 +4,7 @@ reviewers:
translaters:
- Coffey Gao
title: 搭建高可用的 Kubernetes Masters
content_template: templates/task
content_type: task
---
<!--
@@ -12,12 +12,12 @@ content_template: templates/task
reviewers:
- jszczepkowski
title: Set up High-Availability Kubernetes Masters
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
{{< feature-state for_k8s_version="1.5" state="alpha" >}}
<!--
@@ -28,16 +28,17 @@ This document describes how to use kube-up/down scripts to manage highly availab
您可以在谷歌计算引擎(GCE)的 `kubeup``kube-down` 脚本中复制 Kubernetes Master。
本文描述了如何使用 kube-up/down 脚本来管理高可用(HA)的 Master,以及如何使用 GCE 实现高可用 Master。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Starting an HA-compatible cluster
@@ -225,9 +226,9 @@ This operation may be sped up by migrating etcd data directory, as described [he
(我们正在考虑在未来添加对迁移 etcd 数据存储的支持)。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## Implementation notes
@@ -342,4 +343,4 @@ To make such deployment secure, communication between etcd instances is authoriz
[自动化高可用集群部署 - 设计文档](https://git.k8s.io/community/contributors/design-proposals/cluster-lifecycle/ha_master.md)
{{% /capture %}}
@@ -1,28 +1,29 @@
---
title: IP Masquerade Agent 用户指南
content_template: templates/task
content_type: task
---
<!--
---
title: IP Masquerade Agent User Guide
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to configure and enable the ip-masq-agent.
-->
此页面展示如何配置和启用 ip-masq-agent。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## IP Masquerade Agent User Guide
-->
@@ -124,9 +125,9 @@ By default, in GCE/Google Kubernetes Engine starting with Kubernetes version 1.7
-->
默认情况下,从 Kubernetes 1.7.0 版本开始的 GCE/Google Kubernetes Engine 中,如果启用了网络策略,或者您使用的集群 CIDR 不在 10.0.0.0/8 范围内,则 ip-masq-agent 将在您的集群中运行。如果您在其他环境中运行,则可以将 ip-masq-agent [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) 添加到您的集群:
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create an ip-masq-agent
@@ -217,4 +218,4 @@ nonMasqueradeCIDRs:
resyncInterval: 60s
masqLinkLocal: true
```
{{% /capture %}}
@@ -2,22 +2,23 @@
reviewers:
- smarterclayton
title: 使用 KMS 提供商进行数据加密
content_template: templates/task
content_type: task
---
<!-- ---
reviewers:
- smarterclayton
title: Using a KMS provider for data encryption
content_template: templates/task
content_type: task
--- -->
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to configure a Key Management Service (KMS) provider and plugin to enable secret data encryption. -->
本页展示了如何配置秘钥管理服务—— Key Management Service (KMS) 提供商和插件以启用数据加密。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -31,9 +32,9 @@ content_template: templates/task
{{< feature-state for_k8s_version="v1.12" state="beta" >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- The KMS encryption provider uses an envelope encryption scheme to encrypt data in etcd. The data is encrypted using a data encryption key (DEK); a new DEK is generated for each encryption. The DEKs are encrypted with a key encryption key (KEK) that is stored and managed in a remote KMS. The KMS provider uses gRPC to communicate with a specific KMS
plugin. The KMS plugin, which is implemented as a gRPC server and deployed on the same host(s) as the Kubernetes master(s), is responsible for all communication with the remote KMS. -->
@@ -278,6 +279,6 @@ resources:
kubectl get secrets --all-namespaces -o json | kubectl replace -f -
```
{{% /capture %}}
@@ -2,18 +2,18 @@
reviewers:
- sig-cluster-lifecycle
title: 使用 kubeadm 进行证书管理
content_template: templates/task
content_type: task
---
<!--
---
reviewers:
- sig-cluster-lifecycle
title: Certificate Management with kubeadm
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
{{< feature-state for_k8s_version="v1.15" state="stable" >}}
@@ -23,9 +23,10 @@ Client certificates generated by [kubeadm](/docs/reference/setup-tools/kubeadm/k
由 [kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/) 生成的客户端证书在 1 年后到期。 本页说明如何使用 kubeadm 管理证书续订。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!--
Be familiar with [PKI certificates and requirements in Kubernetes](/docs/setup/certificates/).
@@ -38,9 +39,9 @@ You should be familiar with [PKI certificates and requirements in Kubernetes](/d
-->
您应该熟悉[Kubernetes 中的 PKI 证书和要求](/docs/setup/best-practices/certificates/)。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Check certificate expiration
@@ -387,4 +388,3 @@ After a certificate is signed using your preferred method, the certificate and t
[cert-cas]: /docs/setup/best-practices/certificates/#single-root-ca
[cert-table]: /docs/setup/best-practices/certificates/#all-certificates
{{% /capture %}}
@@ -2,18 +2,18 @@
reviewers:
- sig-cluster-lifecycle
title: 升级 kubeadm 集群
content_template: templates/task
content_type: task
---
<!--
---
reviewers:
- sig-cluster-lifecycle
title: Upgrading kubeadm clusters
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page explains how to upgrade a Kubernetes cluster created with kubeadm from version
@@ -49,9 +49,10 @@ The upgrade workflow at high level is the following:
1. 升级其他控制平面节点。
1. 升级工作节点。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!--
- You need to have a kubeadm Kubernetes cluster running version 1.16.0 or later.
@@ -83,9 +84,9 @@ The upgrade workflow at high level is the following:
- 您只能从一个次版本升级到下一个次版本,或者同样次版本的补丁版。也就是说,升级时无法跳过版本。
例如,您只能从 1.y 升级到 1.y+1,而不能从 from 1.y 升级到 1.y+2。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Determine which version to upgrade to
@@ -612,7 +613,7 @@ The `STATUS` column should show `Ready` for all your nodes, and the version numb
-->
`STATUS` 应显示所有节点为 `Ready` 状态,并且版本号已经被更新。
{{% /capture %}}
<!--
## Recovering from a failure state
@@ -3,7 +3,7 @@ reviewers:
- mtaufen
- dawnchen
title: 通过配置文件设置 Kubelet 参数
content_template: templates/task
content_type: task
---
<!--
---
@@ -11,11 +11,11 @@ reviewers:
- mtaufen
- dawnchen
title: Set Kubelet parameters via a config file
content_template: templates/task
content_type: task
---
--->
{{% capture overview %}}
<!-- overview -->
{{< feature-state state="beta" >}}
<!--
@@ -31,18 +31,19 @@ it simplifies node deployment and configuration management.
--->
建议通过配置文件的方式提供参数,因为这样可以简化节点部署和配置管理。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!--
- A v1.10 or higher Kubelet binary must be installed for beta functionality.
--->
- 需要安装 1.10 或更高版本的 Kubelet 二进制文件,才能实现 beta 功能。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create the config file
@@ -98,9 +99,9 @@ In the above example, this version is `kubelet.config.k8s.io/v1beta1`.
--->
请注意,命令行参数和 Kubelet 配置文件的某些默认值不同。如果设置了 `--config`,并且没有通过命令行指定值,则 `KubeletConfiguration` 版本的默认值生效。在上面的例子中,version 是 `kubelet.config.k8s.io/v1beta1`
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## Relationship to Dynamic Kubelet Config
@@ -113,6 +114,6 @@ feature, the combination of configuration provided via `--config` and any flags
is considered the default "last known good" configuration by the automatic rollback mechanism.
--->
如果您正在使用 [动态 Kubelet 配置](/docs/tasks/administer-cluster/reconfigure-kubelet) 特性,那么自动回滚机制将认为是 "最后已知正常(last known good" 的配置,通过 `--config` 提供的配置与覆盖这些值的任何参数的结合。
{{% /capture %}}
@@ -1,16 +1,16 @@
---
title: 限制存储消耗
content_template: templates/task
content_type: task
---
<!--
---
title: Limit Storage Consumption
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This example demonstrates an easy way to limit the amount of storage consumed in a namespace.
@@ -24,15 +24,16 @@ and [PersistentVolumeClaim](/docs/concepts/storage/persistent-volumes/).
-->
演示中用到了以下资源:[ResourceQuota](/docs/concepts/policy/resource-quotas/)[LimitRange](/docs/tasks/administer-cluster/memory-default-namespace/) 和 [PersistentVolumeClaim](/docs/concepts/storage/persistent-volumes/)。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Scenario: Limiting Storage Consumption
@@ -123,9 +124,9 @@ spec:
requests.storage: "5Gi"
```
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## Summary
@@ -138,6 +139,6 @@ cluster's storage budget without risk of any one project going over their allotm
-->
限制范围对象可以用来设置可请求的存储量上限,而资源配额对象则可以通过申领计数和累计存储容量有效地限制命名空间耗用的存储量。这两种机制使得集群管理员能够规划其集群存储预算而不会发生任一项目超量分配的风险。
{{% /capture %}}
@@ -1,18 +1,18 @@
---
title: 为命名空间配置CPU最小和最大限制
content_template: templates/task
content_type: task
weight: 40
---
<!--
---
title: Configure Minimum and Maximum CPU Constraints for a Namespace
content_template: templates/task
content_type: task
weight: 40
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to set minimum and maximum values for the CPU resources used by Containers
@@ -24,10 +24,11 @@ in the namespace.
本章介绍命名空间中可以被容器和Pod使用的CPU资源的最小和最大值。你可以通过 [LimitRange](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#limitrange-v1-core) 对象声明 CPU 的最小和最大值. 如果 Pod 不能满足 LimitRange 的限制,它就不能在命名空间中创建。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -37,10 +38,10 @@ Each node in your cluster must have at least 1 CPU.
你的集群中每个节点至少要有1个CPU。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create a namespace
@@ -401,9 +402,10 @@ Delete your namespace:
kubectl delete namespace constraints-cpu-example
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -453,4 +455,4 @@ kubectl delete namespace constraints-cpu-example
* [为 Pod 配置 Service 数量](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -1,18 +1,18 @@
---
title: 为命名空间配置默认的CPU请求和限制
content_template: templates/task
content_type: task
weight: 20
---
<!--
---
title: Configure Default CPU Requests and Limits for a Namespace
content_template: templates/task
content_type: task
weight: 20
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to configure default CPU requests and limits for a namespace.
A Kubernetes cluster can be divided into namespaces. If a Container is created in a namespace
@@ -23,14 +23,15 @@ under certain conditions that are explained later in this topic.
本章介绍怎样为命名空间配置默认的 CPU 请求和限制。
一个 Kubernetes 集群可被划分为多个命名空间。如果在配置了 CPU 限制的命名空间创建容器,并且该容器没有声明自己的 CPU 限制,那么这个容器会被指定默认的 CPU 限制。Kubernetes 在一些特定情况还会指定 CPU 请求,本文后续章节将会对其进行解释。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create a namespace
@@ -256,9 +257,10 @@ it can be allowed to run in a namespace that is restricted by a quota.
如果容器没有声明自己的 CPU 限制,将会给它一个默认限制,这样它就能被允许运行在一个有配额限制的命名空间中。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -312,4 +314,4 @@ it can be allowed to run in a namespace that is restricted by a quota.
* [为 Pod 配置 Service 数量](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -1,18 +1,18 @@
---
title: 配置命名空间的最小和最大内存约束
content_template: templates/task
content_type: task
weight: 30
---
<!--
---
title: Configure Minimum and Maximum Memory Constraints for a Namespace
content_template: templates/task
content_type: task
weight: 30
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to set minimum and maximum values for memory used by Containers
@@ -24,10 +24,11 @@ it cannot be created in the namespace.
此页面介绍如何设置在命名空间中运行的容器使用的内存的最小值和最大值。 您可以在 [LimitRange](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#limitrange-v1-core)对象中指定最小和最大内存值。 如果 Pod 不满足 LimitRange 施加的约束,则无法在命名空间中创建它。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -37,10 +38,10 @@ Each node in your cluster must have at least 1 GiB of memory.
集群中每个节点必须至少要有1 GiB 的内存。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create a namespace
@@ -387,9 +388,10 @@ Delete your namespace:
kubectl delete namespace constraints-mem-example
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -439,4 +441,4 @@ kubectl delete namespace constraints-mem-example
* [为 Pod 配置 Service 数量](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -1,18 +1,18 @@
---
title: 为命名空间配置默认的内存请求和限制
content_template: templates/task
content_type: task
weight: 10
---
<!--
---
title: Configure Default Memory Requests and Limits for a Namespace
content_template: templates/task
content_type: task
weight: 10
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to configure default memory requests and limits for a namespace.
@@ -23,9 +23,10 @@ Kubernetes assigns a default memory request under certain conditions that are ex
本文介绍怎样给命名空间配置默认的内存请求和限制。如果在一个有默认内存限制的命名空间创建容器,该容器没有声明自己的内存限制时,将会被指定默认内存限制。Kubernetes 还为某些情况指定了默认的内存请求,本章后面会进行介绍。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -35,9 +36,9 @@ Each node in your cluster must have at least 2 GiB of memory.
你的集群中的每个节点必须至少有2 GiB的内存。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create a namespace
@@ -274,9 +275,10 @@ it can be allowed to run in a namespace that is restricted by a quota.
如果一个容器没有声明自己的内存限制,会被指定默认限制,然后它才会被允许在限定了配额的命名空间中运行。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -330,4 +332,4 @@ it can be allowed to run in a namespace that is restricted by a quota.
* [为 Pod 配置服务数量](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -1,18 +1,18 @@
---
title: 为命名空间配置内存和 CPU 配额
content_template: templates/task
content_type: task
weight: 50
---
<!--
---
title: Configure Memory and CPU Quotas for a Namespace
content_template: templates/task
content_type: task
weight: 50
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to set quotas for the total amount memory and CPU that
@@ -25,10 +25,11 @@ object.
对象设置配额.
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
@@ -38,10 +39,10 @@ Each node in your cluster must have at least 1 GiB of memory.
集群中每个节点至少有1 GiB的内存。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create a namespace
@@ -245,9 +246,10 @@ Delete your namespace:
kubectl delete namespace quota-mem-cpu-example
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -297,4 +299,4 @@ kubectl delete namespace quota-mem-cpu-example
* [为 Pod 配置 Service 数量](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -1,26 +1,27 @@
---
title: 配置命名空间下pod总数
content_template: templates/task
content_type: task
weight: 60
---
{{% capture overview %}}
<!-- overview -->
本文主要描述如何配置一个命名空间下可运行的pod总数。资源配额详细信息可查看:[资源配额](/docs/api-reference/v1.7/#resourcequota-v1-core)
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
## 创建一个命名空间
@@ -102,9 +103,10 @@ lastUpdateTime: 2017-07-07T20:57:05Z
kubectl delete namespace quota-pod-example
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
### 对于集群管理
@@ -128,7 +130,7 @@ kubectl delete namespace quota-pod-example
* [配置pod的QoS](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -3,17 +3,17 @@ reviewers:
- derekwaynecarr
- janetkuo
title: 命名空间演练
content_template: templates/task
content_type: task
---
<!-- ---
reviewers:
- derekwaynecarr
- janetkuo
title: Namespaces Walkthrough
content_template: templates/task
content_type: task
--- -->
{{% capture overview %}}
<!-- overview -->
<!-- Kubernetes {{< glossary_tooltip text="namespaces" term_id="namespace" >}}
help different projects, teams, or customers to share a Kubernetes cluster. -->
@@ -38,16 +38,17 @@ Kubernetes {{< glossary_tooltip text="命名空间" term_id="namespace" >}}
此示例演示了如何使用 Kubernetes 命名空间细分群集。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- ## Prerequisites -->
@@ -383,4 +384,4 @@ authorization rules for each namespace. -->
随着 Kubernetes 中的策略支持的发展,我们将扩展此场景,以展示如何为每个命名空间提供不同的授权规则。
{{% /capture %}}
@@ -3,33 +3,34 @@ reviewers:
- derekwaynecarr
- janetkuo
title: 通过命名空间共享集群
content_template: templates/task
content_type: task
---
<!-- ---
reviewers:
- derekwaynecarr
- janetkuo
title: Share a Cluster with Namespaces
content_template: templates/task
content_type: task
--- -->
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to view, work in, and delete {{< glossary_tooltip text="namespaces" term_id="namespace" >}}. The page also shows how to use Kubernetes namespaces to subdivide your cluster. -->
本页展示了如何查看、使用和删除{{< glossary_tooltip text="namespaces" term_id="namespace" >}}。本页同时展示了如何使用 Kubernetes 命名空间去细分集群。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!-- * Have an [existing Kubernetes cluster](/docs/setup/).
* Have a basic understanding of Kubernetes _[Pods](/docs/concepts/workloads/pods/pod/)_, _[Services](/docs/concepts/services-networking/service/)_, and _[Deployments](/docs/concepts/workloads/controllers/deployment/)_. -->
* 您已拥有一个 [配置好的 Kubernetes 集群](/docs/setup/).
* 您已对 Kubernetes 的 _[Pods](/docs/concepts/workloads/pods/pod/)_, _[Services](/docs/concepts/services-networking/service/)_, 和 _[Deployments](/docs/concepts/workloads/controllers/deployment/)_ 有基本理解。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- ## Viewing namespaces -->
@@ -460,9 +461,9 @@ authorization rules for each namespace. -->
随着 Kubernetes 中的策略支持的发展,我们将扩展此场景,以展示如何为每个命名空间提供不同的授权规则。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!-- ## Understanding the motivation for using namespaces -->
@@ -552,9 +553,10 @@ across namespaces, you need to use the fully qualified domain name (FQDN). -->
当您创建 [Service](/docs/concepts/services-networking/service/) 时,它会创建相应的 [DNS 条目](/docs/concepts/services-networking/dns-pod-service/)。此条目的格式为 `<service-name>。<namespace-name> .svc.cluster.local`,这意味着如果容器只使用 `<service-name>`,它将解析为本地服务到命名空间。 这对于在多个命名空间(如开发,暂存和生产)中使用相同的配置非常有用。 如果要跨命名空间访问,则需要使用完全限定的域名(FQDN)。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!-- * Learn more about [setting the namespace preference](/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-preference).
* Learn more about [setting the namespace for a request](/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-for-a-request)
* See [namespaces design](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/architecture/namespaces.md). -->
@@ -564,6 +566,6 @@ across namespaces, you need to use the fully qualified domain name (FQDN). -->
* 了解更多 [设置请求的命名空间](/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-for-a-request) 的内容。
* 参见 [命名空间设计](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/architecture/namespaces.md)。
{{% /capture %}}
@@ -2,22 +2,23 @@
reviewers:
- caseydavenport
title: 使用 Calico 作为 NetworkPolicy
content_template: templates/task
content_type: task
weight: 10
---
{{% capture overview %}}
<!-- overview -->
<!-- This page shows a couple of quick ways to create a Calico cluster on Kubernetes. -->
本页展示了两种在 Kubernetes 上快速创建 Calico 集群的方法。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!-- Decide whether you want to deploy a [cloud](#creating-a-calico-cluster-with-google-kubernetes-engine-gke) or [local](#creating-a-local-calico-cluster-with-kubeadm) cluster. -->
决定您想部署一个[](#在-Google-Kubernetes-Engine-GKE-上创建一个-Calico-集群) 还是 [本地](#使用-kubeadm-创建一个本地-Calico-集群) 集群。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- ## Creating a Calico cluster with Google Kubernetes Engine (GKE)
**Prerequisite**: [gcloud](https://cloud.google.com/sdk/docs/quickstarts).
@@ -80,10 +81,11 @@ To get a local single-host Calico cluster in fifteen minutes using kubeadm, refe
在15分钟内使用 kubeadm 得到一个本地单主机 Calico 集群,请参考
[Calico 快速入门](https://docs.projectcalico.org/latest/getting-started/kubernetes/)。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!-- Once your cluster is running, you can follow the [Declare Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) to try out Kubernetes NetworkPolicy. -->
集群运行后,您可以按照 [声明 Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) 去尝试使用 Kubernetes NetworkPolicy。
{{% /capture %}}
@@ -2,11 +2,11 @@
reviewers:
- danwent
title: 使用 Cilium 作为 NetworkPolicy
content_template: templates/task
content_type: task
weight: 20
---
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to use Cilium for NetworkPolicy.
For background on Cilium, read the [Introduction to Cilium](https://cilium.readthedocs.io/en/latest/intro). -->
@@ -15,15 +15,16 @@ For background on Cilium, read the [Introduction to Cilium](https://cilium.readt
关于 Cilium 的背景知识,请阅读 [Cilium 介绍](https://cilium.readthedocs.io/en/latest/intro)。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Deploying Cilium on Minikube for Basic Testing
@@ -71,9 +72,9 @@ production DaemonSet files.
关于部署 Cilium 用于生产的详细说明,请见[Cilium Kubernetes 安装指南](https://cilium.readthedocs.io/en/latest/gettingstarted/#installation)
,此文档包括详细的需求、说明和生产用途 DaemonSet 文件示例。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## Understanding Cilium components
@@ -116,9 +117,10 @@ configuration because it automatically connects to the minikube's etcd instance.
包括了一个示例 DaemonSet,可以自定义指定此键值存储集群。
简单的 minikube 的“一体化” DaemonSet 不需要这样的配置,因为它会自动连接到 minikube 的 etcd 实例。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!-- Once your cluster is running, you can follow the
[Declare Network Policy](/docs/tasks/administer-cluster/declare-network-policy/)
to try out Kubernetes NetworkPolicy with Cilium.
@@ -129,5 +131,5 @@ Have fun, and if you have questions, contact us using the
玩得开心,如果您有任何疑问,请联系我们
[Cilium Slack Channel](https://cilium.herokuapp.com/)。
{{% /capture %}}
@@ -2,30 +2,32 @@
reviewers:
- murali-reddy
title: 使用 Kube-router 作为 NetworkPolicy
content_template: templates/task
content_type: task
weight: 30
---
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to use [Kube-router](https://github.com/cloudnativelabs/kube-router) for NetworkPolicy. -->
本页展示了如何使用 [Kube-router](https://github.com/cloudnativelabs/kube-router) 作为 NetworkPolicy。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!-- You need to have a Kubernetes cluster running. If you do not already have a cluster, you can create one by using any of the cluster installers like Kops, Bootkube, Kubeadm etc. -->
您需要拥有一个正在运行的 Kubernetes 集群。如果您还没有集群,可以使用任意的集群安装器如 Kops,BootkubeKubeadm 等创建一个。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- ## Installing Kube-router addon
The Kube-router Addon comes with a Network Policy Controller that watches Kubernetes API server for any NetworkPolicy and pods updated and configures iptables rules and ipsets to allow or block traffic as directed by the policies. Please follow the [trying Kube-router with cluster installers](https://www.kube-router.io/docs/user-guide/#try-kube-router-with-cluster-installers) guide to install Kube-router addon. -->
## 安装 Kube-router 插件
Kube-router 插件自带一个Network Policy 控制器,监视来自于Kubernetes API server 的 NetworkPolicy 和 pods 的变化,根据策略指示配置 iptables 规则和 ipsets 来允许或阻止流量。请根据 [尝试通过集群安装器使用 Kube-router](https://www.kube-router.io/docs/user-guide/#try-kube-router-with-cluster-installers) 指南安装 Kube-router 插件。
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!-- Once you have installed the Kube-router addon, you can follow the [Declare Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) to try out Kubernetes NetworkPolicy. -->
在您安装 Kube-router 插件后,可以根据 [声明 Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) 去尝试使用 Kubernetes NetworkPolicy。
{{% /capture %}}
@@ -2,25 +2,26 @@
reviewers:
- chrismarino
title: 使用 Romana 作为 NetworkPolicy
content_template: templates/task
content_type: task
weight: 40
---
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to use Romana for NetworkPolicy. -->
本页展示如何使用 Romana 作为 NetworkPolicy。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!-- Complete steps 1, 2, and 3 of the [kubeadm getting started guide](/docs/getting-started-guides/kubeadm/). -->
完成[kubeadm 入门指南](/docs/getting-started-guides/kubeadm/)中的1、2、3步。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Installing Romana with kubeadm
@@ -46,12 +47,13 @@ To apply network policies use one of the following:
* [Romana 网络策略例子](https://github.com/romana/core/blob/master/doc/policy.md)
* NetworkPolicy API
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
Once you have installed Romana, you can follow the [Declare Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) to try out Kubernetes NetworkPolicy.
-->
Romana 安装完成后,您可以按照[声明 Network Policy](/docs/tasks/administer-cluster/declare-network-policy/)去尝试使用 Kubernetes NetworkPolicy。
{{% /capture %}}
@@ -2,26 +2,27 @@
reviewers:
- bboreham
title: 使用 Weave Net 作为 NetworkPolicy
content_template: templates/task
content_type: task
weight: 50
---
{{% capture overview %}}
<!-- overview -->
<!-- This page shows how to use Weave Net for NetworkPolicy. -->
本页展示了如何使用使用 Weave Net 作为 NetworkPolicy。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!--
You need to have a Kubernetes cluster. Follow the [kubeadm getting started guide](/docs/getting-started-guides/kubeadm/) to bootstrap one.
-->
您需要拥有一个 Kubernetes 集群。按照[kubeadm 入门指南](/docs/getting-started-guides/kubeadm/)来引导一个。
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Install the Weave Net addon
@@ -69,13 +70,14 @@ weave-net-pmw8w 2/2 Running 0 9d
<!-- Each Node has a weave Pod, and all Pods are `Running` and `2/2 READY`. (`2/2` means that each Pod has `weave` and `weave-npc`.) -->
每个 Node 都有一个 weave Pod,所有 Pod 都是`Running``2/2 READY`。(`2/2`表示每个Pod都有`weave``weave-npc`。)
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
Once you have installed the Weave Net addon, you can follow the [Declare Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) to try out Kubernetes NetworkPolicy. If you have any question, contact us at [#weave-community on Slack or Weave User Group](https://github.com/weaveworks/weave#getting-help).
-->
安装Weave Net插件后,您可以按照[声明网络策略](/docs/tasks/administration-cluster/declare-network-policy/)来试用 Kubernetes NetworkPolicy。 如果您有任何疑问,请联系我们[#weave-community on Slack 或 Weave User Group](https://github.com/weaveworks/weave#getting-help)。
{{% /capture %}}
@@ -3,7 +3,7 @@ reviewers:
- bowei
- zihongz
title: 在 Kubernetes 集群中使用 NodeLocal DNSCache
content_template: templates/task
content_type: task
---
<!--
---
@@ -11,24 +11,25 @@ reviewers:
- bowei
- zihongz
title: Using NodeLocal DNSCache in Kubernetes clusters
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page provides an overview of NodeLocal DNSCache feature in Kubernetes.
-->
本页概述了 Kubernetes 中的 NodeLocal DNSCache 功能。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Introduction
@@ -154,5 +155,5 @@ The addon can be applied using the yaml specified above in any k8s version. The
| 1.15 | Beta(默认情况下未启用) |
| 1.13 | Alpha(默认情况下未启用) |
{{% /capture %}}
@@ -4,7 +4,7 @@ reviewers:
- vishh
- timstclair
title: 配置资源不足时的处理方式
content_template: templates/concept
content_type: concept
---
<!--
---
@@ -13,11 +13,11 @@ reviewers:
- vishh
- timstclair
title: Configure Out Of Resource Handling
content_template: templates/concept
content_type: concept
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page explains how to configure out of resource handling with `kubelet`.
@@ -32,10 +32,10 @@ nodes become unstable.
当可用计算资源较少时,`kubelet`需要保证节点稳定性。这在处理如内存和硬盘之类的不可压缩资源时尤为重要。如果任意一种资源耗尽,节点将会变得不稳定。
{{% /capture %}}
{{% capture body %}}
<!-- body -->
<!--
## Eviction Policy
@@ -670,4 +670,4 @@ the ability to get root container stats on an on-demand basis [(https://github.c
### kubelet 可能会驱逐超过需求数量的 pod
由于状态采集的时间差,驱逐操作可能驱逐比所需的更多的 pod。将来可通过添加从根容器获取所需状态的能力 [https://github.com/google/cadvisor/issues/1247](https://github.com/google/cadvisor/issues/1247) 来减缓这种状况。
{{% /capture %}}
@@ -1,16 +1,16 @@
---
title: 配置 API 对象配额
content_template: templates/task
content_type: task
---
<!--
---
title: Configure Quotas for API Objects
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This page shows how to configure quotas for API objects, including
@@ -25,17 +25,18 @@ object.
配额限制了可以在命名空间中创建的特定类型对象的数量。
您可以在 [ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core) 对象中指定配额。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Create a namespace
@@ -220,9 +221,10 @@ Delete your namespace:
kubectl delete namespace quota-object-example
```
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -270,5 +272,5 @@ kubectl delete namespace quota-object-example
* [为容器和 Pod 分配 CPU 资源](/docs/tasks/configure-pod-container/assign-cpu-resource/)
* [为 Pod 配置服务质量](/docs/tasks/configure-pod-container/quality-service-pod/)
{{% /capture %}}
@@ -1,6 +1,6 @@
---
title: 在实时集群上重新配置节点的 Kubelet
content_template: templates/task
content_type: task
---
<!--
@@ -10,12 +10,12 @@ reviewers:
- mtaufen
- dawnchen
title: Reconfigure a Node's Kubelet in a Live Cluster
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
{{< feature-state for_k8s_version="v1.11" state="beta" >}}
@@ -42,9 +42,10 @@ fields is available in the inline `KubeletConfiguration`
[类型文档](https://github.com/kubernetes/kubernetes/blob/release-1.11/pkg/kubelet/apis/kubeletconfig/v1beta1/types.go)。
{{< /warning >}}
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
<!--
- Kubernetes v1.11 or higher on both the Master and the Nodes
- kubectl v1.11 or higher, configured to communicate with the cluster
@@ -56,9 +57,9 @@ fields is available in the inline `KubeletConfiguration`
- kubectl v1.11 或者更高版本和集群配置通信
- The Kubelet `--dynamic-config-dir` flag 必须设置在节点的可写目录上
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!-- ## Reconfiguring the Kubelet on a Live Node in your Cluster -->
## 在你集群中的一个实时节点上配置Kubelet
@@ -529,9 +530,9 @@ error is reported.
在删除此字段后,`Node.Status.Config` 最终变成空,所有配置源都已重置为 `nil`,这表示
本地默认配置是`assigned``active``lastKnownGood`这三个参数,没有报告错误。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!-- ## Kubectl Patch Example -->
## Kubectl 补丁示例
@@ -691,4 +692,4 @@ in the Kubelet log for additional details and context about the error.
</tr>
</table>
{{% /capture %}}
@@ -4,7 +4,7 @@ reviewers:
- derekwaynecarr
- dashpole
title: 为系统守护进程预留计算资源
content_template: templates/task
content_type: task
---
<!--
---
@@ -13,11 +13,11 @@ reviewers:
- derekwaynecarr
- dashpole
title: Reserve Compute Resources for System Daemons
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
Kubernetes nodes can be scheduled to `Capacity`. Pods can consume all the
available capacity on a node by default. This is an issue because nodes
@@ -34,16 +34,17 @@ on each node.
Kubernetes 的节点可以按照 `Capacity` 调度。默认情况下 pod 能够使用节点全部可用容量。这是个问题,因为节点自己通常运行了不少驱动 OS 和 Kubernetes 的系统守护进程。除非为这些系统守护进程留出资源,否则它们将与 pod 争夺资源并导致节点资源短缺问题。
`kubelet` 公开了一个名为 `Node Allocatable` 的特性,有助于为系统守护进程预留计算资源。Kubernetes 推荐集群管理员按照每个节点上的工作负载密度配置 `Node Allocatable`
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Node Allocatable
@@ -370,9 +371,9 @@ So expect a drop in `Allocatable` capacity in future releases.
随着时间的增长以及越来越多特性的加入,kube 系统守护进程对资源的需求可能也会增加。以后 kubernetes 项目将尝试减少对节点系统守护进程的利用,但目前那并不是优先事项。所以,请期待在将来的发布中将 `Allocatable` 容量降低。
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
<!--
## Example Scenario
@@ -461,4 +462,4 @@ daemons/interrupts/timers and Kubernetes daemons.
-->
从 Kubernetes 1.17 版本开始,可以选择将 `reserved-cpus` 显式 cpuset 指定为操作系统守护程序、中断、计时器和 Kubernetes 守护程序保留的 CPU。
{{% /capture %}}
@@ -4,7 +4,7 @@ reviewers:
- thockin
- wlan0
title: Kubernetes 云管理控制器
content_template: templates/concept
content_type: concept
---
<!--
---
@@ -13,11 +13,11 @@ reviewers:
- thockin
- wlan0
title: Kubernetes Cloud Controller Manager
content_template: templates/concept
content_type: concept
---
-->
{{% capture overview %}}
<!-- overview -->
{{< feature-state state="beta" >}}
<!--
@@ -29,10 +29,10 @@ Kubernetes v1.6 包含一个新的二进制文件,叫做 `cloud-controller-man
`cloud-controller-manager` 可以被链接到任何满足 [cloudprovider.Interface](https://github.com/kubernetes/cloud-provider/blob/master/cloud.go) 约束的云服务提供商。为了兼容旧版本,Kubernetes 核心项目中提供的 [cloud-controller-manager](https://github.com/kubernetes/kubernetes/tree/master/cmd/cloud-controller-manager) 使用和 `kube-controller-manager` 相同的云服务类库。已经在 Kubernetes 核心项目中支持的云服务提供商预计将通过使用 in-tree 的 cloud-controller-manager 过渡到 Kubernetes 核心之外。在将来的 Kubernetes 发布中,所有的云管理控制器将在 Kubernetes 核心项目之外,由 sig 领导者或者云服务厂商进行开发。
{{% /capture %}}
{{% capture body %}}
<!-- body -->
<!--
## Administration
@@ -177,4 +177,3 @@ Kubelet 中的 TLS 引导特性是一个很好的例子。目前,TLS 引导认
要构建和开发您自己的云管理控制器,请阅读 [开发云管理控制器](/docs/tasks/administer-cluster/developing-cloud-controller-manager.md) 文档。
{{% /capture %}}
@@ -5,7 +5,7 @@ reviewers:
- ericchiang
- destijl
title: 集群安全
content_template: templates/task
content_type: task
---
<!--
---
@@ -15,11 +15,11 @@ reviewers:
- ericchiang
- destijl
title: Securing a Cluster
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
<!--
This document covers topics related to protecting a cluster from accidental or malicious access
@@ -27,15 +27,16 @@ and provides recommendations on overall security.
-->
本文档涉及与保护集群免受意外或恶意访问有关的主题,并对总体安全性提出建议。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Controlling access to the Kubernetes API
@@ -365,6 +366,6 @@ page for more on how to report vulnerabilities.
加入 [kubernetes-announce](https://groups.google.com/forum/#!forum/kubernetes-announce) 组,能够获取有关安全公告的邮件。有关如何报告漏洞的更多信息,请参见 [安全报告](/security/)页面。
{{% /capture %}}
@@ -2,7 +2,7 @@
title: 在 Kubernetes 集群中使用 sysctl
reviewers:
- sttts
content_template: templates/task
content_type: task
---
<!--
@@ -11,12 +11,12 @@ content_template: templates/task
title: Using sysctls in a Kubernetes Cluster
reviewers:
- sttts
content_template: templates/task
content_type: task
---
--->
{{% capture overview %}}
<!-- overview -->
{{< feature-state for_k8s_version="v1.11" state="beta" >}}
<!--
@@ -25,15 +25,16 @@ Kubernetes cluster using the sysctl interface.
--->
本文档介绍如何通过 sysctl 接口在 Kubernetes 集群中配置和使用内核参数。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## Listing all Sysctl Parameters
@@ -223,9 +224,9 @@ spec:
value: "65536"
...
```
{{% /capture %}}
{{% capture discussion %}}
<!-- discussion -->
{{< warning >}}
<!--
@@ -329,4 +330,4 @@ spec:
...
```
{{% /capture %}}
@@ -6,7 +6,7 @@ reviewers:
- lmdaly
- nolancon
content_template: templates/task
content_type: task
---
<!--
---
@@ -17,11 +17,11 @@ reviewers:
- lmdaly
- nolancon
content_template: templates/task
content_type: task
---
-->
{{% capture overview %}}
<!-- overview -->
{{< feature-state state="alpha" >}}
@@ -43,15 +43,16 @@ _Topology Manager_ is a Kubelet component that aims to co-ordinate the set of co
-->
_拓扑管理器(Topology Manager_ 是一个 Kubelet 的一部分,旨在协调负责这些优化的一组组件。
{{% /capture %}}
{{% capture prerequisites %}}
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{% /capture %}}
{{% capture steps %}}
<!-- steps -->
<!--
## How Topology Manager Works
@@ -345,4 +346,4 @@ Using this information the Topology Manager calculates the optimal hint for the
3. 调度器不支持拓扑功能,因此可能会由于拓扑管理器的原因而在节点上进行调度,然后在该节点上调度失败。
{{% /capture %}}