Skip to content
Openshift β€’ β€’ 2 min read

How to enable and configure ETCD encryption on OpenShift Container Platform

How to enable and configure ETCD encryption on OpenShift Container Platform

Leia este artigo em portuguΓͺs.

Etcd encryption in OpenShift Container Platform is a crucial feature for protecting sensitive data stored in the cluster. In this article, we will explore the supported encryption types, the benefits of etcd encryption, and a step-by-step guide to enable it properly.


πŸ” Supported Encryption Types

OpenShift supports two encryption methods for etcd data:

AES-CBC

AES-GCM


πŸ”Ž About Etcd Encryption

By default, etcd data in OpenShift is not encrypted. Enabling etcd encryption adds an extra layer of security, protecting sensitive data from exposure in case of a backup leak.

Resources Affected by Etcd Encryption:

βœ” Secrets
βœ” ConfigMaps
βœ” Routes
βœ” OAuth Access Tokens
βœ” OAuth Authorization Tokens

It's important to note that encryption keys are essential for etcd backup restoration.


βš™οΈ How to Enable Etcd Encryption

⚠ Important: Do not back up etcd until the encryption process is fully completed.

Impact of Enabling Etcd Encryption:

Step-by-Step Guide to Enable Etcd Encryption

1️⃣ Edit the APIServer Object

Run the following command:

oc edit apiserver

2️⃣ Define the Encryption Type (AES-GCM or AES-CBC)

Modify the configuration as follows:

spec:
  encryption:
    type: aesgcm  # or 'aescbc'

πŸ“Œ Save and apply the changes. The encryption process may take more than 20 minutes, depending on the size of the etcd database.


βœ… Verifying If Encryption Was Applied

To confirm that encryption has been successfully enabled, run the following commands:

πŸ“Œ Check the OpenShift API Server Status

oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'

πŸ“Œ Check the OpenShift OAuth API Server Status

oc get authentication.operator.openshift.io -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'

If the output shows EncryptionInProgress, the process is still ongoing. Wait a few minutes and check again.

For more details, refer to the official documentation:
πŸ”— Encrypting etcd in OpenShift


πŸ’‘ Who am I?

I’m Gabriel Carmo, a CNCF Kubestronaut holding the CKA, CKAD, CKS, KCNA, and KCSA certifications, as well as Red Hat Certified OpenShift Administrator.

I work in DevOps Engineering, building and evolving multi-cloud Kubernetes platforms. My work focuses on reducing engineering teams’ cognitive load through platform engineering, automation, GitOps, and self-service experiences.

In my daily work, I connect infrastructure as code, cloud networking, governance, security, observability, and SRE practices to build more standardized, resilient, and operable platforms.

LinkedIn | GitHub | GitLab | Credly | E-mail