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
auth:
jwt_secret: "" # auto-generated if empty
access_token_ttl: 15m
refresh_token_ttl: 168h # 7 days
kubernetes:
kubeconfig: "" # empty = in-cluster mode
informer_resync: 30m
Environment Variables
All settings can be overridden via environment variables:
| Variable | Description | Default |
|---|---|---|
KUBEVISION_SERVER_PORT | HTTP port | 8080 |
KUBEVISION_DB_DRIVER | Database driver (sqlite or postgres) | sqlite |
KUBEVISION_DB_DSN | Database connection string | kubevision.db |
KUBEVISION_JWT_SECRET | JWT signing secret | auto-generated |
KUBEVISION_ACCESS_TOKEN_TTL | Access token lifetime | 15m |
KUBEVISION_REFRESH_TOKEN_TTL | Refresh token lifetime | 168h |
KUBECONFIG | Path to kubeconfig file | in-cluster |
KUBEVISION_INFORMER_RESYNC | Informer resync period | 30m |
KUBEVISION_ALLOWED_ORIGINS | WebSocket origin whitelist (comma-separated) | * |
Database
SQLite (Development)
Default configuration, zero setup:
database:
driver: sqlite
dsn: kubevision.db
PostgreSQL (Production)
database:
driver: postgres
dsn: "host=localhost port=5432 user=kubevision password=secret dbname=kubevision sslmode=disable"
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"
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.