Skip to main content
k8s-scheduler is configured through environment variables. Different variables apply to the server and operator components.

Server Configuration

The server (cmd/server) accepts configuration via environment variables or Vault-injected secrets.

Always Required

string
required
PostgreSQL connection string.
For production, enable SSL:

Required in Production

These can be skipped when DEV_MODE=true for local development.
string
required
Google OAuth2 client ID from Google Cloud Console.
string
required
Google OAuth2 client secret.
string
required
OAuth callback URL. Must match the authorized redirect URI in Google Cloud Console.

Server Settings

boolean
default:"false"
Enable local development mode. Disables OAuth and auto-logs in as dev@localhost.
Never enable in production. This bypasses all authentication.
boolean
default:"false"
Serve embedded React SPA from go:embed.
Set to false if serving the frontend separately (e.g., via CDN or Vite dev server).
string
default:":8081"
HTTP server listen address.
string
default:"http://localhost:8081"
Public URL of the application. Used for OAuth redirects and email links.
string
default:"example.com"
Base domain for user deployment ingresses.
User deployments get subdomains like:
boolean
default:"false"
Enable Kubernetes integration (create UserDeployment CRs).
Set to false for local development without a K8s cluster.
string
default:"sandbox-%s"
Namespace pattern for user sandboxes. %s is replaced with user ID.
Examples:
  • User user-123 → namespace sandbox-user-123
  • User alice → namespace sandbox-alice
duration
default:"30s"
Interval for reconciling deployment status from Kubernetes.

Session Configuration

string
default:"memory"
Session storage backend. Options: memory, postgres, redis.

memory

In-memory storage (lost on restart).Use for: Local developmentDon’t use: Production

postgres

PostgreSQL-backed sessions.Use for: Production (shared database)Requires: DATABASE_DSN

redis

Redis-backed sessions.Use for: Production (separate cache)Requires: REDIS_ADDR
duration
default:"24h"
Session lifetime before automatic expiration.
Supports: 1h, 24h, 168h (7 days), etc.
Cookie name for session identifier.
duration
default:"24h"
Session lifetime before expiration.
duration
default:"1h"
Interval for cleaning up expired sessions (memory and PostgreSQL backends only).
Cookie domain for session cookies. Useful for subdomain sharing.
Cookie name for OAuth state parameter.
Require HTTPS for cookies. Enable in production.
string
Redis server address. Required when SESSION_BACKEND=redis.

Secrets Backend

k8s-scheduler supports three secrets backends for user/template/deployment secrets:
string
default:"database"
Secrets storage backend. Options: database, vault, aws.

database

Encrypted secrets in PostgreSQL.Requires: SECRETS_ENCRYPTION_KEYUse for: Simple deployments

vault

HashiCorp Vault KV v2.Requires: VAULT_ADDR, VAULT_TOKENUse for: Production (recommended)

aws

AWS Secrets Manager.Requires: AWS_REGION, IAM roleUse for: AWS-native deployments

Database Backend

string
Base64-encoded 32-byte encryption key. Required when SECRETS_BACKEND=database.
Store this key securely. Losing it means all secrets become unrecoverable.

Vault Backend

string
Vault server address.
string
Vault access token.
string
Path to Vault token file (for Vault Agent auto-refresh).
Preferred over VAULT_TOKEN in production.
string
default:"secret"
Vault KV mount path.

AWS Backend

string
AWS region for Secrets Manager.
AWS credentials are auto-discovered from:
  • Instance metadata (IAM role)
  • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  • ~/.aws/credentials

Optional Integrations

Billing (Stripe)

boolean
default:"false"
Enable Stripe billing integration.
string
Stripe secret key (sk_test_... or sk_live_...).
string
Stripe webhook signing secret (whsec_...).
Used to verify webhook payloads from Stripe.

Email (Invitations)

string
Email provider. Options: smtp, sendgrid.
string
SMTP server hostname.
string
default:"587"
SMTP server port.
string
SMTP authentication username.
string
SMTP authentication password.
string
SendGrid API key. Required when EMAIL_PROVIDER=sendgrid.

AI (Template Generation)

string
Anthropic API key for AI-assisted template generation.
Optional. Enables AI template generation feature in the UI.

Operator Configuration

The operator (cmd/operator) manages UserDeployment custom resources.

Environment Variables

string
required
Base domain for ingress routing.
Must match the server’s DEPLOYMENT_DOMAIN.
string
ClusterSecretStore name for External Secrets Operator.
If empty, the operator skips creating ExternalSecret resources.
boolean
default:"false"
Skip NetworkPolicy creation (for local development).
Useful for clusters without NetworkPolicy support (e.g., kind without Calico).
string
Namespace to watch for UserDeployments. Empty = all namespaces.

Configuration Examples

Production (Vault + PostgreSQL)

.env

Local Development

.env

AWS Deployment (No Vault)

.env

ConfigMap (Helm)

When deploying via Helm, non-secret configuration is stored in a ConfigMap:
charts/k8s-scheduler/templates/configmap-server.yaml
Secrets are injected via Vault Agent annotations on the server deployment.

Next Steps

Deployment Guide

Deploy k8s-scheduler to production

Dependencies

Learn about platform dependencies