kx

Changes KUBECONFIG environment variable in the current shell

Installation

You can either download compiled binary from releases to a directory in you $PATH or run cargo install kx and compile it yourself. Binaries in releases are build using musl toolchain, therefore they have no external dependencies (not even libc).

Prerequisites

Usage

$ kx

if you get this error: Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf ptrace: Operation not permitted. you might need: ```bash

until restart:

sudo sysctl -w kernel.yama.ptrace_scope=0

permanently:

sudo sed -i 's/kernel.yama.ptracescope = 1/kernel.yama.ptracescope = 0/' /etc/sysctl.d/10-ptrace.conf ``` more info: https://linux-audit.com/protect-ptrace-processes-kernel-yama-ptrace_scope/

Configuration

Config file format

json { "search_dir": "/path/to/dir/with/cubeconfigs" }