Configuration

Configure Kubey using environment variables.

Environment Variables

VariableDefaultDescription
PORT8080Port for the web server
HOST0.0.0.0Host to bind to
AUTH_MODEsingleAuthentication mode (single, shared, hybrid)
DATABASE_URLPostgreSQL connection string (required for shared mode)
JWT_SECRETSecret for JWT token signing
ENCRYPTION_KEYKey for encrypting stored kubeconfigs
KUBECONFIG~/.kube/configPath to kubeconfig file
LOG_LEVELinfoLogging level (debug, info, warn, error)

Authentication Modes

Single Mode

No authentication required. Anyone with network access can use Kubey. Best for local development or internal networks.

AUTH_MODE=single

Shared Mode

Full multi-user support with OAuth. Requires PostgreSQL. Users authenticate and see clusters shared with them.

AUTH_MODE=shared
DATABASE_URL=postgres://user:pass@host:5432/kubey
JWT_SECRET=your-secret-key
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx

Hybrid Mode

Like shared mode, but users can also see clusters from the mounted kubeconfig.

AUTH_MODE=hybrid

OAuth Configuration

GitHub

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth App Client ID
GITHUB_CLIENT_SECRETGitHub OAuth App Client Secret

Google

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth Client ID
GOOGLE_CLIENT_SECRETGoogle OAuth Client Secret

Admin Settings

These settings can be configured through the Admin Panel UI:

  • Allowed Domains — Restrict sign-ups to specific email domains (e.g., @yourcompany.com)
  • Invite Only — Disable self-registration, only invited users can sign up
  • Cluster Sharing — Share clusters between users

Example Configuration

.envbash
# Server
PORT=8080
HOST=0.0.0.0
LOG_LEVEL=info

# Authentication
AUTH_MODE=shared
JWT_SECRET=change-me-to-a-secure-random-string
ENCRYPTION_KEY=change-me-to-another-secure-string

# Database
DATABASE_URL=postgres://kubey:kubey@localhost:5432/kubey?sslmode=disable

# OAuth - GitHub
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

# OAuth - Google (optional)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret

# Kubernetes (optional, defaults to ~/.kube/config)
KUBECONFIG=/path/to/your/kubeconfig