Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.21 KB

06-data-encryption-keys-windows.md

File metadata and controls

29 lines (18 loc) · 1.21 KB

Generating the Data Encryption Config and Key

Kubernetes stores a variety of data including cluster state, application configurations, and secrets. Kubernetes supports the ability to encrypt cluster data at rest.

In this lab you will generate an encryption key and an encryption config suitable for encrypting Kubernetes Secrets.

The Encryption Key

Generate an encryption key:

$EncryptionKey = [convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 } | ForEach-Object { [byte]$_ }))

The Encryption Config File

Create the encryption-config.yaml encryption config file:

(Get-Content ".\configs\encryption-config.yaml") -replace "\`${ENCRYPTION_KEY}", $EncryptionKey > encryption-config.yaml

Copy the encryption-config.yaml encryption config file to each controller instance:

scp encryption-config.yaml "[email protected]:~/"

Next: Bootstrapping the etcd Cluster