Create a Secret
Create a Secret to securely store sensitive information such as passwords, API tokens, and certificates.
Prerequisites
- The namespace where the Secret will be used must exist.
Step 1. Open the Create Secret form
Select Storage → Secrets from the left sidebar. Click the Create secret button in the top right.
Step 2. Enter basic information
| Field | Description | Example |
|---|---|---|
| Name | Secret name | db-credentials |
| Namespace | Target namespace | default |
| Type | Secret type | Opaque |
Secret Type Guide
| Type | Description | Use Case |
|---|---|---|
Opaque | Arbitrary key-value data (default) | Passwords, API keys |
kubernetes.io/tls | TLS certificate and private key | HTTPS Ingress certificates |
kubernetes.io/dockerconfigjson | Container registry credentials | Private registry image pulls |
kubernetes.io/service-account-token | Service Account token | Kubernetes API access |
Step 3. Add data entries
Click Add Data Entry to add items.
| Key | Value |
|---|---|
DB_PASSWORD | mySecretPassword123 |
API_TOKEN | eyJhbGciOiJSUzI1NiIs... |
Values are automatically Base64-encoded on save.
WARNING
Secrets are Base64-encoded but not encrypted by default. Check with your cluster admin to verify that etcd encryption at rest is enabled.
Step 4. Confirm creation
Click Create. Verify the created entry in the Secrets list. Secret values are masked in the list view.
Using the Secret in a Pod
The Secret can be injected into Pods in two ways:
- Environment variable: Deployment Edit Config → Environment Variables →
From Secret - File mount: See Mount Volume →