Skip to content

jessesimpson36/helm-serial-getter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helm Serial Getter Plugin

A Helm v4 plugin that enables downloading Helm charts over serial/PTY connections. This plugin allows Helm to fetch charts using the serial:// protocol, useful for air-gapped environments or specialized deployment scenarios where traditional network connectivity is not available.

Features

  • Download Helm charts over serial/PTY connections
  • Base64 encoded chart transmission for reliability
  • Virtual serial port support using socat
  • Automatic retry mechanism for connection establishment
  • Compatible with Helm v4 downloader protocol

Installation

Prerequisites

  • Go 1.21 or later
  • socat utility (for virtual serial ports)
    # Ubuntu/Debian
    sudo apt-get install socat
    
    # RHEL/CentOS/Fedora
    sudo yum install socat

Install the Plugin

  1. Clone this repository:

    git clone <repository-url>
    cd helm-serial-getter
  2. Build and install the plugin:

    make build
    make install

This will build the binaries and install the plugin into your Helm installation.

Usage

Starting the Serial Chart Server

Before using the plugin, start the chart server that will serve charts over serial connections:

# Build and start the server
make serve

The server will:

  • Create virtual serial ports at /tmp/vserial1 and /tmp/vserial2
  • Listen for chart requests on these ports
  • Serve charts from the charts/ directory

Downloading Charts

Once the server is running, you can download charts using the serial:// protocol:

# Download a chart via serial connection
helm pull serial://tmp/vserial2/test-0.1.0.tgz

The URL format is: serial://path/to/pty/chartName.tgz

  • path/to/pty: Path to the serial/PTY device
  • chartName.tgz: Name of the chart file to download

Testing

Run the included test script to verify the plugin works correctly:

./test_serial.sh

Or use the Makefile target:

make test

How It Works

  1. Server Component (serve): Creates virtual serial port pairs using socat and listens for chart requests
  2. Client Component (client): Connects to serial ports, sends chart requests, and receives base64-encoded chart data
  3. Helm Integration: The plugin integrates with Helm's downloader protocol to handle serial:// URLs

Protocol

The communication protocol is simple:

  1. Client sends: GET helm-chart <chartname>
  2. Server responds with base64-encoded chart data followed by <<<EOF>>>
  3. Client decodes the data and outputs the chart to stdout

Development

Building

make build

Cleaning Up

make clean

This will stop running processes and clean up temporary files.

Project Structure

├── cmd/
│   ├── client/     # Helm plugin client (downloader)
│   └── serve/      # Chart server
├── charts/         # Sample charts for testing
├── plugin.yaml     # Helm plugin configuration
├── Makefile        # Build and development commands
└── test_serial.sh  # Integration test script

Configuration

The plugin is configured via plugin.yaml:

  • Protocol: serial
  • Command: ./client
  • Version: 0.0.1

Troubleshooting

Connection Issues

  • Ensure the server is running before attempting to download charts
  • Check that socat is installed and accessible
  • Verify the PTY path exists and is accessible
  • Check log files for detailed error information

Permission Issues

  • Ensure you have read/write permissions to the PTY devices
  • On some systems, you may need to be in the dialout group

Log Files

Both client and server components write detailed logs to log.txt for debugging purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published