# 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](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data) cluster data at rest, that is, the data stored within `etcd`. In this lab you will generate an encryption key and an [encryption config](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/#understanding-the-encryption-at-rest-configuration) suitable for encrypting Kubernetes Secrets. ## The Encryption Key [//]: # (host:controlplane01) Generate an encryption key. This is simply 32 bytes of random data, which we base64 encode: ```bash ENCRYPTION_KEY=$(head -c 32 /dev/urandom | base64) ``` ## The Encryption Config File Create the `encryption-config.yaml` encryption config file: ```bash cat > encryption-config.yaml < Prev: [Generating Kubernetes Configuration Files for Authentication](05-kubernetes-configuration-files.md)