1
1
---
2
- title : 静态加密 Secret 数据
2
+ title : 静态加密机密数据
3
3
content_type : task
4
- min-kubernetes-server-version : 1.13
5
4
weight : 210
6
5
---
7
6
<!--
8
- title: Encrypting Secret Data at Rest
7
+ title: Encrypting Confidential Data at Rest
9
8
reviewers:
10
9
- smarterclayton
11
10
- enj
12
11
content_type: task
13
- min-kubernetes-server-version: 1.13
14
12
weight: 210
15
13
-->
16
14
@@ -35,6 +33,7 @@ This page shows how to enable and configure encryption of secret data at rest.
35
33
方式运行在每个控制平面节点上。
36
34
37
35
* 集群的控制平面** 必须** 使用 etcd v3.x(主版本 3,任何次要版本)。
36
+
38
37
<!--
39
38
* To encrypt a custom resource, your cluster must be running Kubernetes v1.26 or newer.
40
39
@@ -78,18 +77,32 @@ decrypt data stored in the etcd.
78
77
## 理解静态数据加密 {#understanding-the-encryption-at-rest-configuration}
79
78
80
79
<!--
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
82
89
-->
83
90
``` yaml
91
+ ---
92
+ #
93
+ # 注意:这是一个示例配置。请勿将其用于你自己的集群!
94
+ #
84
95
apiVersion : apiserver.config.k8s.io/v1
85
96
kind : EncryptionConfiguration
86
97
resources :
87
98
- resources :
88
99
- secrets
89
100
- configmaps
90
- - pandas.awesome.bears.example
101
+ - pandas.awesome.bears.example # 自定义资源 API
91
102
providers :
92
- - identity : {}
103
+ # 此配置不提供数据机密性。
104
+ # 第一个配置的 provider 正在指定将资源存储为纯文本的 "identity" 机制。
105
+ - identity : {} # 纯文本,换言之未加密
93
106
- aesgcm :
94
107
keys :
95
108
- name : key1
@@ -111,14 +124,14 @@ resources:
111
124
providers :
112
125
- identity : {} # 即使如下指定 *.* 也不会加密 events
113
126
- resources :
114
- - ' *.apps'
127
+ - ' *.apps' # 通配符匹配需要 Kubernetes 1.27 或更高版本
115
128
providers :
116
129
- aescbc :
117
130
keys :
118
131
- name : key2
119
132
secret : c2VjcmV0IGlzIHNlY3VyZSwgb3IgaXMgaXQ/Cg==
120
133
- resources :
121
- - ' *.*'
134
+ - ' *.*' # 通配符匹配需要 Kubernetes 1.27 或更高版本
122
135
providers :
123
136
- aescbc :
124
137
keys :
@@ -429,7 +442,13 @@ Create a new encryption config file:
429
442
430
443
创建一个新的加密配置文件:
431
444
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
+ -->
432
450
` ` ` yaml
451
+ ---
433
452
apiVersion: apiserver.config.k8s.io/v1
434
453
kind: EncryptionConfiguration
435
454
resources:
@@ -441,8 +460,10 @@ resources:
441
460
- aescbc:
442
461
keys:
443
462
- name: key1
463
+ # 参见以下文本了解有关 Secret 值的详情
444
464
secret: <BASE 64 ENCODED SECRET>
445
- - identity: {}
465
+ - identity: {} # 这个回退允许读取未加密的 Secret;
466
+ # 例如,在初始迁移期间
446
467
` ` `
447
468
448
469
<!--
@@ -479,17 +500,24 @@ To create a new Secret, perform the following steps:
479
500
代码范例如下:
480
501
481
502
<!--
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
483
506
-->
484
507
` ` ` yaml
508
+ ---
509
+ #
510
+ # 这是一个静态 Pod 的清单片段。
511
+ # 检查是否适用于你的集群和 API 服务器。
512
+ #
485
513
apiVersion: v1
486
514
kind: Pod
487
515
metadata:
488
516
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
490
518
creationTimestamp: null
491
519
labels:
492
- component: kube-apiserver
520
+ app.kubernetes.io/ component: kube-apiserver
493
521
tier: control-plane
494
522
name: kube-apiserver
495
523
namespace: kube-system
@@ -694,6 +722,7 @@ and restart all `kube-apiserver` processes.
694
722
作为配置中的第一个条目并重新启动所有 ` kube-apiserver ` 进程。
695
723
696
724
``` yaml
725
+ ---
697
726
apiVersion : apiserver.config.k8s.io/v1
698
727
kind : EncryptionConfiguration
699
728
resources :
0 commit comments