Skip to content

wiredquill/k8s-tmux

Repository files navigation

K8s-TMux Terminal

A Kubernetes-deployed web-based terminal application for long-running tmux sessions, specifically designed for AI model interactions like Claude. Features persistent sessions, remote notifications, file transfer, and a customizable web UI.

✨ Features

  • 🎯 Persistent TMux Sessions - Shared sessions that survive browser disconnections
  • πŸ“‘ Remote Mode - Push notifications via ntfy.sh for AI interactions
  • 🌈 Customizable UI - Configurable colors, titles, and themes
  • πŸ“ File Transfer - Drag-and-drop upload/download functionality
  • πŸ”§ Pre-installed Tools - kubectl, helm, k9s, btop, gh, kubectx, and more
  • 🎨 Web Terminal - Browser-based access with full color support
  • πŸ’Ύ NFS Storage - Persistent data storage across pod restarts
  • βš™οΈ Configuration UI - Easy setup of NTFY servers and topics

πŸš€ Quick Start

Prerequisites

  • Kubernetes cluster with LoadBalancer support
  • NFS server accessible at 10.0.0.10 with paths:
    • /volume1/k8s/k8s-tmux
    • /volume1/WiredQuill

Deploy Production Terminal

kubectl apply -f deployments/prod/enhanced-terminal.yaml

Access the terminal at the assigned LoadBalancer IP on port 80.

πŸ“‹ Repository Structure

k8s-tmux/
β”œβ”€β”€ deployments/
β”‚   β”œβ”€β”€ prod/           # Production-ready deployments
β”‚   β”‚   β”œβ”€β”€ enhanced-terminal.yaml    # Full-featured terminal with UI
β”‚   β”‚   └── production-terminal.yaml  # Production terminal with secrets
β”‚   └── dev/            # Development and test deployments
β”œβ”€β”€ scripts/            # Build and utility scripts
β”‚   β”œβ”€β”€ build.sh       # Container build script (uses wq-prod buildkit)
β”‚   β”œβ”€β”€ claude-build.sh # Claude-specific build script
β”‚   └── check-actions.sh # GitHub Actions checker
β”œβ”€β”€ config/             # Configuration files
β”‚   β”œβ”€β”€ automation-config.js  # Terminal automation
β”‚   β”œβ”€β”€ remote-mode-script.sh # Remote mode functionality
β”‚   β”œβ”€β”€ tmux.conf      # TMux configuration
β”‚   └── init.sh        # Container initialization
β”œβ”€β”€ charts/             # Helm charts
β”‚   └── k8s-tmux/      # Main Helm chart
└── docs/              # Documentation

πŸ› οΈ Configuration

Remote Mode Setup

  1. Click the βš™οΈ Config button in the terminal UI
  2. Configure your NTFY server and topic:
    • Server: https://ntfy.wiredquill.com (or your server)
    • Topic: ai_communication (or custom topic)
  3. Click Save Configuration
  4. Use πŸ“‘ Remote button to toggle remote mode

Session Customization

  • Title: Set a custom session title for identification
  • Colors: Choose from 7 color themes (Green, Red, Blue, Yellow, Purple, Cyan, Orange)
  • Border: Colored border wraps the entire application for easy session identification

File Management

  • Upload: Drag files to the terminal or use the πŸ“€ Upload button
  • Download: Use πŸ“₯ Download button and enter filename
  • Files are stored in /mnt/k8s-tmux/ within the container

πŸ”§ Advanced Usage

Building Custom Images

# Uses wq-prod cluster buildkit service
./scripts/build.sh

Secrets Management

For GitHub CLI and Claude Code authentication:

# GitHub token
kubectl create secret generic github-secrets \
  --from-literal=github-token=YOUR_TOKEN -n k8s-tmux

# Claude API key  
kubectl create secret generic claude-secrets \
  --from-literal=claude-api-key=YOUR_KEY -n k8s-tmux

Helm Deployment

helm install k8s-tmux ./charts/k8s-tmux \
  --namespace k8s-tmux \
  --create-namespace

πŸ” Troubleshooting

Pod Not Starting

kubectl get pods -n k8s-tmux
kubectl logs -n k8s-tmux <pod-name>

Storage Issues

Ensure NFS server is accessible and paths exist:

showmount -e 10.0.0.10

Remote Mode Not Working

Check NTFY configuration in the Config panel and verify server accessibility.

πŸ›‘οΈ Security Features

  • Secrets Integration - Kubernetes secrets for API keys
  • Network Policies - Optional network isolation
  • RBAC Support - Role-based access control ready
  • Non-root Options - Configurable user execution

πŸ“ Development

Testing Locally

# Quick development deployment
kubectl apply -f deployments/dev/simple-working-terminal.yaml

Contributing

  1. Create feature branch
  2. Test with development deployments
  3. Update documentation
  4. Submit pull request

🎯 Use Cases

  • AI Development - Long-running sessions for Claude/ChatGPT interactions
  • Kubernetes Management - Pre-configured kubectl, helm, k9s access
  • Remote Collaboration - Shared tmux sessions with notifications
  • DevOps Workflows - Persistent development environment
  • Multi-Environment Management - Color-coded session identification

πŸ“ž Support

  • Issues: GitHub Issues
  • Notifications: Configure ntfy.sh for real-time updates
  • Remote Mode: Enable for AI interaction notifications

Built for AI-enhanced development workflows πŸ€–βœ¨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •