Skip to content

zhangweiqaz/go_pod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

just to execute the command: kubectl exec -it podName [-c ContainerName] [-n NameSpace] -- su - userName

Install

Download the binary file kubectl-go, and put into /usr/local/bin. It means that command must exist in your PATH.

Usage

kubectl go podName [-c ContainerName] [-n NameSpace] [-u UserName]

kubectl go -h
kubectl exec in pod with username. For example:
kubectl go pod_name

Usage:
  go [flags]

Flags:
  -c, --containerName string   containerName
  -h, --help                   help for go
  -n, --namespace string       namespace
  -u, --username string        username, this user must exist in image, default: dev

Attention

  • the user must exist in the image, you can add "RUN useradd dev" to create one
  • su must exist in the image
  • the image default user have permisson to su to other user, we are using root

About

kubectl exec -it with specific system user

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages