Fix relative links issue in zh content (#13312)

* `http://kubernetes.io/docs/` -> `/docs/`

* `https://kubernetes.io/docs/` -> `/docs/`
This commit is contained in:
chenrui
2019-03-20 20:55:36 -04:00
committed by Kubernetes Prow Robot
parent 868899b059
commit 61ee18e87b
37 changed files with 117 additions and 135 deletions
@@ -548,13 +548,13 @@ spec:
### 客户端使用 Secret API
当部署与 secret API 交互的应用程序时,应使用诸如 [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) 之类的 [授权策略](https://kubernetes.io/docs/admin/authorization/) 来限制访问。
当部署与 secret API 交互的应用程序时,应使用诸如 [RBAC](/docs/admin/authorization/rbac/) 之类的 [授权策略](/docs/admin/authorization/) 来限制访问。
Secret 中的值对于不同的环境来说重要性可能不同,例如对于 Kubernetes 集群内部(例如 service account 令牌)和集群外部来说就不一样。即使一个应用程序可以理解其期望的与之交互的 secret 有多大的能力,但是同一命名空间中的其他应用程序却可能不这样认为。
由于这些原因,在命名空间中 `watch``list` secret 的请求是非常强大的功能,应该避免这样的行为,因为列出 secret 可以让客户端检查所有 secret 是否在该命名空间中。在群集中`watch``list` 所有 secret 的能力应该只保留给最有特权的系统级组件。
需要访问 secrets API 的应用程序应该根据他们需要的 secret 执行 `get` 请求。这允许管理员限制对所有 secret 的访问,同时设置 [白名单访问](https://kubernetes.io/docs/admin/authorization/rbac/#referring-to-resources) 应用程序需要的各个实例。
需要访问 secrets API 的应用程序应该根据他们需要的 secret 执行 `get` 请求。这允许管理员限制对所有 secret 的访问,同时设置 [白名单访问](/docs/admin/authorization/rbac/#referring-to-resources) 应用程序需要的各个实例。
为了提高循环获取的性能,客户端可以设计引用 secret 的资源,然后 `watch` 资源,在引用更改时重新请求 secret。此外,还提出了一种 [”批量监控“ API](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/bulk_watch.md) 来让客户端 `watch` 每个资源,该功能可能会在将来的 Kubernetes 版本中提供。
@@ -149,12 +149,12 @@ spec:
<!--
It is recommended that RuntimeClass write operations (create/update/patch/delete) be
restricted to the cluster administrator. This is typically the default. See [Authorization
Overview](https://kubernetes.io/docs/reference/access-authn-authz/authorization/) for more details.
Overview](/docs/reference/access-authn-authz/authorization/) for more details.
-->
{{< note >}}
建议将 RuntimeClass 写操作(create、update、patch 和 delete)限定于集群管理员使用。
通常这是默认配置。参阅[授权概述](https://kubernetes.io/docs/reference/access-authn-authz/authorization/)了解更多信息。
通常这是默认配置。参阅[授权概述](/docs/reference/access-authn-authz/authorization/)了解更多信息。
{{< /note >}}
<!--
@@ -2,11 +2,11 @@
[API协议文档](https://git.k8s.io/community/contributors/devel/api-conventions.md)描述了主系统和API概念。
[API参考文档](https://kubernetes.io/docs/reference)描述了API整体规范。
[API参考文档](/docs/reference)描述了API整体规范。
[访问文档](https://kubernetes.io/docs/admin/accessing-the-api)讨论了通过远程访问API的相关问题。
[访问文档](/docs/admin/accessing-the-api)讨论了通过远程访问API的相关问题。
Kubernetes API是系统描述性配置的基础。 [Kubectl](https://kubernetes.io/docs/user-guide/kubectl/) 命令行工具被用于创建、更新、删除、获取API对象。
Kubernetes API是系统描述性配置的基础。 [Kubectl](/docs/user-guide/kubectl/) 命令行工具被用于创建、更新、删除、获取API对象。
Kubernetes 通过API资源存储自己序列化状态(现在存储在[etcd](https://coreos.com/docs/distributed-configuration/getting-started-with-etcd/))。
@@ -77,11 +77,11 @@ Kubernetes实现了另一种基于Protobuf的序列化格式,该格式主要
1. 核心组(通常被称为遗留组)位于REST路径 **`/api/v1`** 并使用 **`apiVersionv1`**。
1. 指定的组位于REST路径 **`/apis/$GROUP_NAME/$VERSION`**,并使用 **`apiVersion$GROUP_NAME/$VERSION`**(例如 **`apiVersionbatch/v1`**)。 在[Kubernetes API参考](https://kubernetes.io/docs/reference/)中可以看到支持的API组的完整列表。
1. 指定的组位于REST路径 **`/apis/$GROUP_NAME/$VERSION`**,并使用 **`apiVersion$GROUP_NAME/$VERSION`**(例如 **`apiVersionbatch/v1`**)。 在[Kubernetes API参考](/docs/reference/)中可以看到支持的API组的完整列表。
社区支持使用以下两种方式来提供自定义资源对API进行扩展[自定义资源](https://kubernetes.io/docs/concepts/api-extension/custom-resources/)
社区支持使用以下两种方式来提供自定义资源对API进行扩展[自定义资源](/docs/concepts/api-extension/custom-resources/)
1. [CustomResourceDefinition](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/)适用于具有非常基本的CRUD需求的用户。
1. [CustomResourceDefinition](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/)适用于具有非常基本的CRUD需求的用户。
1. 即将推出:需要全套Kubernetes API语义的用户可以实现自己的apiserver,并使用[聚合器](https://git.k8s.io/community/contributors/design-proposals/api-machinery/aggregated-api-servers.md)为客户提供无缝的服务。
@@ -130,10 +130,10 @@ These files are published at
以下文件发布在 [kubernetes.io/docs/reference](/docs/reference/)
* [Federation API v1 Operations](https://kubernetes.io/docs/reference/federation/v1/operations/)
* [Federation API v1 Definitions](https://kubernetes.io/docs/reference/federation/v1/definitions/)
* [Federation API extensions/v1beta1 Operations](https://kubernetes.io/docs/reference/federation/extensions/v1beta1/operations/)
* [Federation API extensions/v1beta1 Definitions](https://kubernetes.io/docs/reference/federation/extensions/v1beta1/definitions/)
* [Federation API v1 Operations](/docs/reference/federation/v1/operations/)
* [Federation API v1 Definitions](/docs/reference/federation/v1/definitions/)
* [Federation API extensions/v1beta1 Operations](/docs/reference/federation/extensions/v1beta1/operations/)
* [Federation API extensions/v1beta1 Definitions](/docs/reference/federation/extensions/v1beta1/definitions/)
{{% /capture %}}
@@ -236,11 +236,11 @@ directory. The tool performs the following steps:
<!--
When the Markdown files are in your local clone of the `kubernetes/website`
repository, you can submit them in a
[pull request](https://kubernetes.io/docs/home/contribute/create-pull-request/)
[pull request](/docs/home/contribute/create-pull-request/)
to `kubernetes/website`.
-->
当 Markdown 文件放入 `kubernetes/website` 仓库的本地目录中后,你就可以创建 [PR](https://kubernetes.io/docs/home/contribute/create-pull-request/) 将它们提交到 `kubernetes/website`
当 Markdown 文件放入 `kubernetes/website` 仓库的本地目录中后,你就可以创建 [PR](/docs/home/contribute/create-pull-request/) 将它们提交到 `kubernetes/website`
<!--
## Customizing the config file
+10 -10
View File
@@ -112,10 +112,10 @@ cd website
{{< note >}}
<!--
Contributors to `k/website` must [create a fork](https://kubernetes.io/docs/contribute/start/#improve-existing-content) from which to open pull requests. For localizations, we ask additionally that:
Contributors to `k/website` must [create a fork](/docs/contribute/start/#improve-existing-content) from which to open pull requests. For localizations, we ask additionally that:
-->
`k/website` 的贡献者必须[创建一个分支](https://kubernetes.io/docs/contribute/start/#improve-existing-content),从创建拉取请求。对于本地化,我们还要求:
`k/website` 的贡献者必须[创建一个分支](/docs/contribute/start/#improve-existing-content),从创建拉取请求。对于本地化,我们还要求:
<!--
1. Team approvers open development branches directly from https://github.com/kubernetes/website.
@@ -266,24 +266,24 @@ At a minimum, all localizations must include:
<!--
Description | URLs
-----|-----
Home | [All heading and subheading URLs](https://kubernetes.io/docs/home/)
Setup | [All heading and subheading URLs](https://kubernetes.io/docs/setup/)
Tutorials | [Kubernetes Basics](https://kubernetes.io/docs/tutorials/kubernetes-basics/), [Hello Minikube](https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/)
Home | [All heading and subheading URLs](/docs/home/)
Setup | [All heading and subheading URLs](/docs/setup/)
Tutorials | [Kubernetes Basics](/docs/tutorials/kubernetes-basics/), [Hello Minikube](/docs/tutorials/stateless-application/hello-minikube/)
Site strings | [All site strings in a new localized TOML file](https://github.com/kubernetes/website/tree/master/i18n)
-->
描述 | 网址
-----|-----
主页 | [所有标题和副标题网址](https://kubernetes.io/docs/home/)
安装 | [所有标题和副标题网址](https://kubernetes.io/docs/setup/)
教程 | [Kubernetes 基础](https://kubernetes.io/docs/tutorials/kubernetes-basics/), [Hello Minikube](https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/)
主页 | [所有标题和副标题网址](/docs/home/)
安装 | [所有标题和副标题网址](/docs/setup/)
教程 | [Kubernetes 基础](/docs/tutorials/kubernetes-basics/), [Hello Minikube](/docs/tutorials/stateless-application/hello-minikube/)
网站字符串 | [新的本地化 TOML 文件中的所有网站字符串](https://github.com/kubernetes/website/tree/master/i18n)
<!--
Translated documents must reside in their own `content/**/` subdirectory, but otherwise follow the same URL path as the English source. For example, to prepare the [Kubernetes Basics](https://kubernetes.io/docs/tutorials/kubernetes-basics/) tutorial for translation into German, create a subfolder under the `content/de/` folder and copy the English source:
Translated documents must reside in their own `content/**/` subdirectory, but otherwise follow the same URL path as the English source. For example, to prepare the [Kubernetes Basics](/docs/tutorials/kubernetes-basics/) tutorial for translation into German, create a subfolder under the `content/de/` folder and copy the English source:
-->
翻译后的文档必须保存在自己的 `content/**/` 子目录中,否则将遵循与英文源相同的 URL 路径。例如,要准备将 [Kubernetes 基础](https://kubernetes.io/docs/tutorials/kubernetes-basics/) 教程翻译为德语,请在 `content/de/` 文件夹下创建一个子文件夹并复制英文源:
翻译后的文档必须保存在自己的 `content/**/` 子目录中,否则将遵循与英文源相同的 URL 路径。例如,要准备将 [Kubernetes 基础](/docs/tutorials/kubernetes-basics/) 教程翻译为德语,请在 `content/de/` 文件夹下创建一个子文件夹并复制英文源:
```shell
mkdir -p content/de/docs/tutorials
@@ -110,7 +110,7 @@ URL for the topic, for example:
选择一个标题,标题中包含了要通过搜索引擎要查找的关键字。创建一个文件名,使用标题中由连字符分隔的单词。例如,标题为[使用 HTTP 代理访问 Kubernetes API](/docs/tasks/access-kubernetes-api/http-proxy-access-api/) 的主题的文件名为 `http-proxy-access-api.md`。你不需要在文件名中加上 "kubernetes",因为 "kubernetes" 已经在主题的 URL 中了,例如:
http://kubernetes.io/docs/tasks/access-kubernetes-api/http-proxy-access-api/
/docs/tasks/access-kubernetes-api/http-proxy-access-api/
<!--
## Adding the topic title to the front matter
@@ -344,5 +344,3 @@ image format is SVG.
* 学习[展示你的修改](/docs/home/contribute/stage-documentation-changes/)。
* 学习[创建一个拉取请求](/docs/home/contribute/create-pull-request/)。
{{% /capture %}}
@@ -358,7 +358,7 @@ mkdir -p ~/.kube
juju scp kubernetes-master/0:config ~/.kube/config
```
<!-- The next step is to install the kubectl client on your local machine. The recommended way to do this on Ubuntu is using the kubectl snap ([https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu)).
<!-- The next step is to install the kubectl client on your local machine. The recommended way to do this on Ubuntu is using the kubectl snap ([/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu](/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu)).
The following command should be run on the machine you wish to use to control the kubernetes cluster:
@@ -368,7 +368,7 @@ sudo snap install kubectl --classic
This will install and deploy the kubectl binary. You may need to restart your terminal as your $PATH may have been updated. -->
下一步是在本地机器上安装 kubectl 客户端。在 Ubuntu 上推荐的安装方式是使用 kubectl snap ([https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu))。
下一步是在本地机器上安装 kubectl 客户端。在 Ubuntu 上推荐的安装方式是使用 kubectl snap ([/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu](/docs/tasks/tools/install-kubectl/#install-with-snap-on-ubuntu))。
可以运行下面的命令便可以控制 kubernetes 集群了:
@@ -29,9 +29,9 @@ content_template: templates/task
<!-- To use this guide, you must have a working kubernetes cluster that was deployed using Canonical's juju. -->
本文假设你有一个已经通过 Juju 部署、正在运行的集群。
<!-- The full instructions for deploying Kubernetes with juju can be found at [https://kubernetes.io/docs/getting-started-guides/ubuntu/installation/](https://kubernetes.io/docs/getting-started-guides/ubuntu/installation/). -->
<!-- The full instructions for deploying Kubernetes with juju can be found at [/docs/getting-started-guides/ubuntu/installation/](/docs/getting-started-guides/ubuntu/installation/). -->
有关使用 juju 部署 Kubernetes 集群的完整指导,请参考 [https://kubernetes.io/docs/getting-started-guides/ubuntu/installation/](https://kubernetes.io/docs/getting-started-guides/ubuntu/installation/)。
有关使用 juju 部署 Kubernetes 集群的完整指导,请参考 [/docs/getting-started-guides/ubuntu/installation/](/docs/getting-started-guides/ubuntu/installation/)。
{{% /capture %}}
@@ -264,9 +264,9 @@ To deploy using helm, you will need to follow these steps: -->
## 日志和监控
<!-- By default there is no log aggregation of the Kubernetes nodes, each node logs locally.
Please read over the [logging](https://kubernetes.io/docs/getting-started-guides/ubuntu/logging/) page for more information. -->
Please read over the [logging](/docs/getting-started-guides/ubuntu/logging/) page for more information. -->
默认情况下, Kubernetes 没有节点的日志聚合,每个节点都是本地保存日志。
请参阅[日志](https://kubernetes.io/docs/getting-started-guides/ubuntu/logging/)文档,获取更多信息。
请参阅[日志](/docs/getting-started-guides/ubuntu/logging/)文档,获取更多信息。
{{% /capture %}}
@@ -559,11 +559,11 @@ Use your preferred method to start Kubernetes cluster on Linux. Please note that
## Support for kubeadm join
-->
如果您的群集是由[kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),创建的
如果您的群集是由[kubeadm](/docs/setup/independent/create-cluster-kubeadm/),创建的
使用上面列出的方法之一正确地设置网络(网络是在 kubeadm 之外设置的),您可以使用 kubeadm 向集群添加 Windows 节点。在较高的级别上,首先必须使用 kubeadm(Linux) 初始化主节点,然后设置基于 CNI 的网络(在 kubeadm 之外),最后开始将 Windows 或 Linux 工作节点连接到集群。如需其他文件和参考资料,请访问上文的 kubeadm 链接。
<!--
If your cluster has been created by [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),
If your cluster has been created by [kubeadm](/docs/setup/independent/create-cluster-kubeadm/),
and your networking is setup correctly using one of the methods listed above (networking is setup outside of kubeadm), you can use kubeadm to add a Windows node to your cluster. At a high level, you first have to initialize the master with kubeadm (Linux), then set up the CNI based networking (outside of kubeadm), and finally start joining Windows or Linux worker nodes to the cluster. For additional documentation and reference material, visit the kubeadm link above.
-->
@@ -575,9 +575,9 @@ The kubeadm binary can be found at [Kubernetes Releases](https://github.com/kube
`kubeadm.exe join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash>`
有关更多详细信息请参阅[加入您的节点](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#joining-your-nodes)。
有关更多详细信息请参阅[加入您的节点](/docs/setup/independent/create-cluster-kubeadm/#joining-your-nodes)。
<!--
See [joining-your-nodes](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#joining-your-nodes) for more details.
See [joining-your-nodes](/docs/setup/independent/create-cluster-kubeadm/#joining-your-nodes) for more details.
-->
## 支持的功能
@@ -39,8 +39,7 @@ tags:
<!--more-->
<!--
When you've configured the {{< glossary_tooltip text="Kubernetes API Server" term_id="kube-apiserver" >}} to [support additional APIs](https://kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/), you can add `APIService` objects to "claim" a URL path in the Kubernetes API.
When you've configured the {{< glossary_tooltip text="Kubernetes API Server" term_id="kube-apiserver" >}} to [support additional APIs](/docs/tasks/access-kubernetes-api/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](https://kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/),您就可以在 Kubernetes API 中增加 `APIService` 对象来 "申领(Claim" 一个 URL 路径。
当您配置了 {{< glossary_tooltip text="Kubernetes API Server" term_id="kube-apiserver" >}} 来 [支持额外的 API](/docs/tasks/access-kubernetes-api/configure-aggregation-layer/),您就可以在 Kubernetes API 中增加 `APIService` 对象来 "申领(Claim" 一个 URL 路径。
@@ -2,7 +2,7 @@
title: 云控制器管理器
id: cloud-controller-manager
date: 2018-04-12
full_link: https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/
full_link: /docs/tasks/administer-cluster/running-cloud-controller/
short_description: >
云控制器管理器是 1.8 的 alpha 特性。在未来发布的版本中,这是将 Kubernetes 与任何其他云集成的最佳方式。
@@ -18,7 +18,7 @@ tags:
title: Cloud Controller Manager
id: cloud-controller-manager
date: 2018-04-12
full_link: https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/
full_link: /docs/tasks/administer-cluster/running-cloud-controller/
short_description: >
Cloud Controller Manager is an alpha feature in 1.8. In upcoming releases it will be the preferred way to integrate Kubernetes with any cloud.
+5 -6
View File
@@ -2,7 +2,7 @@
title: CNI (容器网络接口)
id: cni
date: 2018-05-25
full_link: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni
full_link: /docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni
short_description: >
容器网络接口 (CNI) 插件是遵循 appc/CNI 协议的一类网络插件。
@@ -17,7 +17,7 @@ tags:
title: CNI (Container network interface)
id: cni
date: 2018-05-25
full_link: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni
full_link: /docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni
short_description: >
Container network interface (CNI) plugins are a type of Network plugin that adheres to the appc/CNI specification.
@@ -37,9 +37,8 @@ tags:
<!--more-->
<!--
* For information on Kubernetes and CNI refer to [this](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni).
* For information on Kubernetes and CNI, see ["Network plugins"](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni).
* For information on Kubernetes and CNI refer to [this](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni).
* For information on Kubernetes and CNI, see ["Network plugins"](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni).
-->
* 想了解 Kubernetes 和 CNI 请参考 ["网络插件"](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni)。
* 想了解 Kubernetes 和 CNI 请参考 ["网络插件"](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni)。
@@ -35,7 +35,7 @@ tags:
<!--more-->
<!--
Allows you to decouple environment-specific configuration from your {{< glossary_tooltip text="container images" term_id="container" >}}, so that your applications are easily portable. When storing confidential data use a [Secret](https://kubernetes.io/docs/concepts/configuration/secret/).
Allows you to decouple environment-specific configuration from your {{< glossary_tooltip text="container images" term_id="container" >}}, so that your applications are easily portable. When storing confidential data use a [Secret](/docs/concepts/configuration/secret/).
-->
ConfigMap 将您的环境配置信息和 {{< glossary_tooltip text="容器镜像" term_id="container" >}} 解耦,便于应用配置的修改。当您需要储存机密信息时可以使用 [Secret](https://kubernetes.io/docs/concepts/configuration/secret/) 对象。
ConfigMap 将您的环境配置信息和 {{< glossary_tooltip text="容器镜像" term_id="container" >}} 解耦,便于应用配置的修改。当您需要储存机密信息时可以使用 [Secret](/docs/concepts/configuration/secret/) 对象。
+4 -5
View File
@@ -2,7 +2,7 @@
title: 容器存储接口 (CSI)
id: csi
date: 2018-06-25
full_link: https://kubernetes.io/docs/concepts/storage/volumes/#csi
full_link: /docs/concepts/storage/volumes/#csi
short_description: >
容器存储接口 (CSI)定义了存储系统暴露给容器的标准接口。
@@ -17,7 +17,7 @@ tags:
title: Container Storage Interface (CSI)
id: csi
date: 2018-06-25
full_link: https://kubernetes.io/docs/concepts/storage/volumes/#csi
full_link: /docs/concepts/storage/volumes/#csi
short_description: >
The Container Storage Interface (CSI) defines a standard interface to expose storage systems to containers.
@@ -38,12 +38,11 @@ tags:
<!--
CSI allows vendors to create custom storage plugins for Kubernetes without adding them to the Kubernetes repository (out-of-tree plugins). To use a CSI driver from a storage provider, you must first [deploy it to your cluster](https://kubernetes-csi.github.io/docs/Setup.html). You will then be able to create a {{< glossary_tooltip text="Storage Class" term_id="storage-class" >}} that uses that CSI driver.
* [CSI in the Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/volumes/#csi)
* [CSI in the Kubernetes documentation](/docs/concepts/storage/volumes/#csi)
* [List of available CSI drivers](https://kubernetes-csi.github.io/docs/Drivers.html)
-->
CSI 允许存储驱动提供商为 Kubernetes 创建定制化的存储插件,而无需将这些插件的代码添加到 Kubernetes 代码仓库(外部插件)。要使用某个存储提供商的 CSI 驱动,你首先要[将它部署到你的集群上](https://kubernetes-csi.github.io/docs/Setup.html)。然后你才能创建使用该 CSI 驱动的 {{< glossary_tooltip text="Storage Class" term_id="storage-class" >}} 。
* [Kubernetes 文档中关于 CSI 的描述](https://kubernetes.io/docs/concepts/storage/volumes/#csi)
* [Kubernetes 文档中关于 CSI 的描述](/docs/concepts/storage/volumes/#csi)
* [可用的 CSI 驱动列表](https://kubernetes-csi.github.io/docs/Drivers.html)
@@ -2,7 +2,7 @@
title: Flexvolume
id: flexvolume
date: 2018-06-25
full_link: https://kubernetes.io/docs/concepts/storage/volumes/#flexvolume
full_link: /docs/concepts/storage/volumes/#flexvolume
short_description: >
Flexvolume 是创建 out-of-tree 卷插件的一种接口。 {{< glossary_tooltip text="容器存储接口(CSI" term_id="csi" >}} 是比 Flexvolume 更新的接口,它解决了 Flexvolumes 的一些问题。
@@ -17,7 +17,7 @@ tags:
title: Flexvolume
id: flexvolume
date: 2018-06-25
full_link: https://kubernetes.io/docs/concepts/storage/volumes/#flexvolume
full_link: /docs/concepts/storage/volumes/#flexvolume
short_description: >
Flexvolume is an interface for creating out-of-tree volume plugins. The {{< glossary_tooltip text="Container Storage Interface" term_id="csi" >}} is a newer interface which addresses several problems with Flexvolumes.
@@ -41,11 +41,11 @@ FlexVolume 驱动程序的二进制文件和依赖项必须安装在主机上。
如果可能的话,SIG Storage 建议实现 {{< glossary_tooltip text="CSI" term_id="csi" >}} 驱动程序,因为它解决了 Flexvolumes 的限制。
<!--
* [Flexvolume in the Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/volumes/#flexvolume)
* [Flexvolume in the Kubernetes documentation](/docs/concepts/storage/volumes/#flexvolume)
* [More information on Flexvolumes](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md)
* [Volume Plugin FAQ for Storage Vendors](https://github.com/kubernetes/community/blob/master/sig-storage/volume-plugin-faq.md)
-->
* [Kubernetes 文档中的 Flexvolume](https://kubernetes.io/docs/concepts/storage/volumes/#flexvolume)
* [Kubernetes 文档中的 Flexvolume](/docs/concepts/storage/volumes/#flexvolume)
* [更多关于 Flexvolumes 的信息](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md)
* [存储供应商的卷插件 FAQ](https://github.com/kubernetes/community/blob/master/sig-storage/volume-plugin-faq.md)
@@ -2,7 +2,7 @@
title: ReplicaSet
id: replica-set
date: 2018-04-12
full_link: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
full_link: /docs/concepts/workloads/controllers/replicaset/
short_description: >
ReplicaSet 是下一代副本控制器。
@@ -18,7 +18,7 @@ tags:
title: ReplicaSet
id: replica-set
date: 2018-04-12
full_link: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
full_link: /docs/concepts/workloads/controllers/replicaset/
short_description: >
ReplicaSet is the next-generation Replication Controller.
+3 -3
View File
@@ -37,9 +37,9 @@ tags:
<!--more-->
<!--
Allows for more control over how sensitive information is used and reduces the risk of accidental exposure, including [encryption](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/#ensure-all-secrets-are-encrypted) at rest. A {{< glossary_tooltip text="Pod" term_id="pod" >}} references the secret as a file in a volume mount or by the kubelet pulling images for a pod. Secrets are great for confidential data and [ConfigMaps](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) for non-confidential data.
Allows for more control over how sensitive information is used and reduces the risk of accidental exposure, including [encryption](/docs/tasks/administer-cluster/encrypt-data/#ensure-all-secrets-are-encrypted) at rest. A {{< glossary_tooltip text="Pod" term_id="pod" >}} references the secret as a file in a volume mount or by the kubelet pulling images for a pod. Secrets are great for confidential data and [ConfigMaps](/docs/tasks/configure-pod-container/configure-pod-configmap/) for non-confidential data.
-->
Secret 允许用户对如何使用敏感信息进行更多的控制,并减少信息意外暴露的风险,包括静态[加密](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/#ensure-all-secrets-are-encrypted)。
Secret 允许用户对如何使用敏感信息进行更多的控制,并减少信息意外暴露的风险,包括静态[加密](/docs/tasks/administer-cluster/encrypt-data/#ensure-all-secrets-are-encrypted)。
{{< glossary_tooltip text="Pod" term_id="pod" >}} 通过挂载卷中的文件的方式引用 Secret,或者通过 kubelet 为 pod 拉取镜像时引用。
Secret 非常适合机密数据使用,而 [ConfigMaps](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) 适用于非机密数据。
Secret 非常适合机密数据使用,而 [ConfigMaps](/docs/tasks/configure-pod-container/configure-pod-configmap/) 适用于非机密数据。
+2 -2
View File
@@ -14,13 +14,13 @@ kubectl 用来控制 Kubernetes 集群管理器
kubectl controls the Kubernetes cluster manager.
Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/
Find more information at: /docs/reference/kubectl/overview/
-->
### 摘要
kubectl 用来控制 Kubernetes 集群管理器。
更多信息参见 https://kubernetes.io/docs/reference/kubectl/overview/
更多信息参见 /docs/reference/kubectl/overview/
```
kubectl [flags]
@@ -43,10 +43,10 @@ What is a bootstrap token more exactly?
<!--
You can read more about bootstrap tokens here:
https://kubernetes.io/docs/admin/bootstrap-tokens/
/docs/admin/bootstrap-tokens/
-->
您可以在此处阅读有关引导令牌(bootstrap token)的更多信息:
https://kubernetes.io/docs/admin/bootstrap-tokens/
/docs/admin/bootstrap-tokens/
```
kubeadm token [flags]
@@ -123,6 +123,3 @@ kubeadm token [flags]
</tbody>
</table>
@@ -359,8 +359,8 @@ using an external CRI implementation. -->
<!-- By default, `kubeadm` assigns a node name based on a machine's host address. You can override this setting with the `--node-name`flag. -->
默认情况下, `kubeadm` 基于机器的 host 地址分配一个节点名称。你可以使用 `--node-name` 参数覆盖这个设置。
<!-- The flag passes the appropriate [`--hostname-override`](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/#options) to the kubelet. -->
这个参数会向 kubelet 传递相应的 [`--hostname-override`](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/#options) 参数。
<!-- The flag passes the appropriate [`--hostname-override`](/docs/reference/command-line-tools-reference/kubelet/#options) to the kubelet. -->
这个参数会向 kubelet 传递相应的 [`--hostname-override`](/docs/reference/command-line-tools-reference/kubelet/#options) 参数。
<!-- Be aware that overriding the hostname can [interfere with cloud providers](https://github.com/kubernetes/website/pull/8873). -->
注意覆盖主机名称可能会 [干扰到云服务提供商](https://github.com/kubernetes/website/pull/8873)。
@@ -394,8 +394,8 @@ without manual intervention. This and other limitations are expected to be
resolved before self-hosting graduates from alpha. -->
1.8 版本中的自托管功能有一些重要的限制。特别的, 一个自托管的集群如果不手动介入的话 _不能够从主节点的重新启动中恢复_ 。 这个以及其它的一些限制被期望在自托管功能从 alpha 状态毕业前解决。
<!-- By default, self-hosted control plane Pods rely on credentials loaded from [`hostPath`](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath) volumes. Except for initial creation, these credentials are not managed by kubeadm. You can use `--feature-gates=StoreCertsInSecrets=true` to enable an experimental mode where control plane credentials are loaded from Secrets instead. This requires very careful control over the authentication and authorization configuration for your cluster, and may not be appropriate for your environment. -->
默认情况下, self-hosted 控制平面 Pods 依赖位于 [`hostPath`](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath) 数据卷中的证书。除了初始化创建证书的过程, 这些证书不被 kubeadm 管理。你可以使用 `--feature-gates=StoreCertsInSecrets=true` 参数来启用一个试验性的模式,在这个模式中控制平面证书从 Secrets 加载。 这要求对你的集群进行非常小心的对鉴权和授权配置的控制, 并且可能并不适合你的环境。
<!-- By default, self-hosted control plane Pods rely on credentials loaded from [`hostPath`](/docs/concepts/storage/volumes/#hostpath) volumes. Except for initial creation, these credentials are not managed by kubeadm. You can use `--feature-gates=StoreCertsInSecrets=true` to enable an experimental mode where control plane credentials are loaded from Secrets instead. This requires very careful control over the authentication and authorization configuration for your cluster, and may not be appropriate for your environment. -->
默认情况下, self-hosted 控制平面 Pods 依赖位于 [`hostPath`](/docs/concepts/storage/volumes/#hostpath) 数据卷中的证书。除了初始化创建证书的过程, 这些证书不被 kubeadm 管理。你可以使用 `--feature-gates=StoreCertsInSecrets=true` 参数来启用一个试验性的模式,在这个模式中控制平面证书从 Secrets 加载。 这要求对你的集群进行非常小心的对鉴权和授权配置的控制, 并且可能并不适合你的环境。
{{< caution >}}
<!-- **Caution:** `StoreCertsInSecrets` is an alpha feature. It is deprecated in 1.12
@@ -70,7 +70,7 @@ kubefed join CLUSTER_NAME --host-cluster-context=HOST_CONTEXT [flags]
-h, --help help for join
--host-cluster-context string Host cluster context
--no-headers When using the default or custom-column output format, don't print headers (default print headers).
-o, --output string Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
-o, --output string Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [/docs/user-guide/jsonpath].
--save-config If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.
-a, --show-all When printing, show all resources (default hide terminated pods.)
--show-labels When printing, show all labels as the last column (default hide labels column)
@@ -90,7 +90,7 @@ kubefed join CLUSTER_NAME --host-cluster-context=HOST_CONTEXT [flags]
-h, --help join 的帮助信息。
--host-cluster-context string 主机集群上下文。
--no-headers 当使用默认或者定制列输出格式时,不打印头信息(默认打印头信息)。
-o, --output string 输出格式。下列之一: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... 参考定制列 [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns]golang 模版 [http://golang.org/pkg/text/template/#pkg-overview] 和 jsonpath 模版 [http://kubernetes.io/docs/user-guide/jsonpath]。
-o, --output string 输出格式。下列之一: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... 参考定制列 [/docs/user-guide/kubectl-overview/#custom-columns]golang 模版 [http://golang.org/pkg/text/template/#pkg-overview] 和 jsonpath 模版 [/docs/user-guide/jsonpath]。
--save-config 如果为 true,当前对象的配置将保存到它的注解中。否则将不会改变注解。 当你将来对此对象执行 kubectl apply 时,会用到该参数。
-a, --show-all 打印时,显示所有资源。(默认隐藏已终止的 pod)
--show-labels 打印时,将所有标签显示在最后一列。 (默认隐藏标签列)
@@ -159,14 +159,14 @@ timeframe; which also applies to `kubeadm`.
<!--
## Objectives
* Install a single master Kubernetes cluster or [high availability cluster](https://kubernetes.io/docs/setup/independent/high-availability/)
* Install a single master Kubernetes cluster or [high availability cluster](/docs/setup/independent/high-availability/)
* Install a Pod network on the cluster so that your Pods can
talk to each other
-->
## 目标
* 安装只有一个主节点的集群或[高可用集群](https://kubernetes.io/docs/setup/independent/high-availability/)。
* 安装只有一个主节点的集群或[高可用集群](/docs/setup/independent/high-availability/)。
* 在集群上安装 Pod 网络,以便您的 Pod 可以相互通信。
<!--
@@ -326,7 +326,7 @@ To start using your cluster, you need to run (as a regular user):
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the addon options listed at:
http://kubernetes.io/docs/admin/addons/
/docs/admin/addons/
You can now join any number of machines by running the following on each node
as root:
@@ -496,7 +496,7 @@ kubectl create -f ./
为了使 `flannel` 正常工作,你必须将选项 `--pod-network-cidr=10.244.0.0/16` 传递给 `kubeadm init`
通过执行 `sysctl net.bridge.bridge-nf-call-iptables=1` 命令,将 `/proc/sys/net/bridge/bridge-nf-call-iptables` 设置为 `1`
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
注意 `flannel` 可以运行在 `amd64``arm``arm64``ppc64le`架构的机器上。
@@ -511,7 +511,7 @@ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8
{{% tab name="Kube-router" %}}
通过执行 `sysctl net.bridge.bridge-nf-call-iptables=1` 命令,将 `/proc/sys/net/bridge/bridge-nf-call-iptables` 设置为 `1`
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
Kube-router 依靠 kube-controller-manager 为节点分配 pod CIDR。 因此,执行`kubeadm init` 命令需要使用带 `-pod-network-cidr` 选项。
@@ -524,7 +524,7 @@ Kube-router 提供 pod 网络、网络策略和基于高性能 IP Virtual Server
{{% tab name="Romana" %}}
通过执行 `sysctl net.bridge.bridge-nf-call-iptables=1` 命令,将 `/proc/sys/net/bridge/bridge-nf-call-iptables` 设置为 `1`
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
Romana 官方设置指南在[这里](https://github.com/romana/romana/tree/master/containerize#using-kubeadm).
@@ -538,7 +538,7 @@ kubectl apply -f https://raw.githubusercontent.com/romana/romana/master/containe
{{% tab name="Weave Net" %}}
通过执行 `sysctl net.bridge.bridge-nf-call-iptables=1` 命令,将 `/proc/sys/net/bridge/bridge-nf-call-iptables` 设置为 `1`
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
以便将桥接的 IPv4 流量传递给 iptables 的链。 这是一些 CNI 插件工作的要求,有关详细信息,请参阅[此处](/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements)。
Weave Net 官方设置指南在[这里](https://www.weave.works/docs/net/latest/kube-addon/).
@@ -953,7 +953,3 @@ kubeadm 的 deb / rpm 包和二进制文件是为 amd64、arm32位)、arm64
## 故障排除 {#troubleshooting}
如果您遇到 kubeadm 上的困难,请参阅我们的[故障排除文档](/docs/setup/independent/troubleshooting-kubeadm/).
@@ -354,7 +354,7 @@ If `nodefs` filesystem has met eviction thresholds, `kubelet` frees up disk spac
If the `kubelet` is unable to reclaim sufficient resource on the node, `kubelet` begins evicting Pods.
The `kubelet` ranks Pods for eviction first by whether or not their usage of the starved resource exceeds requests,
then by [Priority](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/), and then by the consumption of the starved compute resource relative to the Pods' scheduling requests.
then by [Priority](/docs/concepts/configuration/pod-priority-preemption/), and then by the consumption of the starved compute resource relative to the Pods' scheduling requests.
As a result, `kubelet` ranks and evicts Pods in the following order:
@@ -380,7 +380,7 @@ that consumes the largest amount of disk and kill those first.
如果 `kubelet` 在节点上无法回收足够的资源,`kubelet` 将开始驱逐 pod。
`kubelet` 首先根据他们对短缺资源的使用是否超过请求来排除 pod 的驱逐行为,然后通过[优先级](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/),然后通过相对于 pod 的调度请求消耗急需的计算资源。
`kubelet` 首先根据他们对短缺资源的使用是否超过请求来排除 pod 的驱逐行为,然后通过[优先级](/docs/concepts/configuration/pod-priority-preemption/),然后通过相对于 pod 的调度请求消耗急需的计算资源。
`kubelet` 按以下顺序对要驱逐的 pod 排名:
@@ -602,7 +602,7 @@ Kubernetes 可能会在创建新的日志文件时删除旧的日志文件; 您
[auditing-proposal]: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/auditing.md
[auditing-api]: https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go
[gce-audit-profile]: https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/cluster/gce/gci/configure-helper.sh#L735
[kubeconfig]: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
[kubeconfig]: /docs/tasks/access-application-cluster/configure-access-multiple-clusters/
[fluentd]: http://www.fluentd.org/
[fluentd_install_doc]: http://docs.fluentd.org/v0.12/articles/quickstart#step1-installing-fluentd
[logstash]: https://www.elastic.co/products/logstash
@@ -104,11 +104,11 @@ Metric server collects metrics from the Summary API, exposed by [Kubelet](/docs/
<!--
Metrics Server registered in the main API server through
[Kubernetes aggregator](https://kubernetes.io/docs/concepts/api-extension/apiserver-aggregation/),
[Kubernetes aggregator](/docs/concepts/api-extension/apiserver-aggregation/),
which was introduced in Kubernetes 1.7.
-->
度量服务器通过 [Kubernetes 聚合器](https://kubernetes.io/docs/concepts/api-extension/apiserver-aggregation/)在主 API 服务器中注册,该聚合器是在 Kubernetes 1.7 版本中引入的。
度量服务器通过 [Kubernetes 聚合器](/docs/concepts/api-extension/apiserver-aggregation/)在主 API 服务器中注册,该聚合器是在 Kubernetes 1.7 版本中引入的。
<!--
@@ -13,11 +13,11 @@ content_template: templates/task
{{% capture overview %}}
<!--
Kubernetes applications usually consist of multiple, separate services, each running in its own container. Developing and debugging these services on a remote Kubernetes cluster can be cumbersome, requiring you to [get a shell on a running container](https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/) and running your tools inside the remote shell.
Kubernetes applications usually consist of multiple, separate services, each running in its own container. Developing and debugging these services on a remote Kubernetes cluster can be cumbersome, requiring you to [get a shell on a running container](/docs/tasks/debug-application-cluster/get-shell-running-container/) and running your tools inside the remote shell.
-->
Kubernetes 应用程序通常由多个独立的服务组成,每个服务都在自己的容器中运行。
在远端的 Kubernetes 集群上开发和调试这些服务可能很麻烦,需要[在运行的容器上打开 shell](https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/),然后在远端 shell 中运行您所需的工具。
在远端的 Kubernetes 集群上开发和调试这些服务可能很麻烦,需要[在运行的容器上打开 shell](/docs/tasks/debug-application-cluster/get-shell-running-container/),然后在远端 shell 中运行您所需的工具。
<!--
`telepresence` is a tool to ease the process of developing and debugging services locally, while proxying the service to a remote Kubernetes cluster. Using `telepresence` allows you to use custom tools, such as a debugger and IDE, for a local service and provides the service full access to ConfigMap, secrets, and the services running on the remote cluster.
@@ -124,5 +124,3 @@ Telepresence 有[多种代理选项](https://www.telepresence.io/reference/metho
要了解更多信息,请访问 [Telepresence 网站](https://www.telepresence.io)。
{{% /capture %}}
@@ -32,7 +32,7 @@ Use the [Service Catalog Installer](https://github.com/GoogleCloudPlatform/k8s-s
* Install [Go 1.6+](https://golang.org/dl/) and set the `GOPATH`.
* Install the [cfssl](https://github.com/cloudflare/cfssl) tool needed for generating SSL artifacts.
* Service Catalog requires Kubernetes version 1.7+.
* [Install and setup kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) so that it is configured to connect to a Kubernetes v1.7+ cluster.
* [Install and setup kubectl](/docs/tasks/tools/install-kubectl/) so that it is configured to connect to a Kubernetes v1.7+ cluster.
* The kubectl user must be bound to the *cluster-admin* role for it to install Service Catalog. To ensure that this is true, run the following command:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=<user-name>
@@ -41,7 +41,7 @@ Use the [Service Catalog Installer](https://github.com/GoogleCloudPlatform/k8s-s
* 安装 [Go 1.6+](https://golang.org/dl/) 以及设置 `GOPATH`
* 安装生成 SSL 工件所需的 [cfssl](https://github.com/cloudflare/cfssl) 工具。
* 服务目录需要 Kubernetes 1.7+ 版本。
* [安装和设置 kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/),以便将其配置为连接到 Kubernetes v1.7+ 集群。
* [安装和设置 kubectl](/docs/tasks/tools/install-kubectl/),以便将其配置为连接到 Kubernetes v1.7+ 集群。
* 要安装服务目录,kubectl 用户必须绑定到 *cluster-admin* 角色。为了确保这是正确的,请运行以下命令:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=<user-name>
@@ -35,7 +35,7 @@ linkTitle: Try Our Interactive Tutorials
<div class="row">
<div class="col-md-9">
<h2>Kubernetes 可以为您做些什么?</h2>
<p>通过现代的 Web 服务,用户希望应用程序能够 24/7 全天候使用,开发人员希望每天可以多次发布部署新版本的应用程序。 容器化可以帮助软件包达成这些目标,使应用程序能够以简单快速的方式发布和更新,而无需停机。Kubernetes 帮助您确保这些容器化的应用程序在您想要的时间和地点运行,并帮助应用程序找到它们需要的资源和工具。 <a href="http://kubernetes.io/docs/whatisk8s/">Kubernetes</a> 是一个可用于生产的开源平台,根据 Google 容器集群方面积累的经验,以及来自社区的最佳实践而设计。</p>
<p>通过现代的 Web 服务,用户希望应用程序能够 24/7 全天候使用,开发人员希望每天可以多次发布部署新版本的应用程序。 容器化可以帮助软件包达成这些目标,使应用程序能够以简单快速的方式发布和更新,而无需停机。Kubernetes 帮助您确保这些容器化的应用程序在您想要的时间和地点运行,并帮助应用程序找到它们需要的资源和工具。 <a href="/docs/whatisk8s/">Kubernetes</a> 是一个可用于生产的开源平台,根据 Google 容器集群方面积累的经验,以及来自社区的最佳实践而设计。</p>
</div>
</div>
@@ -26,7 +26,7 @@ title: 运行应用程序的多个实例
<div class="col-md-8">
<h3>应用程序伸缩</h3>
<p>在之前的模块中,我们创建了一个 <a href="http://kubernetes.io/docs/user-guide/deployments/"> Deployment</a>,然后通过 <a href="http://kubernetes.io/docs/user-guide/services/">Service</a>让应用程序外部可见。
<p>在之前的模块中,我们创建了一个 <a href="/docs/user-guide/deployments/"> Deployment</a>,然后通过 <a href="/docs/user-guide/services/">Service</a>让应用程序外部可见。
Deployment 仅为我们的应用程序创建了一个 Pod。
当流量增加时,我们将需要扩展应用程序以跟上用户需求。</p>
@@ -88,7 +88,7 @@ title: 运行应用程序的多个实例
<div class="col-md-8">
<p>扩展 Deployment 将确保创建新的 Pods 并将其调度到拥有可用资源的 Node 节点上,收缩会保证 Pods 数量减少至新的所需状态。
Kubernetes 还支持 Pods 的 <a href="http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/"> 自动缩放 </a> ,但不在本教程范围之内。收缩到零也是可以的,此时它将终止指定 Deployment 的所有 Pod。 </p>
Kubernetes 还支持 Pods 的 <a href="/docs/user-guide/horizontal-pod-autoscaling/"> 自动缩放 </a> ,但不在本教程范围之内。收缩到零也是可以的,此时它将终止指定 Deployment 的所有 Pod。 </p>
<p>运行应用程序的多个实例需要一种将流量分发给所有实例的方法。服务有内置的负载均衡器,可将网络流量分配给 Deployment 暴露的所有 Pods。服务通过使用 endpoints 持续监控运行的 Pods,以确保流量仅发送到可用的 Pods。</p>
@@ -27,10 +27,10 @@ weight: 10
<!-- <h3>Scaling an application</h3> -->
<h3>扩缩应用程序</h3>
<!-- <p>In the previous modules we created a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/"> Deployment</a>,
and then exposed it publicly via a <a href="https://kubernetes.io/docs/concepts/services-networking/service/">Service</a>.
<!-- <p>In the previous modules we created a <a href="/docs/concepts/workloads/controllers/deployment/"> Deployment</a>,
and then exposed it publicly via a <a href="/docs/concepts/services-networking/service/">Service</a>.
The Deployment created only one Pod for running our application. When traffic increases, we will need to scale the application to keep up with user demand.</p> -->
<p>在之前的模块中,我们创建了一个 <a href="http://kubernetes.io/docs/user-guide/deployments/"> Deployment</a>,然后通过 <a href="http://kubernetes.io/docs/user-guide/services/">Service</a>让其可以开放访问。Deployment 仅为跑这个应用程序创建了一个 Pod。 当流量增加时,我们需要扩容应用程序满足用户需求。</p>
<p>在之前的模块中,我们创建了一个 <a href="/docs/user-guide/deployments/"> Deployment</a>,然后通过 <a href="/docs/user-guide/services/">Service</a>让其可以开放访问。Deployment 仅为跑这个应用程序创建了一个 Pod。 当流量增加时,我们需要扩容应用程序满足用户需求。</p>
<!-- <p><b>Scaling</b> is accomplished by changing the number of replicas in a Deployment</p> -->
<p><b>扩缩</b> 是通过改变 Deployment 中的副本数量来实现的。</p>
@@ -95,8 +95,8 @@ weight: 10
<div class="col-md-8">
<!-- <p>Scaling out a Deployment will ensure new Pods are created and scheduled to Nodes with available resources. Scaling in will reduce the number of Pods to the new desired state. Kubernetes also supports
<a href="http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/">autoscaling</a> of Pods, but it is outside of the scope of this tutorial. Scaling to zero is also possible, and it will terminate all Pods of the specified Deployment.</p> -->
<p>扩展 Deployment 将创建新的 Pods,并将资源调度请求分配到有可用资源的节点上,收缩 会将 Pods 数量减少至所需的状态。Kubernetes 还支持 Pods 的<a href="http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/">自动缩放</a>,但这并不在本教程的讨论范围内。将 Pods 数量收缩到0也是可以的,但这会终止 Deployment 上所有已经部署的 Pods。</p>
<a href="/docs/user-guide/horizontal-pod-autoscaling/">autoscaling</a> of Pods, but it is outside of the scope of this tutorial. Scaling to zero is also possible, and it will terminate all Pods of the specified Deployment.</p> -->
<p>扩展 Deployment 将创建新的 Pods,并将资源调度请求分配到有可用资源的节点上,收缩 会将 Pods 数量减少至所需的状态。Kubernetes 还支持 Pods 的<a href="/docs/user-guide/horizontal-pod-autoscaling/">自动缩放</a>,但这并不在本教程的讨论范围内。将 Pods 数量收缩到0也是可以的,但这会终止 Deployment 上所有已经部署的 Pods。</p>
<!-- <p>Running multiple instances of an application will require a way to distribute the traffic to all of them. Services have an integrated load-balancer that will distribute network traffic to all Pods of an exposed Deployment.
Services will monitor continuously the running Pods using endpoints, to ensure the traffic is sent only to available Pods.</p> -->
@@ -57,7 +57,7 @@ kubectl create deployment nginx --image nginx
在命令式对象配置中,`kubectl` 命令指定操作(创建,替换等),可选标志和至少一个文件名称。指定的文件必须包含对象的完整定义以 YAML 或 JSON 格式。
请参阅[参考资源](https://kubernetes.io/docs/resources-reference/v1.6/)
请参阅[参考资源](/docs/resources-reference/v1.6/)
查看有关对象定义的更多细节。
**警告:** 命令式 `replace` 命令用新提供的命令替换现有资源规格,将对配置文件中缺少的对象的所有更改都丢弃。这种方法不应更新与配置文件无关的资源类型。例如,`LoadBalancer` 类型的服务使其 `externalIPs` 字段与集群的配置无关。
@@ -149,5 +149,3 @@ kubectl apply -R -f configs/
{{< comment >}}
{{< /comment >}}
{{% /capture %}}
@@ -38,7 +38,7 @@ title: “示例:使用 Stateful Sets 部署 Cassandra”
## 准备工作
本示例假设你已经安装运行了一个 Kubernetes集群(版本 >=1.2),并且还在某个路径下安装了 [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) 命令行工具。请查看 [getting started guides](https://kubernetes.io/docs/getting-started-guides/) 获取关于你的平台的安装说明。
本示例假设你已经安装运行了一个 Kubernetes集群(版本 >=1.2),并且还在某个路径下安装了 [`kubectl`](/docs/tasks/tools/install-kubectl/) 命令行工具。请查看 [getting started guides](/docs/getting-started-guides/) 获取关于你的平台的安装说明。
本示例还需要一些代码和配置文件。为了避免手动输入,你可以 `git clone` Kubernetes 源到你本地。
@@ -176,7 +176,7 @@ cassandra None <none> 9042/TCP 45s
## 步骤2:使用 StatefulSet 创建 Cassandra Ring环
StatefulSets(以前叫做 PetSets)特性在 Kubernetes 1.5 中升级为一个 <i>Beta</i> 组件。在集群环境中部署类似于 Cassandra 的有状态分布式应用是一项具有挑战性的工作。我们实现了StatefulSet,极大的简化了这个过程。本示例使用了 StatefulSet 的多个特性,但其本身超出了本文的范围。[请参考 Stateful Set 文档。](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)
StatefulSets(以前叫做 PetSets)特性在 Kubernetes 1.5 中升级为一个 <i>Beta</i> 组件。在集群环境中部署类似于 Cassandra 的有状态分布式应用是一项具有挑战性的工作。我们实现了StatefulSet,极大的简化了这个过程。本示例使用了 StatefulSet 的多个特性,但其本身超出了本文的范围。[请参考 Stateful Set 文档。](/docs/concepts/workloads/controllers/statefulset/)
以下是StatefulSet 的清单文件,用于创建一个由三个 pods 组成的 Cassandra ring环。
@@ -848,4 +848,3 @@ $ kubectl delete daemonset cassandra
[!Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cassandra/README.md?pixel)]()
@@ -13,11 +13,11 @@ approvers:
展示的 Kubernetes 概念:
* [Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) 定义持久化磁盘(磁盘生命周期不和 Pods 绑定)。
* [Services](https://kubernetes.io/docs/concepts/services-networking/service/) 使得 Pods 能够找到其它 Pods。
* [External Load Balancers](https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer) 对外暴露 Services。
* [Deployments](http://kubernetes.io/docs/user-guide/deployments/) 确保 Pods 持续运行。
* [Secrets](http://kubernetes.io/docs/user-guide/secrets/) 保存敏感密码信息。
* [Persistent Volumes](/docs/concepts/storage/persistent-volumes/) 定义持久化磁盘(磁盘生命周期不和 Pods 绑定)。
* [Services](/docs/concepts/services-networking/service/) 使得 Pods 能够找到其它 Pods。
* [External Load Balancers](/docs/concepts/services-networking/service/#type-loadbalancer) 对外暴露 Services。
* [Deployments](/docs/user-guide/deployments/) 确保 Pods 持续运行。
* [Secrets](/docs/user-guide/secrets/) 保存敏感密码信息。
## 快速入门
@@ -66,18 +66,18 @@ kubectl create -f https://raw.githubusercontent.com/kubernetes/examples/master/m
Kubernetes本质是模块化的,可以在各种环境中运行。但并不是所有集群都相同。此处是本示例的一些要求:
* 需要 1.2 版本以上的 Kubernetes,以使用更新的特性,例如 PV Claims 和 Deployments。运行 `kubectl version` 来查看你的集群版本。
* [Cluster DNS](https://github.com/kubernetes/dns) 将被用于服务发现。
* 一个 [external load balancer](https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer) 将被用于接入 WordPress。
* 使用了 [Persistent Volume Claims](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)。你必须创建集群中需要的 Persistent Volumes。本示例将展示两种类型的 volume 的创建方法,但是任何类型的 volume 都是足够使用的。
* 一个 [external load balancer](/docs/concepts/services-networking/service/#type-loadbalancer) 将被用于接入 WordPress。
* 使用了 [Persistent Volume Claims](/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)。你必须创建集群中需要的 Persistent Volumes。本示例将展示两种类型的 volume 的创建方法,但是任何类型的 volume 都是足够使用的。
查阅 [Getting Started Guide](http://kubernetes.io/docs/getting-started-guides/),搭建一个集群并安装 [kubectl](http://kubernetes.io/docs/user-guide/prereqs/) 命令行工具。
查阅 [Getting Started Guide](/docs/getting-started-guides/),搭建一个集群并安装 [kubectl](/docs/user-guide/prereqs/) 命令行工具。
## 决定在哪里存储你的数据
MySQL 和 WordPress 各自使用一个 [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) 来存储自己的数据。我们将使用一个 Persistent Volume Claim 来取得一个可用的持久化存储。本示例覆盖了 HostPath 和
GCEPersistentDisk 卷类型。你可以从两者中选择一个,或者查看 [Persistent Volumes的类型](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes)。
MySQL 和 WordPress 各自使用一个 [Persistent Volume](/docs/concepts/storage/persistent-volumes/) 来存储自己的数据。我们将使用一个 Persistent Volume Claim 来取得一个可用的持久化存储。本示例覆盖了 HostPath 和
GCEPersistentDisk 卷类型。你可以从两者中选择一个,或者查看 [Persistent Volumes的类型](/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes)。
### Host Path
@@ -112,7 +112,7 @@ kubectl create -f $KUBE_REPO/mysql-wordpress-pd/local-volumes.yaml
### GCE Persistent Disk
如果在 [Google Compute Engine](http://kubernetes.io/docs/getting-started-guides/gce/) 上运行集群,你可以使用这个存储选项。
如果在 [Google Compute Engine](/docs/getting-started-guides/gce/) 上运行集群,你可以使用这个存储选项。
创建两个永久磁盘。你需要在和 Kubernetes 集群相同的 [GCE zone](https://cloud.google.com/compute/docs/zones) 中创建这些磁盘。默认的安装脚本将在 `us-central1-b` zone 中创建集群,就像你在 [config-default.sh](https://git.k8s.io/kubernetes/cluster/gce/config-default.sh) 文件中看到的。替换下面的 `<zone>` 为合适的 zone。`wordpress-1``wordpress-2` 的名字必须和 [gce-volumes.yaml](https://git.k8s.io/examples/mysql-wordpress-pd/gce-volumes.yaml) 指定的 `pdName` 字段匹配。
@@ -134,7 +134,7 @@ kubectl create -f $KUBE_REPO/mysql-wordpress-pd/gce-volumes.yaml
## 创建 MySQL 密码 Secret
使用一个 [Secret](http://kubernetes.io/docs/user-guide/secrets/) 对象存储 MySQL 密码。首先,创建一个名为 `password.txt` 的文件(和 wordpress 示例文件在相同的文件夹),并且将你的密码保存于其中。请确保密码文件的结尾没有空行。如果你的编辑器添加了一个,开始的 `tr` 命令将会删除这个空行。然后,创建这个 Secret 对象。
使用一个 [Secret](/docs/user-guide/secrets/) 对象存储 MySQL 密码。首先,创建一个名为 `password.txt` 的文件(和 wordpress 示例文件在相同的文件夹),并且将你的密码保存于其中。请确保密码文件的结尾没有空行。如果你的编辑器添加了一个,开始的 `tr` 命令将会删除这个空行。然后,创建这个 Secret 对象。
```shell
tr --delete '\n' <password.txt >.strippedpassword.txt && mv .strippedpassword.txt password.txt
@@ -318,11 +318,10 @@ kubectl delete pv wordpress-pv-1 wordpress-pv-2
## 接下来的步骤
* [Introspection and Debugging](http://kubernetes.io/docs/user-guide/introspection-and-debugging/)
* [Jobs](http://kubernetes.io/docs/user-guide/jobs/) may be useful to run SQL queries.
* [Exec](http://kubernetes.io/docs/user-guide/getting-into-containers/)
* [Port Forwarding](http://kubernetes.io/docs/user-guide/connecting-to-applications-port-forward/)
* [Introspection and Debugging](/docs/user-guide/introspection-and-debugging/)
* [Jobs](/docs/user-guide/jobs/) may be useful to run SQL queries.
* [Exec](/docs/user-guide/getting-into-containers/)
* [Port Forwarding](/docs/user-guide/connecting-to-applications-port-forward/)
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/mysql-wordpress-pd/README.md?pixel)]()