Skip to content

사용자가 생성한 SA와 Secret을 바탕으로 kubeconfig를 생성합니다.

License

Notifications You must be signed in to change notification settings

Seo-yul/kubeconfig-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubeconfig-generator

사용자가 생성한 SA와 Secret을 바탕으로 YAML 또는 JSON 형식의 kubeconfig 파일을 생성합니다.

Prerequisites

  • go >= 1.20
  • kubectl
  • kubernetes cluster 와 접근 권한이 있는 kubeconfig

Usage

# zsh
git clone https://github.com/Seo-yul/kubeconfig-generator.git -o kubeconfig-generator
cd kubeconfig-generator
go mod tidy
go build -o kubectl-make-kubeconfig
cp kubectl-make-kubeconfig /usr/local/bin

kubectl make kubeconfig --service-account <service-account-name> [--namespace <namespace>]

Help

# zsh
kubectl make kubeconfig --help

  -n string
    	Service Account Namespace (default "default")
  -namespace string
    	Service Account Namespace (default "default")
  -o string
    	Output Type (default "yaml")
  -output string
    	Output Type (default "yaml")
  -sa string
    	Service Account Name
  -service-account string
    	Service Account Name

Output

Config File Name: SERVICE_ACCOUNT_NAME[-count]

If you create Secret
Secret Name: SERVICE_ACCOUNT_NAME-secret-RANDOM_STRING

About

사용자가 생성한 SA와 Secret을 바탕으로 kubeconfig를 생성합니다.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages