Skip to content

Instantly share code, notes, and snippets.

View FINCTIVE's full-sized avatar
🐣
Learning

FINCTIVE FINCTIVE

🐣
Learning
View GitHub Profile
@FINCTIVE
FINCTIVE / merge_kubeconfig_files.fish
Last active February 25, 2022 07:35
Merge multiple kubeconfig files, fish shell script
# in order to use kubectx! (https://github.com/ahmetb/kubectx)
# Merge all kubeconfig files inside working directory
function merge_kubeconfig_files
# concatenate file names with ':'
# file1.conf:file2.conf:file3.conf
set -x KUBECONFIG (string join ':' *.conf)
kubectl config view --merge --flatten > merged_kubeconfig
set -e KUBECONFIG
mv merged_kubeconfig ~/.kube/config