Creating Sealed Secrets#
Sealed secrets is a Kubernetes controller written by Bitnami that is used to encrypt secrets in your code repositories. The sealed secret will be automatically synced from your manifest, decrypted in the cluster, and an unencrypted secret created in your tenant namespace.
Kubeseal#
Kubeseal is a CLI tool to create sealed secrets. Follow the Kubeseal installation instructions if needed.
Key/Value Pair(s)#
-
Run this command to create a manifest with the unencrypted secret, specifying as many key/value pairs as you need.
-
Run the following command to create the sealed secret manifest, replacing
<tier>
(dvlp, pprd, prod) and<location>
(aws, op) with the proper values and<namespace>
with your tenant namespace: -
Add the manifest sealed-secret.yaml to your tenant repository. Once synced, the sealed secret will be decrypted and stored as a normal Kubernetes secret.
Image Registry#
Kubernetes secrets are a different type for image registries. Here's how you would create a sealed secret for an image registry credential.
-
You need to get credentials for the registry you want to access. For GitLab, this can be a Project Access Token or Deploy Key.
-
Run this command to create a manifest with the unencrypted secret, replacing
<secret_name>
,<server_url>
,<username>
, and<password>
with your own data. Most VT users will usecode.vt.edu:5005
orharbor.platform.it.vt.edu
for the server URL. -
Run the following command to create the sealed secret manifest, replacing
<tier>
(dvlp, pprd, prod) and<location>
(aws, op) with the proper values and<namespace>
with your tenant namespace: -
Add the manifest sealed-secret.yaml to your tenant repository. Once synced, the sealed secret will be decrypted and stored as a normal Kubernetes secret.