Skip to main content
Username & Password secrets store authentication credentials as a username/password pair. Use them for database connections, API authentication, SMTP servers, or any service requiring basic credentials.

Use Cases

  • Database Authentication: Store credentials for PostgreSQL, MySQL, MongoDB, etc.
  • API Authentication: Basic auth credentials for REST APIs
  • SMTP/Email Services: Credentials for email sending services
  • Legacy Systems: Connect to systems using username/password authentication
  • FTP/SFTP Access: Credentials for file transfer services

Configuration Options

Use encoding: base64 when your credentials contain special characters that might cause parsing issues, or when you’re storing pre-encoded credentials from another system.

Create a Username & Password Secret

1

Navigate to Secrets

In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
2

Enter basic information

Enter a Name and optional Description.
3

Select secret type

Select Username/Password as the secret type.
4

Configure credentials

Click Data in the left pane. Enter the Username and Password. If your credentials are base64 encoded, enable Base64 Decode at Runtime to decode them when accessed.
5

Create the secret

Click Create.

Injecting into Workloads

As Environment Variables

Reference the username and password separately:

As Volume Files

When mounted as a volume, the secret creates two files:
This creates:
  • /etc/credentials/username containing the username
  • /etc/credentials/password containing the password

Common Patterns

PostgreSQL Connection

Workload environment:

MongoDB Connection

SMTP Credentials

Basic Auth for APIs


Best Practices

Generate random passwords with sufficient length and complexity. Avoid reusing passwords across different services.
Establish a rotation schedule for credentials. Update both the secret in Control Plane and the corresponding service.
Create dedicated service accounts rather than using personal credentials. This enables better auditing and easier credential rotation.
Where possible, prefer more secure authentication methods like IAM roles, service accounts, or certificate-based auth over username/password.

Next Steps

Opaque Secrets

Store API keys and other single-value secrets

Using Secrets in Workloads

Learn how to grant access and inject secrets