Kubernetes the Hard Way on Azure : 6. データの暗号鍵
こんにちは。
引き続き、Kubernetes the Hard Way on Azure を進めていきます。
6. Generating the Data Encryption Config and Key
Kubernetesは、クラスタの状態、アプリケーションの構成、Secret を含むさまざまなデータを保存します。
Kubernetesは、保管中のクラスタデータを暗号化する機能をサポートしています。
このラボでは、Kubernetes Secret の暗号化に適した暗号鍵と暗号化設定ファイルを生成します。
暗号化には暗号鍵が必要ですよね。これも今まで意識していなかった。
The Encryption Key
暗号鍵を生成します。
ENCRYPTION_KEY=$(head -c 32 /dev/urandom | base64)
The Encryption Config File
暗号化構成ファイル [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 ; do PUBLIC_IP_ADDRESS=$(az network public-ip show -g kubernetes \ -n ${instance}-pip --query "ipAddress" -otsv) scp -o StrictHostKeyChecking=no encryption-config.yaml kuberoot@${PUBLIC_IP_ADDRESS}:~/ done
この章で行ったことは、
7.に続きます。