Skip to content

A kubectl plugin that show a kubeconfig to access the apiserver with a specified serviceaccount.

License

Notifications You must be signed in to change notification settings

qinqi01/kubectl-view-serviceaccount-kubeconfig-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl plugin view-serviceaccount-kubeconfig SERVICEACCOUNT

This is a kubectl plugin that show a kubeconfig to access the apiserver with a specified serviceaccount.

Usage:
  kubectl view-serviceaccount-kubeconfig SERVICEACCOUNT [options] [flags]

Examples:
  # Show a kubeconfig setting of serviceaccount/default
  kubectl view-serviceaccount-kubeconfig default
  
  # Show a kubeconfig setting of serviceaccount/bot in namespace/kube-system
  kubectl view-serviceaccount-kubeconfig bot -n kube-system

  # Show a kubeconfig setting of serviceaccount/default in JSON format
  kubectl view-serviceaccount-kubeconfig default -o json

Try the plugin

# create a serviceaccount/bot in namepace/default
$ kubectl create serviceaccount bot

# save a kubeconfig setting of serviceaccount/bot
$ kubectl view-serviceaccount-kubeconfig bot > ./kubeconfig

# list pods as serviceaccount/bot from outside of kubernetes cluster
$ kubectl get pods --kubeconfig=./kubeconfig

Install the plugin

  1. Install krew that is a plugin manager for kubectl.

  2. Run:

     kubectl krew install view-serviceaccount-kubeconfig
    
  3. Try it out:

     kubectl view-serviceaccount-kubeconfig default
    

License

This software is released under the MIT License.

About

A kubectl plugin that show a kubeconfig to access the apiserver with a specified serviceaccount.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 80.8%
  • Makefile 19.2%