K3s Secrets Management
Procedures for managing sensitive data and encryption within the K3s cluster.
1. Overview
Secret management is handled through Kubernetes native Secret objects. External integration with Bitnami Sealed Secrets is utilized for GitOps-friendly encryption.
2. Sealed Secrets Implementation
Sensitive data is encrypted (sealed) before being committed to version control.
Installation
-
Deploy the Sealed Secrets controller via the Helm chart:
-
Install the
kubesealCLI tool on the local management workstation.
Workflow
- Creation: Define a standard Kubernetes secret locally.
-
Encryption: Encrypt the secret using
kubesealand the public key from the cluster: -
Deployment: Commit and push the
SealedSecretobject to the repository. The cluster-side controller performs the decryption.
3. External Secret Vaults (Optional)
For environments requiring advanced lifecycle management, integration with external vaults is supported.
- HashiCorp Vault: Managed via External Secrets Operator (ESO).
- OCI Vault: Direct integration for cloud-native secret retrieval.
4. Operational Best Practices
- Rotation: Secrets are rotated every 90 days.
- Access: RBAC is utilized to restrict secret access to authorized namespaces only.
- Audit: Secret access events are captured in the cluster audit logs.