Skip to main content

Configuration

KubeVision is configured via a YAML file or environment variables.

Configuration File

server:
port: 8080

database:
driver: sqlite # sqlite | postgres
dsn: kubevision.db # file path or connection string
max_open_conns: 0 # driver default: SQLite 1, PostgreSQL 25
max_idle_conns: 0 # driver default: SQLite 1, PostgreSQL 5
conn_max_lifetime: 0s # PostgreSQL default: 30m
conn_max_idle_time: 0s # PostgreSQL default: 5m
ping_timeout: 5s

auth:
jwt_secret: "" # auto-generated if empty
access_token_ttl: 30m
refresh_token_ttl: 12h
public_key:
enabled: false
rp_id: ""
rp_display_name: KubeVision
origins: []
user_verification: required
counter_policy: deny
challenge_ttl: 5m

kubernetes:
kubeconfig: "" # empty = in-cluster mode
informer_resync: 30m
crd_discovery_interval: 5m

oauth:
enabled: false
providers: []

Environment Variables

All settings can be overridden via environment variables:

VariableDescriptionDefault
KUBEVISION_SERVER_PORTHTTP port8080
KUBEVISION_DB_DRIVERDatabase driver (sqlite or postgres)sqlite
KUBEVISION_DB_DSNDatabase connection stringkubevision.db
KUBEVISION_DB_MAX_OPEN_CONNSMaximum open database connectionsdriver default
KUBEVISION_DB_MAX_IDLE_CONNSMaximum idle database connectionsdriver default
KUBEVISION_DB_CONN_MAX_LIFETIMEMaximum connection lifetimePostgreSQL: 30m
KUBEVISION_DB_CONN_MAX_IDLE_TIMEMaximum idle connection timePostgreSQL: 5m
KUBEVISION_DB_PING_TIMEOUTStartup database ping timeout5s
KUBEVISION_JWT_SECRETJWT signing secretauto-generated
KUBEVISION_ACCESS_TOKEN_TTLAccess token lifetime30m
KUBEVISION_REFRESH_TOKEN_TTLRefresh token lifetime12h
KUBEVISION_PUBLIC_KEY_ENABLEDEnable passkey/security-key loginfalse
KUBEVISION_PUBLIC_KEY_RP_IDWebAuthn relying-party domainempty
KUBEVISION_PUBLIC_KEY_ORIGINSAllowed browser origins (comma-separated)empty
KUBECONFIGPath to kubeconfig filein-cluster
KUBEVISION_INFORMER_RESYNCInformer resync period30m
KUBEVISION_CRD_DISCOVERY_INTERVALCRD discovery refresh interval5m
KUBEVISION_OAUTH_ENABLEDEnable configured OAuth/OIDC providersfalse
KUBEVISION_ENCRYPT_KEYKey used to encrypt persisted credentialsauto-generated
KUBEVISION_ALLOWED_ORIGINSWebSocket origin whitelist (comma-separated)*

Database

SQLite (Development)

Default configuration, zero setup:

database:
driver: sqlite
dsn: kubevision.db

SQLite is limited to one KubeVision process. Kubernetes deployments using SQLite must use one replica with autoscaling disabled. Use PostgreSQL before scaling horizontally.

PostgreSQL (Production)

database:
driver: postgres
dsn: "host=localhost port=5432 user=kubevision password=secret dbname=kubevision sslmode=disable"
max_open_conns: 25
max_idle_conns: 5
conn_max_lifetime: 30m
conn_max_idle_time: 5m

Or via environment variable:

export KUBEVISION_DB_DRIVER=postgres
export KUBEVISION_DB_DSN="host=localhost port=5432 user=kubevision password=secret dbname=kubevision sslmode=disable"

KubeVision records schema versions and serializes PostgreSQL migrations during startup, preventing multiple replicas from changing the schema concurrently. Back up the database before upgrading. /healthz reports process liveness; /readyz checks database connectivity and should be used for readiness probes. Multi-replica Helm deployments must use existingSecret to provide one shared KUBEVISION_DB_DSN, KUBEVISION_JWT_SECRET, and KUBEVISION_ENCRYPT_KEY.

Kubernetes Connection

In-Cluster Mode

When deployed inside a Kubernetes cluster, KubeVision automatically uses the service account token. No configuration needed.

External Mode

Point to your kubeconfig:

export KUBECONFIG=/path/to/kubeconfig

Or in the config file:

kubernetes:
kubeconfig: /path/to/kubeconfig

Informer Cache

KubeVision uses Kubernetes Informers to cache frequently accessed resources for sub-millisecond reads:

Cached resources (8): Pods, Deployments, StatefulSets, DaemonSets, Services, Ingresses, Nodes, Namespaces

On-demand resources (18+): Jobs, CronJobs, ConfigMaps, PVs, PVCs, etc.

Never cached: Secrets (security), Events (volume)

The informer_resync setting controls how often the cache is fully re-synced with the API Server.