Configuration
Customize KubeGraf with themes, keybindings, default settings, and plugin configuration.
Configuration File
KubeGraf looks for configuration in the following locations (in order):
$KUBEGRAF_CONFIGenvironment variable~/.config/kubegraf/config.yaml~/.kubegraf.yaml
Creating a Config File
Generate a default configuration file:
kubegraf config init
This creates ~/.config/kubegraf/config.yaml with all available options.
Full Configuration Reference
# ~/.config/kubegraf/config.yaml
# General settings
general:
# Default namespace (empty = use kubeconfig default)
defaultNamespace: ""
# Refresh interval in seconds
refreshInterval: 5
# Editor for editing resources (defaults to $EDITOR)
editor: "vim"
# Log file location
logFile: "~/.config/kubegraf/kubegraf.log"
# Log level: debug, info, warn, error
logLevel: "info"
# Terminal UI settings
tui:
# Theme: dark, light, dracula, nord, monokai
theme: "dark"
# Show resource counts in tabs
showCounts: true
# Enable mouse support
mouse: true
# Confirm before destructive actions
confirmDelete: true
# Number of log lines to fetch by default
logLines: 100
# Web dashboard settings
web:
# Default port
port: 8080
# Default host
host: "localhost"
# Theme: dark, light, system
theme: "system"
# Enable CORS (for embedding)
cors: false
# Session timeout in minutes
sessionTimeout: 60
# Keybindings (TUI)
keybindings:
# Navigation
moveDown: "j"
moveUp: "k"
pageDown: "ctrl+d"
pageUp: "ctrl+u"
top: "g"
bottom: "G"
# Actions
view: "enter"
logs: "l"
shell: "s"
describe: "d"
edit: "e"
delete: "delete"
yank: "y"
# Tabs
nextTab: "tab"
prevTab: "shift+tab"
# Other
search: "/"
namespace: "n"
context: "c"
refresh: "r"
help: "?"
quit: "q"
# Resource display columns
columns:
pods:
- name
- namespace
- ready
- status
- restarts
- age
deployments:
- name
- namespace
- ready
- upToDate
- available
- age
services:
- name
- namespace
- type
- clusterIP
- ports
- age
# Plugins
plugins:
# Enable/disable plugins
enabled:
- helm
- argocd
# Plugin-specific configuration
helm:
# Helm binary path
binary: "helm"
argocd:
# ArgoCD server URL
server: ""
# Use grpc-web
grpcWeb: true
# Favorites / Bookmarks
favorites:
- context: production
namespace: default
resource: deployments
- context: staging
namespace: monitoring
resource: pods
# Aliases for quick commands
aliases:
p: "pods"
d: "deployments"
s: "services"
n: "nodes"
Themes
KubeGraf includes several built-in themes:
| Theme | Description |
|---|---|
dark | Default dark theme with blue accents |
light | Light theme for bright environments |
dracula | Popular dark theme with purple accents |
nord | Arctic, bluish color palette |
monokai | Classic Monokai colors |
Setting Theme
# Via config file
tui:
theme: "dracula"
# Via command line
kubegraf --theme dracula
# Via environment variable
export KUBEGRAF_THEME=dracula
Custom Keybindings
Override any keybinding in the config file:
keybindings:
# Use arrow keys instead of vim keys
moveDown: "down"
moveUp: "up"
# Change logs key to 'o' for "output"
logs: "o"
# Use ctrl+x for delete
delete: "ctrl+x"
Available Keys
- Single characters:
a,b,1,/,? - Special keys:
enter,tab,space,delete,backspace,esc - Arrow keys:
up,down,left,right - Function keys:
f1-f12 - Modifiers:
ctrl+x,shift+x,alt+x
Environment Variables
KubeGraf respects these environment variables:
| Variable | Description |
|---|---|
KUBEGRAF_CONFIG | Path to config file |
KUBEGRAF_THEME | UI theme |
KUBEGRAF_LOG_LEVEL | Log verbosity |
KUBECONFIG | Path to kubeconfig (standard) |
EDITOR | Editor for resource editing |
Column Customization
Customize which columns appear for each resource type:
columns:
pods:
- name
- namespace
- ready
- status
- restarts
- node # Add node column
- age
- cpu # Add CPU usage
- memory # Add memory usage
Available Columns by Resource
Pods: name, namespace, ready, status, restarts, age, node, ip, cpu, memory, qos
Deployments: name, namespace, ready, upToDate, available, age, strategy, images
Services: name, namespace, type, clusterIP, externalIP, ports, age, selector
Nodes: name, status, roles, age, version, internalIP, os, kernel
Favorites
Define bookmarks for quick access to frequently used views:
favorites:
- name: "Prod Deployments"
context: production
namespace: default
resource: deployments
- name: "Monitoring Pods"
context: production
namespace: monitoring
resource: pods
filter: "prometheus"
Access favorites in the TUI with F or through the web dashboard sidebar.
Tip: Run kubegraf config validate to check your configuration for errors.
Resetting Configuration
# Reset to defaults
kubegraf config reset
# Show current configuration
kubegraf config show
# Open config in editor
kubegraf config edit