ktx

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

ktx

English | 简体中文

ktx is an easy-to-use command line tool for kubernetes multi-cluster context management.

Installation

  • Install with go install
go install -u github.com/poneding/ktx@latest
  • Install from binary

For MacOS or Linux:

curl -sSL https://github.com/poneding/ktx/raw/master/install.sh | sh

For Windows:

Download the lastest executable from Releases and add it to the PATH.

Usage

  1. Add cluster context
ktx add -f .kube/kind-cluster-01
ktx add -f .kube/kind-cluster-02
  1. List cluster contexts
ktx list

Alias: ktx ls

  1. Switch cluster context
# Switch to specified cluster context
ktx switch kind-cluster-01

# Interactive switch
ktx switch

Alias: ktx s

  1. Rename cluster context
# Rename specified cluster context
ktx rename kind-cluster-01

# Interactive rename
ktx rename
  1. Remove cluster context
# Remove specified cluster context
ktx remove kind-cluster-01

# Interactive remove
ktx remove

Alias: ktx rm

  1. Export cluster context
ktx export kind-cluster-01 -f .kube/export-01
  1. Generate kubeconfig from ServiceAccount
ktx generate --service-account default -f .kube/my-gen-config

Alias: ktx gen

Documentation

Overview

Copyright © 2025 Pone Ding <poneding@gmail.com>

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL