Skip to content

Encryption at rest

First we want to ensure a few things are encrypted at rest within our cluster, currently that is secrets and confimaps.

See encrypt-data for details, or follow below for a basic example.

Create a static encryption key with random data:

head -c 32 /dev/urandom | base64

Now create a configuration snipper for kubernetes to use:

cat >>kubernetes-enc.yaml<<EOF
kind: EncryptionConfiguration
  - resources:
      - secrets
      - configmaps
      - secretbox:
            - name: key1
              secret: <BASE 64 ENCODED SECRET>
      - identity: {} # this fallback allows reading unencrypted secrets;
                     # for example, during initial migration

Make sure to copy kubernetes-enc.yaml to each node, into /etc.

See the asciicast below: