[zh] Fix links on docs home
The links on the Home page is out of sync due to reasons like improper translation of card name, missing card section in front-matter or even missing content file in Chinese localization.
This commit is contained in:
parent
5a97e2b6a6
commit
073ce649b9
|
|
@ -3,7 +3,7 @@ title: 理解 Kubernetes 对象
|
|||
content_type: concept
|
||||
weight: 10
|
||||
card:
|
||||
name: 概念
|
||||
name: concepts
|
||||
weight: 40
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ title: Pod 概览
|
|||
content_type: concept
|
||||
weight: 10
|
||||
card:
|
||||
name: 概念
|
||||
name: concepts
|
||||
weight: 60
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -13,47 +13,59 @@ menu:
|
|||
title: "文档"
|
||||
weight: 20
|
||||
post: >
|
||||
<p>通过演练,示例和参考文档了解如何使用 Kubernetes。你甚至可以<a href="/editdocs/" data-auto-burger-exclude>帮助贡献文档</a>!</p>
|
||||
overview: >
|
||||
<!-- Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation (<a href="https://www.cncf.io/about">CNCF</a>). -->
|
||||
Kubernetes 是一个开源容器编排引擎,用于容器化应用的自动化部署、扩展和管理。该项目托管在 <a href="https://www.cncf.io/about">CNCF</a>。
|
||||
<!-- cards:
|
||||
- name: concepts
|
||||
title: "Understand the basics"
|
||||
description: "Learn about Kubernetes and its fundamental concepts."
|
||||
button: "Learn Concepts"
|
||||
button_path: "/docs/concepts"
|
||||
- name: tutorials
|
||||
title: "Try Kubernetes"
|
||||
description: "Follow tutorials to learn how to deploy applications in Kubernetes."
|
||||
button: "View Tutorials"
|
||||
button_path: "/docs/tutorials"
|
||||
- name: setup
|
||||
title: "Set up a cluster"
|
||||
description: "Get Kubernetes running based on your resources and needs."
|
||||
button: "Set up Kubernetes"
|
||||
button_path: "/docs/setup"
|
||||
- name: tasks
|
||||
title: "Learn how to use Kubernetes"
|
||||
description: "Look up common tasks and how to perform them using a short sequence of steps."
|
||||
button: "View Tasks"
|
||||
button_path: "/docs/tasks"
|
||||
- name: reference
|
||||
title: Look up reference information
|
||||
description: Browse terminology, command line syntax, API resource types, and setup tool documentation.
|
||||
button: View Reference
|
||||
button_path: /docs/reference
|
||||
- name: contribute
|
||||
title: Contribute to the docs
|
||||
description: Anyone can contribute, whether you’re new to the project or you’ve been around a long time.
|
||||
button: Contribute to the docs
|
||||
button_path: /docs/contribute
|
||||
- name: release-notes
|
||||
title: Release Notes
|
||||
description: If you are installing Kubernetes or upgrading to the newest version, refer to the current release notes.
|
||||
- name: about
|
||||
title: About the documentation
|
||||
description: This website contains documentation for the current and previous 4 versions of Kubernetes. -->
|
||||
<p>通过概念、教程和参考文档了解如何使用 Kubernetes。你甚至可以<a href="/editdocs/" data-auto-burger-exclude>帮助贡献文档</a>!</p>
|
||||
# description: >
|
||||
# Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation.
|
||||
description: >
|
||||
Kubernetes 是一个开源的容器编排引擎,用来对容器化应用进行自动部署、 扩缩和管理。此开源项目由云原生计算基金会(CNCF)托管。
|
||||
# overview:
|
||||
# Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation (<a href="https://www.cncf.io/about">CNCF</a>).
|
||||
overview:
|
||||
Kubernetes 是一个开源的容器编排引擎,用来对容器化应用进行自动化部署、 扩缩和管理。该项目托管在 <a href="https://www.cncf.io/about">CNCF</a>。
|
||||
# cards:
|
||||
# - name: concepts
|
||||
# title: "Understand the basics"
|
||||
# description: "Learn about Kubernetes and its fundamental concepts."
|
||||
# button: "Learn Concepts"
|
||||
# button_path: "/docs/concepts"
|
||||
# - name: tutorials
|
||||
# title: "Try Kubernetes"
|
||||
# description: "Follow tutorials to learn how to deploy applications in Kubernetes."
|
||||
# button: "View Tutorials"
|
||||
# button_path: "/docs/tutorials"
|
||||
# - name: setup
|
||||
# title: "Set up a cluster"
|
||||
# description: "Get Kubernetes running based on your resources and needs."
|
||||
# button: "Set up Kubernetes"
|
||||
# button_path: "/docs/setup"
|
||||
# - name: tasks
|
||||
# title: "Learn how to use Kubernetes"
|
||||
# description: "Look up common tasks and how to perform them using a short sequence of steps."
|
||||
# button: "View Tasks"
|
||||
# button_path: "/docs/tasks"
|
||||
# - name: training
|
||||
# title: "Training"
|
||||
# description: "Get certified in Kubernetes and make your cloud native projects successful!"
|
||||
# button: "View training"
|
||||
# button_path: "/training"
|
||||
# - name: reference
|
||||
# title: Look up reference information
|
||||
# description: Browse terminology, command line syntax, API resource types, and setup tool documentation.
|
||||
# button: View Reference
|
||||
# button_path: /docs/reference
|
||||
# - name: contribute
|
||||
# title: Contribute to the docs
|
||||
# description: Anyone can contribute, whether you’re new to the project or you’ve been around a long time.
|
||||
# button: Contribute to the docs
|
||||
# button_path: /docs/contribute
|
||||
# - name: release-notes
|
||||
# title: Release Notes
|
||||
# description: If you are installing Kubernetes or upgrading to the newest version, refer to the current release notes.
|
||||
# button: "Download Kubernetes"
|
||||
# button_path: "/zh/docs/setup/release/notes"
|
||||
# - name: about
|
||||
# title: About the documentation
|
||||
# description: This website contains documentation for the current and previous 4 versions of Kubernetes.
|
||||
cards:
|
||||
- name: concepts
|
||||
title: "了解基本知识"
|
||||
|
|
@ -75,20 +87,27 @@ cards:
|
|||
description: "查看常见任务以及如何使用简单步骤执行它们。"
|
||||
button: "查看任务"
|
||||
button_path: "/zh/docs/tasks"
|
||||
- name: training
|
||||
title: "培训"
|
||||
description: "通过 Kubernetes 认证,助你的云原生项目成功!"
|
||||
button: "查看培训"
|
||||
button_path: "/zh/training"
|
||||
- name: reference
|
||||
title: 参考
|
||||
description: 术语、命令行语法、API 资源类型和设置工具文档。
|
||||
title: 查阅参考信息
|
||||
description: 浏览术语、命令行语法、API 资源类型和安装工具文档。
|
||||
button: 查看参考
|
||||
button_path: /zh/docs/reference
|
||||
- name: contribute
|
||||
title: 为该文档作出贡献
|
||||
title: 为文档作贡献
|
||||
description: 任何人,无论对该项目熟悉与否,都能贡献自己的力量。
|
||||
button: 参与贡献
|
||||
button: 为文档作贡献
|
||||
button_path: /zh/docs/contribute
|
||||
- name: download
|
||||
title: 下载 Kubernetes
|
||||
description: 如果你正在安装或升级 Kubernetes 的话,最好参考最新的发行版说明。
|
||||
- name: release-notes
|
||||
title: 发布说明
|
||||
description: 如果你正在安装或升级 Kubernetes,最好参考最新的发布说明。
|
||||
button: "下载 Kubernetes"
|
||||
button_path: "/zh/docs/setup/release/notes"
|
||||
- name: about
|
||||
title: 关于文档
|
||||
description: 该网站包含了当前版本以及前 4 个版本的 Kubernetes 文档。
|
||||
description: 本网站包含了当前及前 4 个版本的 Kubernetes 文档。
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
---
|
||||
approvers:
|
||||
- chenopis
|
||||
- abiogenesis-now
|
||||
title: 标准化词汇表
|
||||
layout: glossary
|
||||
noedit: true
|
||||
default_active_tag: fundamental
|
||||
weight: 5
|
||||
card:
|
||||
name: 参考
|
||||
name: reference
|
||||
weight: 10
|
||||
title: 词汇表
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1,33 +1,63 @@
|
|||
---
|
||||
# title: Overview of kubeadm
|
||||
title: kubeadm 概述
|
||||
weight: 10
|
||||
card:
|
||||
name: reference
|
||||
weight: 40
|
||||
---
|
||||
<!--
|
||||
reviewers:
|
||||
- luxas
|
||||
- jbeda
|
||||
title: Overview of kubeadm
|
||||
weight: 10
|
||||
card:
|
||||
name: reference
|
||||
weight: 40
|
||||
-->
|
||||
|
||||
<img src="https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/certified-kubernetes/versionless/color/certified-kubernetes-color.png" align="right" width="150px">
|
||||
<!-- Kubeadm is a tool built to provide `kubeadm init` and `kubeadm join` as best-practice “fast paths” for creating Kubernetes clusters. -->
|
||||
<!--
|
||||
Kubeadm is a tool built to provide `kubeadm init` and `kubeadm join` as best-practice “fast paths” for creating Kubernetes clusters.
|
||||
-->
|
||||
Kubeadm 是一个工具,它提供了 `kubeadm init` 以及 `kubeadm join` 这两个命令作为快速创建 kubernetes 集群的最佳实践。
|
||||
|
||||
<!-- kubeadm performs the actions necessary to get a minimum viable cluster up and running. By design, it cares only about bootstrapping, not about provisioning machines. Likewise, installing various nice-to-have addons, like the Kubernetes Dashboard, monitoring solutions, and cloud-specific addons, is not in scope. -->
|
||||
<!--
|
||||
kubeadm performs the actions necessary to get a minimum viable cluster up and running. By design, it cares only about bootstrapping, not about provisioning machines. Likewise, installing various nice-to-have addons, like the Kubernetes Dashboard, monitoring solutions, and cloud-specific addons, is not in scope.
|
||||
-->
|
||||
kubeadm 通过执行必要的操作来启动和运行一个最小可用的集群。它被故意设计为只关心启动集群,而不是准备节点环境的工作。同样的,诸如安装各种各样的可有可无的插件,例如 Kubernetes 控制面板、监控解决方案以及特定云提供商的插件,这些都不在它负责的范围。
|
||||
|
||||
<!-- Instead, we expect higher-level and more tailored tooling to be built on top of kubeadm, and ideally, using kubeadm as the basis of all deployments will make it easier to create conformant clusters. -->
|
||||
<!--
|
||||
Instead, we expect higher-level and more tailored tooling to be built on top of kubeadm, and ideally, using kubeadm as the basis of all deployments will make it easier to create conformant clusters.
|
||||
-->
|
||||
相反,我们期望由一个基于 kubeadm 从更高层设计的更加合适的工具来做这些事情;并且,理想情况下,使用 kubeadm 作为所有部署的基础将会使得创建一个符合期望的集群变得容易。
|
||||
|
||||
<!--
|
||||
## How to install
|
||||
|
||||
To install kubeadm, see the [installation guide](/docs/setup/production-environment/tools/kubeadm/install-kubeadm).
|
||||
-->
|
||||
## 如何安装
|
||||
要安装 kubeadm,请参考[安装指南](/docs/setup/production-environment/tools/kubeadm/install-kubeadm)。
|
||||
|
||||
## 接下可以做什么
|
||||
|
||||
<!-- * [kubeadm init](/docs/reference/setup-tools/kubeadm/kubeadm-init) to bootstrap a Kubernetes master node -->
|
||||
* [kubeadm init](/docs/reference/setup-tools/kubeadm/kubeadm-init) 启动一个 Kubernetes 主节点
|
||||
<!-- * [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join) to bootstrap a Kubernetes worker node and join it to the cluster -->
|
||||
* [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join) 启动一个 Kubernetes 工作节点并且将其加入到集群
|
||||
<!-- * [kubeadm upgrade](/docs/reference/setup-tools/kubeadm/kubeadm-upgrade) to upgrade a Kubernetes cluster to a newer version -->
|
||||
* [kubeadm upgrade](/docs/reference/setup-tools/kubeadm/kubeadm-upgrade) 更新一个 Kubernetes 集群到新版本
|
||||
<!-- * [kubeadm config](/docs/reference/setup-tools/kubeadm/kubeadm-config) if you initialized your cluster using kubeadm v1.7.x or lower, to configure your cluster for `kubeadm upgrade` -->
|
||||
<!--
|
||||
* [kubeadm init](/docs/reference/setup-tools/kubeadm/kubeadm-init) to bootstrap a Kubernetes master node
|
||||
* [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join) to bootstrap a Kubernetes worker node and join it to the cluster
|
||||
* [kubeadm upgrade](/docs/reference/setup-tools/kubeadm/kubeadm-upgrade) to upgrade a Kubernetes cluster to a newer version
|
||||
* [kubeadm config](/docs/reference/setup-tools/kubeadm/kubeadm-config) if you initialized your cluster using kubeadm v1.7.x or lower, to configure your cluster for `kubeadm upgrade`
|
||||
* [kubeadm token](/docs/reference/setup-tools/kubeadm/kubeadm-token) to manage tokens for `kubeadm join`
|
||||
* [kubeadm reset](/docs/reference/setup-tools/kubeadm/kubeadm-reset) to revert any changes made to this host by `kubeadm init` or `kubeadm join`
|
||||
* [kubeadm version](/docs/reference/setup-tools/kubeadm/kubeadm-version) to print the kubeadm version
|
||||
* [kubeadm alpha](/docs/reference/setup-tools/kubeadm/kubeadm-alpha) to preview a set of features made available for gathering feedback from the community
|
||||
-->
|
||||
* [kubeadm init](/docs/reference/setup-tools/kubeadm/kubeadm-init) 启动引导一个 Kubernetes 主节点
|
||||
* [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join) 启动引导一个 Kubernetes 工作节点并且将其加入到集群
|
||||
* [kubeadm upgrade](/docs/reference/setup-tools/kubeadm/kubeadm-upgrade) 更新 Kubernetes 集群到新版本
|
||||
* [kubeadm config](/docs/reference/setup-tools/kubeadm/kubeadm-config) 如果你使用 kubeadm v1.7.x 或者更低版本,你需要对你的集群做一些配置以便使用 `kubeadm upgrade` 命令
|
||||
<!-- * [kubeadm token](/docs/reference/setup-tools/kubeadm/kubeadm-token) to manage tokens for `kubeadm join` -->
|
||||
* [kubeadm token](/docs/reference/setup-tools/kubeadm/kubeadm-token) 使用 `kubeadm join` 来管理令牌
|
||||
<!-- * [kubeadm reset](/docs/reference/setup-tools/kubeadm/kubeadm-reset) to revert any changes made to this host by `kubeadm init` or `kubeadm join` -->
|
||||
* [kubeadm reset](/docs/reference/setup-tools/kubeadm/kubeadm-reset) 还原之前使用 `kubeadm init` 或者 `kubeadm join` 对节点产生的改变
|
||||
<!-- * [kubeadm version](/docs/reference/setup-tools/kubeadm/kubeadm-version) to print the kubeadm version -->
|
||||
* [kubeadm reset](/docs/reference/setup-tools/kubeadm/kubeadm-reset) 还原之前使用 `kubeadm init` 或者 `kubeadm join` 对节点所作改变
|
||||
* [kubeadm version](/docs/reference/setup-tools/kubeadm/kubeadm-version) 打印出 kubeadm 版本
|
||||
<!-- * [kubeadm alpha](/docs/reference/setup-tools/kubeadm/kubeadm-alpha) to preview a set of features made available for gathering feedback from the community -->
|
||||
* [kubeadm alpha](/docs/reference/setup-tools/kubeadm/kubeadm-alpha) 预览一组可用的新功能以便从社区搜集反馈
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ main_menu: true
|
|||
weight: 20
|
||||
content_type: concept
|
||||
card:
|
||||
name: 设置
|
||||
name: setup
|
||||
weight: 20
|
||||
anchors:
|
||||
- anchor: "#learning-environment"
|
||||
|
|
@ -15,7 +15,6 @@ card:
|
|||
---
|
||||
|
||||
<!--
|
||||
---
|
||||
reviewers:
|
||||
- brendandburns
|
||||
- erictune
|
||||
|
|
@ -33,7 +32,6 @@ card:
|
|||
title: Learning environment
|
||||
- anchor: "#production-environment"
|
||||
title: Production environment
|
||||
---
|
||||
-->
|
||||
|
||||
<!-- overview -->
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,29 +1,67 @@
|
|||
---
|
||||
title: 配置对多集群的访问
|
||||
content_type: task
|
||||
card:
|
||||
name: tasks
|
||||
weight: 40
|
||||
---
|
||||
|
||||
<!--
|
||||
title: Configure Access to Multiple Clusters
|
||||
content_type: task
|
||||
weight: 30
|
||||
card:
|
||||
name: tasks
|
||||
weight: 40
|
||||
-->
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
<!--
|
||||
This page shows how to configure access to multiple clusters by using
|
||||
configuration files. After your clusters, users, and contexts are defined in
|
||||
one or more configuration files, you can quickly switch between clusters by using the
|
||||
`kubectl config use-context` command.
|
||||
-->
|
||||
本文展示如何使用配置文件来配置对多个集群的访问。 在将集群、用户和上下文定义在一个或多个配置文件中之后,用户可以使用 `kubectl config use-context` 命令快速地在集群之间进行切换。
|
||||
|
||||
<!--
|
||||
A file that is used to configure access to a cluster is sometimes called
|
||||
a *kubeconfig file*. This is a generic way of referring to configuration files.
|
||||
It does not mean that there is a file named `kubeconfig`.
|
||||
-->
|
||||
{{< note >}}
|
||||
用于配置集群访问的文件有时被称为 *kubeconfig 文件*。
|
||||
这是一种引用配置文件的通用方式,并不意味着存在一个名为 `kubeconfig` 的文件。
|
||||
{{< /note >}}
|
||||
|
||||
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}}
|
||||
|
||||
需要安装 [`kubectl`](/docs/tasks/tools/install-kubectl/) 命令行工具。
|
||||
|
||||
|
||||
<!--
|
||||
To check that {{< glossary_tooltip text="kubectl" term_id="kubectl" >}} is installed,
|
||||
run `kubectl version --client`. The kubectl version should be
|
||||
[within one minor version](/docs/setup/release/version-skew-policy/#kubectl) of your
|
||||
cluster's API server.
|
||||
-->
|
||||
要检查 {{< glossary_tooltip text="kubectl" term_id="kubectl" >}} 是否安装,
|
||||
执行 `kubectl version --client` 命令。
|
||||
kubectl 的版本应该与集群的 API 服务器
|
||||
[使用同一次版本号](/docs/setup/release/version-skew-policy/#kubectl)。
|
||||
|
||||
<!-- steps -->
|
||||
<!--
|
||||
## Define clusters, users, and contexts
|
||||
|
||||
Suppose you have two clusters, one for development work and one for scratch work.
|
||||
In the `development` cluster, your frontend developers work in a namespace called `frontend`,
|
||||
and your storage developers work in a namespace called `storage`. In your `scratch` cluster,
|
||||
developers work in the default namespace, or they create auxiliary namespaces as they
|
||||
see fit. Access to the development cluster requires authentication by certificate. Access
|
||||
to the scratch cluster requires authentication by username and password.
|
||||
|
||||
Create a directory named `config-exercise`. In your
|
||||
`config-exercise` directory, create a file named `config-demo` with this content:
|
||||
-->
|
||||
## 定义集群、用户和上下文
|
||||
|
||||
假设用户有两个集群,一个用于正式开发工作,一个用于其它临时用途(scratch)。
|
||||
|
|
@ -58,6 +96,14 @@ contexts:
|
|||
name: exp-scratch
|
||||
```
|
||||
|
||||
<!--
|
||||
A configuration file describes clusters, users, and contexts. Your `config-demo` file
|
||||
has the framework to describe two clusters, two users, and three contexts.
|
||||
|
||||
Go to your `config-exercise` directory. Enter these commands to add cluster details to
|
||||
your configuration file:
|
||||
-->
|
||||
|
||||
配置文件描述了集群、用户名和上下文。 `config-demo` 文件中含有描述两个集群、两个用户和三个上下文的框架。
|
||||
|
||||
进入 `config-exercise` 目录。 输入以下命令,将群集详细信息添加到配置文件中:
|
||||
|
|
@ -67,6 +113,9 @@ kubectl config --kubeconfig=config-demo set-cluster development --server=https:/
|
|||
kubectl config --kubeconfig=config-demo set-cluster scratch --server=https://5.6.7.8 --insecure-skip-tls-verify
|
||||
```
|
||||
|
||||
<!--
|
||||
Add user details to your configuration file:
|
||||
-->
|
||||
将用户详细信息添加到配置文件中:
|
||||
|
||||
```shell
|
||||
|
|
@ -74,6 +123,20 @@ kubectl config --kubeconfig=config-demo set-credentials developer --client-certi
|
|||
kubectl config --kubeconfig=config-demo set-credentials experimenter --username=exp --password=some-password
|
||||
```
|
||||
|
||||
<!--
|
||||
- To delete a user you can run `kubectl --kubeconfig=config-demo config unset users.<name>`
|
||||
- To remove a cluster, you can run `kubectl --kubeconfig=config-demo config unset clusters.<name>`
|
||||
- To remove a context, you can run `kubectl --kubeconfig=config-demo config unset contexts.<name>`
|
||||
-->
|
||||
|
||||
注意:
|
||||
- 要删除用户,可以运行 `kubectl --kubeconfig=config-demo config unset users.<name>`
|
||||
- 要删除集群,可以运行 `kubectl --kubeconfig=config-demo config unset clusters.<name>`
|
||||
- 要删除上下文,可以运行 `kubectl --kubeconfig=config-demo config unset contexts.<name>`
|
||||
|
||||
<!--
|
||||
Add context details to your configuration file:
|
||||
-->
|
||||
将上下文详细信息添加到配置文件中:
|
||||
|
||||
```shell
|
||||
|
|
@ -82,12 +145,19 @@ kubectl config --kubeconfig=config-demo set-context dev-storage --cluster=develo
|
|||
kubectl config --kubeconfig=config-demo set-context exp-scratch --cluster=scratch --namespace=default --user=experimenter
|
||||
```
|
||||
|
||||
<!--
|
||||
Open your `config-demo` file to see the added details. As an alternative to opening the
|
||||
`config-demo` file, you can use the `config view` command.
|
||||
-->
|
||||
打开 `config-demo` 文件查看添加的详细信息。 也可以使用 `config view` 命令进行查看:
|
||||
|
||||
```shell
|
||||
kubectl config --kubeconfig=config-demo view
|
||||
```
|
||||
|
||||
<!--
|
||||
The output shows the two clusters, two users, and three contexts:
|
||||
-->
|
||||
输出展示了两个集群、两个用户和三个上下文:
|
||||
|
||||
```yaml
|
||||
|
|
@ -131,8 +201,32 @@ users:
|
|||
username: exp
|
||||
```
|
||||
|
||||
<!--
|
||||
The `fake-ca-file`, `fake-cert-file` and `fake-key-file` above are the placeholders
|
||||
for the pathnames of the certificate files. You need change these to the actual pathnames
|
||||
of certificate files in your environment.
|
||||
|
||||
Sometimes you may want to use Base64-encoded data embedded here instead of separate
|
||||
certificate files; in that case you need add the suffix `-data` to the keys, for example,
|
||||
`certificate-authority-data`, `client-certificate-data`, `client-key-data`.
|
||||
-->
|
||||
其中的 `fake-ca-file`、`fake-cert-file` 和 `fake-key-file` 是证书文件路径名的占位符。
|
||||
你需要更改这些值,使之对应你的环境中证书文件的实际路径名。
|
||||
|
||||
有时你可能希望在这里使用 BASE64 编码的数据而不是一个个独立的证书文件。
|
||||
如果是这样,你需要在键名上添加 `-data` 后缀。例如,
|
||||
`certificate-authority-data`、`client-certificate-data` 和 `client-key-data`。
|
||||
|
||||
<!--
|
||||
Each context is a triple (cluster, user, namespace). For example, the
|
||||
`dev-frontend` context says, "Use the credentials of the `developer`
|
||||
user to access the `frontend` namespace of the `development` cluster".
|
||||
|
||||
Set the current context:
|
||||
-->
|
||||
每个上下文包含三部分(集群、用户和名字空间),例如,
|
||||
`dev-frontend` 上下文表明:使用 `developer` 用户的凭证来访问 `development` 集群的 `frontend` 名字空间。
|
||||
`dev-frontend` 上下文表明:使用 `developer` 用户的凭证来访问 `development` 集群的
|
||||
`frontend` 名字空间。
|
||||
|
||||
设置当前上下文:
|
||||
|
||||
|
|
@ -140,7 +234,16 @@ users:
|
|||
kubectl config --kubeconfig=config-demo use-context dev-frontend
|
||||
```
|
||||
|
||||
现在当输入 `kubectl` 命令时,相应动作会应用于 `dev-frontend` 上下文中所列的集群和名字空间,同时,命令会使用 `dev-frontend` 上下文中所列用户的凭证。
|
||||
<!--
|
||||
Now whenever you enter a `kubectl` command, the action will apply to the cluster,
|
||||
and namespace listed in the `dev-frontend` context. And the command will use
|
||||
the credentials of the user listed in the `dev-frontend` context.
|
||||
|
||||
To see only the configuration information associated with
|
||||
the current context, use the `--minify` flag.
|
||||
-->
|
||||
现在当输入 `kubectl` 命令时,相应动作会应用于 `dev-frontend` 上下文中所列的集群和名字空间,
|
||||
同时,命令会使用 `dev-frontend` 上下文中所列用户的凭证。
|
||||
|
||||
使用 `--minify` 参数,来查看与当前上下文相关联的配置信息。
|
||||
|
||||
|
|
@ -148,6 +251,9 @@ kubectl config --kubeconfig=config-demo use-context dev-frontend
|
|||
kubectl config --kubeconfig=config-demo view --minify
|
||||
```
|
||||
|
||||
<!--
|
||||
The output shows configuration information associated with the `dev-frontend` context:
|
||||
-->
|
||||
输出结果展示了 `dev-frontend` 上下文相关的配置信息:
|
||||
|
||||
```yaml
|
||||
|
|
@ -173,6 +279,11 @@ users:
|
|||
client-key: fake-key-file
|
||||
```
|
||||
|
||||
<!--
|
||||
Now suppose you want to work for a while in the scratch cluster.
|
||||
|
||||
Change the current context to `exp-scratch`:
|
||||
-->
|
||||
现在假设用户希望在其它临时用途集群中工作一段时间。
|
||||
|
||||
将当前上下文更改为 `exp-scratch`:
|
||||
|
|
@ -181,7 +292,16 @@ users:
|
|||
kubectl config --kubeconfig=config-demo use-context exp-scratch
|
||||
```
|
||||
|
||||
现在用户 `kubectl` 下达的任何命令都将应用于 `scratch` 集群的默认名字空间。 同时,命令会使用 `exp-scratch` 上下文中所列用户的凭证。
|
||||
<!--
|
||||
Now any `kubectl` command you give will apply to the default namespace of
|
||||
the `scratch` cluster. And the command will use the credentials of the user
|
||||
listed in the `exp-scratch` context.
|
||||
|
||||
View configuration associated with the new current context, `exp-scratch`.
|
||||
-->
|
||||
|
||||
现在你发出的所有 `kubectl` 命令都将应用于 `scratch` 集群的默认名字空间。
|
||||
同时,命令会使用 `exp-scratch` 上下文中所列用户的凭证。
|
||||
|
||||
查看更新后的当前上下文 `exp-scratch` 相关的配置:
|
||||
|
||||
|
|
@ -189,6 +309,12 @@ kubectl config --kubeconfig=config-demo use-context exp-scratch
|
|||
kubectl config --kubeconfig=config-demo view --minify
|
||||
```
|
||||
|
||||
<!--
|
||||
Finally, suppose you want to work for a while in the `storage` namespace of the
|
||||
`development` cluster.
|
||||
|
||||
Change the current context to `dev-storage`:
|
||||
-->
|
||||
最后,假设用户希望在 `development` 集群中的 `storage` 名字空间下工作一段时间。
|
||||
|
||||
将当前上下文更改为 `dev-storage`:
|
||||
|
|
@ -197,13 +323,21 @@ kubectl config --kubeconfig=config-demo view --minify
|
|||
kubectl config --kubeconfig=config-demo use-context dev-storage
|
||||
```
|
||||
|
||||
<!--
|
||||
View configuration associated with the new current context, `dev-storage`.
|
||||
-->
|
||||
查看更新后的当前上下文 `dev-storage` 相关的配置:
|
||||
|
||||
|
||||
```shell
|
||||
kubectl config --kubeconfig=config-demo view --minify
|
||||
```
|
||||
|
||||
<!--
|
||||
## Create a second configuration file
|
||||
|
||||
In your `config-exercise` directory, create a file named `config-demo-2` with this content:
|
||||
-->
|
||||
|
||||
## 创建第二个配置文件
|
||||
|
||||
在 `config-exercise` 目录中,创建名为 `config-demo-2` 的文件,其中包含以下内容:
|
||||
|
|
@ -221,32 +355,77 @@ contexts:
|
|||
name: dev-ramp-up
|
||||
```
|
||||
|
||||
<!--
|
||||
The preceding configuration file defines a new context named `dev-ramp-up`.
|
||||
-->
|
||||
上述配置文件定义了一个新的上下文,名为 `dev-ramp-up`。
|
||||
|
||||
<!--
|
||||
## Set the KUBECONFIG environment variable
|
||||
|
||||
See whether you have an environment variable named `KUBECONFIG`. If so, save the
|
||||
current value of your `KUBECONFIG` environment variable, so you can restore it later.
|
||||
For example:
|
||||
-->
|
||||
## 设置 KUBECONFIG 环境变量
|
||||
|
||||
查看是否有名为 `KUBECONFIG` 的环境变量。 如有,保存 `KUBECONFIG` 环境变量当前的值,以便稍后恢复。
|
||||
例如,在 Linux 中:
|
||||
例如:
|
||||
|
||||
### Linux
|
||||
```shell
|
||||
export KUBECONFIG_SAVED=$KUBECONFIG
|
||||
export KUBECONFIG_SAVED=$KUBECONFIG
|
||||
```
|
||||
|
||||
`KUBECONFIG` 环境变量是配置文件路径的列表,该列表在 Linux 和 Mac 中以冒号分隔,在 Windows 中以分号分隔。 如果有 `KUBECONFIG` 环境变量,请熟悉列表中的配置文件。
|
||||
### Windows PowerShell
|
||||
```shell
|
||||
$Env:KUBECONFIG_SAVED=$ENV:KUBECONFIG
|
||||
```
|
||||
|
||||
临时添加两条路径到 `KUBECONFIG` 环境变量中。 例如,在 Linux 中:
|
||||
<!--
|
||||
The `KUBECONFIG` environment variable is a list of paths to configuration files. The list is
|
||||
colon-delimited for Linux and Mac, and semicolon-delimited for Windows. If you have
|
||||
a `KUBECONFIG` environment variable, familiarize yourself with the configuration files
|
||||
in the list.
|
||||
|
||||
Temporarily append two paths to your `KUBECONFIG` environment variable. For example:
|
||||
-->
|
||||
`KUBECONFIG` 环境变量是配置文件路径的列表,该列表在 Linux 和 Mac 中以冒号分隔,
|
||||
在 Windows 中以分号分隔。
|
||||
如果有 `KUBECONFIG` 环境变量,请熟悉列表中的配置文件。
|
||||
|
||||
临时添加两条路径到 `KUBECONFIG` 环境变量中。 例如:
|
||||
|
||||
### Linux
|
||||
|
||||
```shell
|
||||
export KUBECONFIG=$KUBECONFIG:config-demo:config-demo-2
|
||||
```
|
||||
|
||||
### Windows PowerShell
|
||||
|
||||
```shell
|
||||
$Env:KUBECONFIG=("config-demo;config-demo-2")
|
||||
```
|
||||
|
||||
<!--
|
||||
In your `config-exercise` directory, enter this command:
|
||||
-->
|
||||
在 `config-exercise` 目录中输入以下命令:
|
||||
|
||||
```shell
|
||||
kubectl config view
|
||||
```
|
||||
|
||||
输出展示了 `KUBECONFIG` 环境变量中所列举的所有文件合并后的信息。 特别地, 注意合并信息中包含来自 `config-demo-2` 文件的 `dev-ramp-up` 上下文和来自 `config-demo` 文件的三个上下文:
|
||||
<!--
|
||||
The output shows merged information from all the files listed in your `KUBECONFIG`
|
||||
environment variable. In particular, notice that the merged information has the
|
||||
`dev-ramp-up` context from the `config-demo-2` file and the three contexts from
|
||||
the `config-demo` file:
|
||||
-->
|
||||
输出展示了 `KUBECONFIG` 环境变量中所列举的所有文件合并后的信息。
|
||||
特别地,注意合并信息中包含来自 `config-demo-2` 文件的 `dev-ramp-up` 上下文和来自
|
||||
`config-demo` 文件的三个上下文:
|
||||
|
||||
```yaml
|
||||
contexts:
|
||||
|
|
@ -272,49 +451,93 @@ contexts:
|
|||
name: exp-scratch
|
||||
```
|
||||
|
||||
更多关于 kubeconfig 文件如何合并的信息,请参考
|
||||
[使用 kubeconfig 文件组织集群访问](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
||||
<!--
|
||||
For more information about how kubeconfig files are merged, see
|
||||
[Organizing Cluster Access Using kubeconfig Files](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
||||
-->
|
||||
关于 kubeconfig 文件如何合并的更多信息,请参考
|
||||
[使用 kubeconfig 文件组织集群访问](/zh/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
||||
|
||||
<!--
|
||||
## Explore the $HOME/.kube directory
|
||||
|
||||
If you already have a cluster, and you can use `kubectl` to interact with
|
||||
the cluster, then you probably have a file named `config` in the `$HOME/.kube`
|
||||
directory.
|
||||
|
||||
Go to `$HOME/.kube`, and see what files are there. Typically, there is a file named
|
||||
`config`. There might also be other configuration files in this directory. Briefly
|
||||
familiarize yourself with the contents of these files.
|
||||
-->
|
||||
## 探索 $HOME/.kube 目录
|
||||
|
||||
如果用户已经拥有一个集群,可以使用 `kubectl` 与集群进行交互。 那么很可能在 `$HOME/.kube` 目录下有一个名为 `config` 的文件。
|
||||
如果用户已经拥有一个集群,可以使用 `kubectl` 与集群进行交互,
|
||||
那么很可能在 `$HOME/.kube` 目录下有一个名为 `config` 的文件。
|
||||
|
||||
进入 `$HOME/.kube` 目录, 看看那里有什么文件。 通常会有一个名为
|
||||
`config` 的文件,目录中可能还有其他配置文件。 请简单地熟悉这些文件的内容。
|
||||
进入 `$HOME/.kube` 目录,看看那里有什么文件。通常会有一个名为
|
||||
`config` 的文件,目录中可能还有其他配置文件。请简单地熟悉这些文件的内容。
|
||||
|
||||
<!--
|
||||
## Append $HOME/.kube/config to your KUBECONFIG environment variable
|
||||
|
||||
If you have a `$HOME/.kube/config` file, and it's not already listed in your
|
||||
`KUBECONFIG` environment variable, append it to your `KUBECONFIG` environment variable now.
|
||||
For example:
|
||||
-->
|
||||
## 将 $HOME/.kube/config 追加到 KUBECONFIG 环境变量中
|
||||
|
||||
如果有 `$HOME/.kube/config` 文件,并且还未列在 `KUBECONFIG` 环境变量中,
|
||||
那么现在将它追加到 `KUBECONFIG` 环境变量中。
|
||||
例如,在 Linux 中:
|
||||
例如:
|
||||
|
||||
### Linux
|
||||
|
||||
```shell
|
||||
export KUBECONFIG=$KUBECONFIG:$HOME/.kube/config
|
||||
```
|
||||
|
||||
在配置练习目录中输入以下命令,来查看当前 `KUBECONFIG` 环境变量中列举的所有文件合并后的配置信息:
|
||||
### Windows Powershell
|
||||
|
||||
```shell
|
||||
$Env:KUBECONFIG="$Env:KUBECONFIG;$HOME\.kube\config"
|
||||
```
|
||||
|
||||
<!--
|
||||
View configuration information merged from all the files that are now listed
|
||||
in your `KUBECONFIG` environment variable. In your config-exercise directory, enter:
|
||||
-->
|
||||
在配置练习目录中输入以下命令,查看当前 `KUBECONFIG` 环境变量中列举的所有文件合并后的配置信息:
|
||||
|
||||
```shell
|
||||
kubectl config view
|
||||
```
|
||||
|
||||
<!--
|
||||
## Clean up
|
||||
|
||||
Return your `KUBECONFIG` environment variable to its original value. For example:
|
||||
-->
|
||||
## 清理
|
||||
|
||||
将 `KUBECONFIG` 环境变量还原为原始值。 例如,在 Linux 中:
|
||||
将 `KUBECONFIG` 环境变量还原为原始值。 例如:
|
||||
|
||||
### Linux
|
||||
```shell
|
||||
export KUBECONFIG=$KUBECONFIG_SAVED
|
||||
```
|
||||
|
||||
|
||||
### Windows PowerShell
|
||||
```shell
|
||||
$Env:KUBECONFIG=$ENV:KUBECONFIG_SAVED
|
||||
```
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
<!--
|
||||
* [Organizing Cluster Access Using kubeconfig Files](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
||||
* [kubectl config](/docs/reference/generated/kubectl/kubectl-commands#config)
|
||||
-->
|
||||
|
||||
* [使用 kubeconfig 文件组织集群访问](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
||||
* [kubectl 配置](/docs/user-guide/kubectl/{{< param "version" >}}/)
|
||||
|
||||
|
||||
|
||||
|
||||
* [使用 kubeconfig 文件组织集群访问](/zh/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
||||
* [kubectl config](/docs/reference/generated/kubectl/kubectl-commands#config)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ card:
|
|||
name: tasks
|
||||
weight: 50
|
||||
---
|
||||
<!-- ---
|
||||
<!--
|
||||
title: Configure a Pod to Use a ConfigMap
|
||||
content_type: task
|
||||
weight: 150
|
||||
card:
|
||||
name: tasks
|
||||
weight: 50
|
||||
--- -->
|
||||
-->
|
||||
|
||||
<!-- overview -->
|
||||
<!-- ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable. This page provides a series of usage examples demonstrating how to create ConfigMaps and configure Pods using data stored in ConfigMaps. -->
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
---
|
||||
reviewers:
|
||||
- mikedanese
|
||||
title: 安装并设置 kubectl
|
||||
title: 安装并配置 kubectl
|
||||
content_type: task
|
||||
weight: 10
|
||||
card:
|
||||
name: tasks
|
||||
weight: 20
|
||||
title: 安装 kubectl
|
||||
---
|
||||
<!--
|
||||
---
|
||||
reviewers:
|
||||
- bgrant0607
|
||||
- mikedanese
|
||||
title: Install and Set Up kubectl
|
||||
content_type: task
|
||||
weight: 10
|
||||
---
|
||||
card:
|
||||
name: tasks
|
||||
weight: 20
|
||||
title: Install kubectl
|
||||
-->
|
||||
|
||||
<!-- overview -->
|
||||
<!--
|
||||
Use the Kubernetes command-line tool, [kubectl](/docs/user-guide/kubectl/), to deploy and manage applications on Kubernetes. Using kubectl, you can inspect cluster resources; create, delete, and update components; look at your new cluster; and bring up example apps.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,23 @@
|
|||
---
|
||||
title: 示例:使用 Persistent Volumes 部署 WordPress 和 MySQL
|
||||
reviewers:
|
||||
- ahmetb
|
||||
content_type: tutorial
|
||||
weight: 20
|
||||
card:
|
||||
name: tutorials
|
||||
weight: 40
|
||||
title: "Stateful 示例: Wordpress with Persistent Volumes"
|
||||
title: "有状态应用示例: 带持久卷的 Wordpress"
|
||||
---
|
||||
|
||||
<!--
|
||||
title: "Example: Deploying WordPress and MySQL with Persistent Volumes"
|
||||
reviewers:
|
||||
- ahmetb
|
||||
content_type: tutorial
|
||||
weight: 20
|
||||
card:
|
||||
name: tutorials
|
||||
weight: 40
|
||||
title: "Stateful Example: Wordpress with Persistent Volumes"
|
||||
-->
|
||||
<!-- overview -->
|
||||
|
||||
<!--
|
||||
|
|
|
|||
|
|
@ -1,19 +1,23 @@
|
|||
---
|
||||
title: "示例:使用 Redis 部署 PHP 留言板应用程序"
|
||||
reviewers:
|
||||
- ahmetb
|
||||
content_type: tutorial
|
||||
weight: 20
|
||||
card:
|
||||
name: tutorials
|
||||
weight: 30
|
||||
title: "无状态应用示例:基于 Redis 的 PHP Guestbook"
|
||||
---
|
||||
|
||||
<!--
|
||||
---
|
||||
title: "Example: Deploying PHP Guestbook application with Redis"
|
||||
reviewers:
|
||||
- ahmetb
|
||||
content_type: tutorial
|
||||
weight: 20
|
||||
---
|
||||
card:
|
||||
name: tutorials
|
||||
weight: 30
|
||||
title: "Stateless Example: PHP Guestbook with Redis"
|
||||
-->
|
||||
|
||||
<!-- overview -->
|
||||
|
|
|
|||
|
|
@ -8,14 +8,12 @@ class: training
|
|||
---
|
||||
|
||||
<!--
|
||||
---
|
||||
title: Training
|
||||
bigheader: Kubernetes Training and Certification
|
||||
abstract: Training programs, certifications, and partners.
|
||||
layout: basic
|
||||
cid: training
|
||||
class: training
|
||||
---
|
||||
-->
|
||||
|
||||
<section class="call-to-action">
|
||||
|
|
|
|||
Loading…
Reference in New Issue