Skip to content

Commit 6cccb93

Browse files
authored
Merge pull request #41901 from windsonsea/encry
[zh] sync encrypt-data.md and install-kubectl-macos.md
2 parents 84728c6 + 344ac6e commit 6cccb93

File tree

2 files changed

+92
-13
lines changed

2 files changed

+92
-13
lines changed

content/zh-cn/docs/tasks/administer-cluster/encrypt-data.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
---
2-
title: 静态加密 Secret 数据
2+
title: 静态加密机密数据
33
content_type: task
4-
min-kubernetes-server-version: 1.13
54
weight: 210
65
---
76
<!--
8-
title: Encrypting Secret Data at Rest
7+
title: Encrypting Confidential Data at Rest
98
reviewers:
109
- smarterclayton
1110
- enj
1211
content_type: task
13-
min-kubernetes-server-version: 1.13
1412
weight: 210
1513
-->
1614

@@ -35,6 +33,7 @@ This page shows how to enable and configure encryption of secret data at rest.
3533
方式运行在每个控制平面节点上。
3634

3735
* 集群的控制平面**必须**使用 etcd v3.x(主版本 3,任何次要版本)。
36+
3837
<!--
3938
* To encrypt a custom resource, your cluster must be running Kubernetes v1.26 or newer.
4039
@@ -78,18 +77,32 @@ decrypt data stored in the etcd.
7877
## 理解静态数据加密 {#understanding-the-encryption-at-rest-configuration}
7978

8079
<!--
81-
do not encrypt events even though *.* is specified below
80+
# CAUTION: this is an example configuration.
81+
# Do not use this for your own cluster!
82+
# This configuration does not provide data confidentiality. The first
83+
# configured provider is specifying the "identity" mechanism, which
84+
# stores resources as plain text.
85+
# plain text, in other words NO encryption
86+
# do not encrypt Events even though *.* is specified below
87+
# wildcard match requires Kubernetes 1.27 or later
88+
# wildcard match requires Kubernetes 1.27 or later
8289
-->
8390
```yaml
91+
---
92+
#
93+
# 注意:这是一个示例配置。请勿将其用于你自己的集群!
94+
#
8495
apiVersion: apiserver.config.k8s.io/v1
8596
kind: EncryptionConfiguration
8697
resources:
8798
- resources:
8899
- secrets
89100
- configmaps
90-
- pandas.awesome.bears.example
101+
- pandas.awesome.bears.example # 自定义资源 API
91102
providers:
92-
- identity: {}
103+
# 此配置不提供数据机密性。
104+
# 第一个配置的 provider 正在指定将资源存储为纯文本的 "identity" 机制。
105+
- identity: {} # 纯文本,换言之未加密
93106
- aesgcm:
94107
keys:
95108
- name: key1
@@ -111,14 +124,14 @@ resources:
111124
providers:
112125
- identity: {} # 即使如下指定 *.* 也不会加密 events
113126
- resources:
114-
- '*.apps'
127+
- '*.apps' # 通配符匹配需要 Kubernetes 1.27 或更高版本
115128
providers:
116129
- aescbc:
117130
keys:
118131
- name: key2
119132
secret: c2VjcmV0IGlzIHNlY3VyZSwgb3IgaXMgaXQ/Cg==
120133
- resources:
121-
- '*.*'
134+
- '*.*' # 通配符匹配需要 Kubernetes 1.27 或更高版本
122135
providers:
123136
- aescbc:
124137
keys:
@@ -429,7 +442,13 @@ Create a new encryption config file:
429442

430443
创建一个新的加密配置文件:
431444

445+
<!--
446+
# See the following text for more details about the secret value
447+
# this fallback allows reading unencrypted secrets;
448+
# for example, during initial migratoin
449+
-->
432450
```yaml
451+
---
433452
apiVersion: apiserver.config.k8s.io/v1
434453
kind: EncryptionConfiguration
435454
resources:
@@ -441,8 +460,10 @@ resources:
441460
- aescbc:
442461
keys:
443462
- name: key1
463+
# 参见以下文本了解有关 Secret 值的详情
444464
secret: <BASE 64 ENCODED SECRET>
445-
- identity: {}
465+
- identity: {} # 这个回退允许读取未加密的 Secret;
466+
# 例如,在初始迁移期间
446467
```
447468

448469
<!--
@@ -479,17 +500,24 @@ To create a new Secret, perform the following steps:
479500
代码范例如下:
480501

481502
<!--
482-
add this line
503+
# This is a fragment of a manifest for a static Pod.
504+
# Check whether this is correct for your cluster and for your API server.
505+
# add this line
483506
-->
484507
```yaml
508+
---
509+
#
510+
# 这是一个静态 Pod 的清单片段。
511+
# 检查是否适用于你的集群和 API 服务器。
512+
#
485513
apiVersion: v1
486514
kind: Pod
487515
metadata:
488516
annotations:
489-
kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 10.10.30.4:6443
517+
kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 10.20.30.40:443
490518
creationTimestamp: null
491519
labels:
492-
component: kube-apiserver
520+
app.kubernetes.io/component: kube-apiserver
493521
tier: control-plane
494522
name: kube-apiserver
495523
namespace: kube-system
@@ -694,6 +722,7 @@ and restart all `kube-apiserver` processes.
694722
作为配置中的第一个条目并重新启动所有 `kube-apiserver` 进程。
695723

696724
```yaml
725+
---
697726
apiVersion: apiserver.config.k8s.io/v1
698727
kind: EncryptionConfiguration
699728
resources:

content/zh-cn/docs/tasks/tools/install-kubectl-macos.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,56 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
449449
rm kubectl-convert kubectl-convert.sha256
450450
```
451451

452+
<!--
453+
### Uninstall kubectl on macOS
454+
455+
Depending on how you installed `kubectl`, use one of the following methods.
456+
-->
457+
### 在 macOS 上卸载 kubectl {#uninstall-kubectl-on-macos}
458+
459+
根据你安装 `kubectl` 的方式,使用以下某种方法来卸载:
460+
461+
<!--
462+
### Uninstall kubectl using the command-line
463+
464+
1. Locate the `kubectl` binary on your system:
465+
-->
466+
### 使用命令行卸载 kubectl {#uninstall-kubectl-using-cli}
467+
468+
1. 找到你系统上的 `kubectl` 可执行文件:
469+
470+
```bash
471+
where kubectl
472+
```
473+
474+
<!--
475+
1. Remove the `kubectl` binary:
476+
-->
477+
2. 移除 `kubectl` 可执行文件:
478+
479+
```bash
480+
sudo rm <path>
481+
```
482+
483+
<!--
484+
Replace `<path>` with the path to the `kubectl` binary from the previous step. For example, `sudo rm /usr/local/bin/kubectl`.
485+
-->
486+
`<path>` 替换为上一步中找到的 `kubectl` 可执行文件的路径。
487+
例如,`sudo rm /usr/local/bin/kubectl`
488+
489+
<!--
490+
### Uninstall kubectl using homebrew
491+
492+
If you installed `kubectl` using Homebrew, run the following command:
493+
-->
494+
### 使用 Homebrew 卸载 kubectl {#uninstall-kubectl-using-homebrew}
495+
496+
如果你使用 Homebrew 安装了 `kubectl`,运行以下命令:
497+
498+
```bash
499+
brew remove kubectl
500+
```
501+
452502
## {{% heading "whatsnext" %}}
453503

454504
{{< include "included/kubectl-whats-next.md" >}}

0 commit comments

Comments
 (0)