配置生成密钥
Kubernetes 存储了集群状态、应用配置和密钥等很多不同的数据。而 Kubernetes 也支持集群数据的加密存储。
建立加密密钥:
ENCRYPTION_KEY=$(head -c 32 /dev/urandom | base64)
生成名为
encryption-config.yaml
的加密配置文件:cat > encryption-config.yaml <<EOF
kind: EncryptionConfig
apiVersion: v1
resources:
- resources:
- secrets
providers:
- aescbc:
keys:
- name: key1
secret: ${ENCRYPTION_KEY}
- identity: {}
EOF
将
encryption-config.yaml
复制到每个控制节点上:for instance in controller-0 controller-1 controller-2; do
gcloud compute scp encryption-config.yaml ${instance}:~/
done
最近更新 5mo ago