Skip to content

DelphicOkami/ek9s

Repository files navigation

ek9s

Test

Easy k9s - a terminal UI for quickly connecting to EKS clusters with k9s.

ek9s gives you a fuzzy-searchable list of your EKS clusters and connects you in one step, handling kubeconfig setup and k9s launch via aws-vault.

Prerequisites

Install

From GitHub Releases

Download the latest binary for your platform from the Releases page.

mv ek9s-<platform>-<arch> /usr/local/bin/ek9s
chmod +x /usr/local/bin/ek9s

macOS: removing the quarantine flag

macOS blocks unsigned binaries downloaded from the internet. After downloading, run:

xattr -d com.apple.quarantine /usr/local/bin/ek9s

From source

go build -o ek9s .
mv ek9s /usr/local/bin/

Usage

Select and connect to a cluster

ek9s                    # uses clusters.yaml from ek9s's config directory
ek9s /path/to/config.yaml

The default config directory follows the same pattern as k9s:

  • $XDG_CONFIG_HOME/ek9s/ if XDG_CONFIG_HOME is set
  • ~/Library/Application Support/ek9s/ on macOS
  • ~/.config/ek9s/ elsewhere

ek9s reads clusters.yaml and (optionally) read_only.skin.yaml / read_write.skin.yaml from this directory.

This opens an interactive selector powered by Bubble Tea:

  • Type / to filter clusters with fuzzy search
  • Enter to connect in readonly mode
  • Ctrl+W to connect in read-write mode

On selection, ek9s runs:

aws-vault exec <account> --region <region> -- aws eks update-kubeconfig --name <cluster>
aws-vault exec <account> --region <region> -- k9s [--readonly]

Scan for clusters

Automatically discover EKS clusters across all AWS profiles and regions:

ek9s scan

This parses ~/.aws/config for profiles, polls every EKS-supported region in parallel, and writes the results to clusters.yaml.

Scan flags

Flag Description
-o, --output <file> Output file (default: clusters.yaml)
-a, --account <regex> Filter AWS profiles by regex (non-matching profiles are skipped)
-r, --region <regex> Filter regions by regex (non-matching regions are skipped)
-c, --cluster <regex> Filter discovered cluster names by regex (non-matching are dropped)

Filters use partial matching with Go regex syntax.

Scan examples

# Scan only platform and data accounts, us-east regions
ek9s scan -a "(platform|data)" -r "us-east"

# Scan everything but only keep clusters matching "prod"
ek9s scan -c "prod"

# Scan dev accounts, write to a specific file
ek9s scan -a "dev" -o dev-clusters.yaml

Per-mode k9s skins

ek9s can apply a different k9s skin depending on the selected mode. Drop either or both of these files into ek9s's config directory (see Usage above for the path):

  • read_only.skin.yaml — applied when launching in readonly mode
  • read_write.skin.yaml — applied when launching in read-write mode

At launch, the matching file is copied into your k9s skins directory ($XDG_CONFIG_HOME/k9s/skins/ if set; otherwise ~/Library/Application Support/k9s/skins/ on macOS, ~/.config/k9s/skins/ elsewhere) as ek9s-readonly.yaml or ek9s-readwrite.yaml, and ek9s sets K9S_SKIN so k9s picks it up. If the file isn't present, k9s uses its default skin. See the k9s skins docs for the file format.

Config format

clusters:
  - account: "acme-platform-dev.AdministratorAccess"
    region: "us-east-2"
    cluster: "platform-dev-1"
  - account: "acme-platform-test.AdministratorAccess"
    region: "us-east-1"
    cluster: "platform-test-1"
    friendly_name: "platform test (us-east)" #Optional
    read_write_skin: "test-1_write.skin.yaml" #Optional specifies the skin to use for this cluster in read/write mode (overrides k9s config)
  - account: "acme-platform-prod.AdministratorAccess"
    region: "us-east-1"
    cluster: "platform-prod-1"
    friendly_name: "platform prod"
    read_write_skin: "prod-1_write.skin.yaml"
    read_only_skin: "prod-1_read.skin.yaml" #Optional specifies the skin to use for this cluster in read only mode (overrides k9s config)
Field Description
account AWS Vault profile name
region AWS region
cluster EKS cluster name
friendly_name Optional. Shown in the selector instead of cluster — useful when the same cluster name exists across multiple accounts.
read_only_skin Optional. Path to a k9s skin file used when launching this cluster in readonly mode. Absolute paths are used as-is; relative paths resolve against ek9s's config directory. Falls back to read_only.skin.yaml.
read_write_skin Optional. Same as above for read-write mode. Falls back to read_write.skin.yaml.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors