/ncp-flat-kubeconfig

Flat kubeconfig for NKS(Naver Kubernetes Service)

Primary LanguageShellApache License 2.0Apache-2.0

ncp-flat-kubeconfig: Flat kubeconfig for NKS

version Proudly written in Bash License

ncp-flat-kubeconfig DEMO

ncp-flat-kubeconfig-demo GIF


Prerequisite

Yaml Parser(yq)

Environment

Support only NKS(Naver Kubernetes Serivce)

Purpose

NKS's kubeconfig name is duplicated. And it doesn't support to flat kubeconfig function yet. Thus use to flat and rename the kubeconfig.

Usage

kubeconfig.yaml is hard coded due to it fixed If it needs, I will change it.

$ ncp-flat-kubeconfig 
successfully flatting NKS's kubeconfig

Check

$ kubectl config get-contexts
CURRENT   | NAME       | CLUSTER     | AUTHINFO         | NAMESPACE
----      | ----       | ----        | ----             |  ----
*         | nks        | kubernetes  | kubernetes-admin |
          | nks-0346   | nks-KR-0346 | nks-user         | 

Installation

One time runner

kubeconfig.yaml must be in a same folder

curl https://raw.githubusercontent.com/sysnet4admin/ncp-flat-kubeconfig/main/ncp-flat-kubeconfig | bash

Installation (macOS and Linux)

curl https://raw.githubusercontent.com/sysnet4admin/ncp-flat-kubeconfig/main/install | bash