Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Kedastral TUI

A terminal user interface (TUI) for monitoring Kedastral forecaster and scaler services.

Features

  • πŸš€ Interactive Setup: First-run wizard to configure connection settings
  • πŸ“Š Live Monitoring: Real-time updates of forecast and scaler status
  • ⏸️ Pause/Resume: Toggle between live and paused modes
  • πŸ”„ Manual Refresh: Force refresh on demand
  • πŸ“ Config File: Persistent configuration in ~/.config/kedastral-tui/config.json

Installation

Pre-built Binaries (Recommended)

Download the latest release for your platform from the releases page.

Linux (amd64)

wget https://github.com/HatiCode/kedastral-tui/releases/latest/download/kedastral-tui-<version>-linux-amd64.tar.gz
tar -xzf kedastral-tui-<version>-linux-amd64.tar.gz
chmod +x kedastral-tui
sudo mv kedastral-tui /usr/local/bin/

macOS (Apple Silicon)

wget https://github.com/HatiCode/kedastral-tui/releases/latest/download/kedastral-tui-<version>-darwin-arm64.tar.gz
tar -xzf kedastral-tui-<version>-darwin-arm64.tar.gz
chmod +x kedastral-tui
sudo mv kedastral-tui /usr/local/bin/

From Source

git clone https://github.com/HatiCode/kedastral-tui.git
cd kedastral-tui
make build

The binary will be created at bin/kedastral-tui.

Usage

First Run

On first launch (or if no config exists), you'll be guided through an interactive setup:

./bin/kedastral-tui

The wizard will ask for:

  1. Forecaster URL (e.g., http://localhost:8081)
  2. Scaler URL (default: http://localhost:8082)
  3. Workload name (e.g., test-app)

Configuration is saved to ~/.config/kedastral-tui/config.json.

Subsequent Runs

After setup, simply run:

./bin/kedastral-tui

Or with custom settings:

./bin/kedastral-tui --forecaster-url=http://kedastral-forecaster:8081 --workload=my-app

Keyboard Controls

  • SPACE: Toggle between live and paused modes
  • R: Manual refresh (fetch latest data)
  • H: Toggle help screen
  • Q or Ctrl+C: Quit

Configuration

Configuration priority (highest to lowest):

  1. Command-line flags
  2. Environment variables
  3. Config file (~/.config/kedastral-tui/config.json)
  4. Defaults

Command-line Flags

--forecaster-url    Forecaster HTTP URL (required)
--scaler-url        Scaler HTTP URL (default: http://localhost:8082)
--workload          Workload name to monitor (required)
--refresh-interval  Refresh interval in live mode (default: 5s)
--lead-time         Lead time for replica selection (default: 5m)
--log-level         Log level: debug, info, warn, error (default: error)
--version           Print version and exit

Environment Variables

export FORECASTER_URL=http://localhost:8081
export SCALER_URL=http://localhost:8082
export WORKLOAD=test-app
export REFRESH_INTERVAL=5s
export LEAD_TIME=5m

Config File

Location: ~/.config/kedastral-tui/config.json

Example:

{
  "forecaster_url": "http://localhost:8081",
  "scaler_url": "http://localhost:8082",
  "workload": "test-app"
}

Development

Build

make build

Run

make run

Clean

make clean

Format

make fmt

Test

make test

Features in Detail

πŸ“Š Visual Components

  • Status Bar: Real-time connection health, forecast age, mode indicator
  • Forecast Chart: ASCII line chart showing predicted metric values over the horizon
  • Replica Table: Detailed scaling decisions with lead time highlighting
  • Scaler Status: Active/inactive state and current replica count
  • Help Screen: Press H for keyboard shortcuts and panel descriptions

βš™οΈ Functionality

  • Interactive Setup: First-run wizard saves configuration automatically
  • Live Monitoring: Auto-refresh every 5s (configurable)
  • Pause Mode: Freeze updates to inspect current state
  • Manual Refresh: Force data fetch with R key
  • Multi-source Config: File β†’ Env vars β†’ Flags precedence

Screenshots

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Kedastral Monitor - workload: test-app  [LIVE]  Last: 2s agoβ”‚
β”‚ Status: Forecaster βœ“  Scaler βœ“  Forecast age: 3s            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ FORECAST TIMELINE (next 30min)                              β”‚
β”‚                                                              β”‚
β”‚ RPS                                                          β”‚
β”‚ 220 ─     ●●●                                                β”‚
β”‚ 180 ─   ●●   ●●      ●●●                                     β”‚
β”‚ 140 ─ ●●       ●●●●●●   ●●                                   β”‚
β”‚ 100 ─●                    ●●                                 β”‚
β”‚     └──────────────────────────────────────────────────────  β”‚
β”‚      Now                                            +30m     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ REPLICA SCALING DECISIONS                                    β”‚
β”‚                                                              β”‚
β”‚ Time        Forecast      Desired   Selected                β”‚
β”‚ ───────────────────────────────────────────────────────────  β”‚
β”‚ Now         36.2 rps      2                                  β”‚
β”‚ +5min       180.5 rps     3         ← SELECTED (lead=5m)    β”‚
β”‚ +10min      220.3 rps     3                                  β”‚
β”‚ ...                                                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ SCALER STATUS                                                β”‚
β”‚ Active: βœ“  Desired replicas: 3  Forecast age seen: 2.1s     β”‚
β”‚                                                              β”‚
β”‚ [SPACE] pause  [R] refresh  [H] help  [Q] quit              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architecture

kedastral-tui/
β”œβ”€β”€ main.go              # Entry point with version support
β”œβ”€β”€ config/
β”‚   └── config.go        # Multi-source configuration management
β”œβ”€β”€ client/
β”‚   └── client.go        # HTTP client for forecaster/scaler APIs
β”œβ”€β”€ ui/
β”‚   β”œβ”€β”€ model.go         # Bubble Tea model (state management)
β”‚   β”œβ”€β”€ update.go        # Event handling and async updates
β”‚   β”œβ”€β”€ view.go          # Main view rendering
β”‚   β”œβ”€β”€ messages.go      # Custom Bubble Tea messages
β”‚   └── setup.go         # Interactive setup wizard
└── components/          # Reusable UI components
    β”œβ”€β”€ status_bar.go    # Status bar with health indicators
    β”œβ”€β”€ forecast_chart.go # ASCII line chart renderer
    β”œβ”€β”€ replica_table.go  # Replica scaling decisions table
    └── help.go           # Help screen component

CI/CD

This project uses GitHub Actions for:

  • Continuous Integration: Automated testing and linting on every push
  • Releases: Automatic binary builds for Linux, macOS, and Windows on tagged releases
  • Security: Weekly security scans with Gosec

To create a release:

git tag v0.1.0
git push origin v0.1.0

License

See LICENSE file.

About

Beautiful terminal UI for monitoring Kedastral predictive autoscaling. Watch forecasts, replica decisions, and scaling events in real-time from your terminal.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages