15.4. 禁用 etcd 加密
您可以在集群中禁用 etcd 数据的加密。
先决条件
- 
						使用具有 cluster-admin角色的用户访问集群。
流程
- 修改 - APIServer对象:- oc edit apiserver - $ oc edit apiserver- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 将 - encryption字段类型设置为- identity:- spec: encryption: type: identity- spec: encryption: type: identity- 1 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- identity类型是默认值,意味着没有执行任何加密。
 
- 保存文件以使改变生效。 - 解密过程开始。根据集群的大小,这个过程可能需要 20 分钟或更长的时间才能完成。 
- 验证 etcd 解密是否成功。 - 查看 OpenShift API 服务器的 - Encrypted状态条件,以验证其资源是否已成功解密:- oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'- $ oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 在成功解密后输出显示 - DecryptionCompleted:- DecryptionCompleted Encryption mode set to identity and everything is decrypted - DecryptionCompleted Encryption mode set to identity and everything is decrypted- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 如果输出显示 - DecryptionInProgress,解密仍在进行中。等待几分钟后重试。
- 查看 Kubernetes API 服务器的 - Encrypted状态条件,以验证其资源是否已成功解密:- oc get kubeapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'- $ oc get kubeapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 在成功解密后输出显示 - DecryptionCompleted:- DecryptionCompleted Encryption mode set to identity and everything is decrypted - DecryptionCompleted Encryption mode set to identity and everything is decrypted- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 如果输出显示 - DecryptionInProgress,解密仍在进行中。等待几分钟后重试。
- 查看 OpenShift OAuth API 服务器的 - Encrypted状态条件,以验证其资源是否已成功解密:- oc get authentication.operator.openshift.io -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'- $ oc get authentication.operator.openshift.io -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 在成功解密后输出显示 - DecryptionCompleted:- DecryptionCompleted Encryption mode set to identity and everything is decrypted - DecryptionCompleted Encryption mode set to identity and everything is decrypted- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 如果输出显示 - DecryptionInProgress,解密仍在进行中。等待几分钟后重试。