Skip to content
Extract relevant sections of KUBECONFIG based on target context name into full fledged config
Crystal Makefile Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Dockerfile
LICENSE
Makefile
README.md
VERSION

README.md

kubeconfig-context-extractor

Kubeconfig-context-extractor extracts sections of KUBECONFIG file based on selected context.

Since context includes cluster, and user name, extracting all relevant sections allows creating fully working KUBECONFIG for selected context.

Usage

CLI

Usage: kce [arguments]
    -k PATH, --kubeconfig=PATH       Path to kubeconfig file, defaults to KUBECONFIG env value,
                                     if present, otherwise ~/.kube/config
    -c NAME, --context=NAME          Context to extract config for
    -h, --help                       Show this help
    -v, --version                    Display version

Class

require "./kce.cr"

kce = KCE.new(targetContext: "dev-cluster1")
puts "KUBECONFIG: #{kce.kubeConfig}"
puts "Target Context: #{kce.targetContext}"

puts "## KCE"
puts kce.inspect

puts "## Config"
puts kce.config

Install

Get latest release from Releases page.

Build

make all
You can’t perform that action at this time.