ktx

command module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 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.

demo

Installation

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

For MacOS or Linux:

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

For Windows:

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

Usage

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 contexts
ktx

# 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

  1. Set namespace
ktx set-namespace --namespace default
  1. Set Server address
ktx set-server --server https://api.k8s.local:6443

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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