Skip to content

Bash script to help searching in k8 pods using kubectl.

Notifications You must be signed in to change notification settings

jango89/k8-helper-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to make it effective using bash#

Add alias kl="{path to the script} to either .bash or .zshrc.
Add alias kc="{path to the script} to either .bash or .zshrc.
Add alias kd="{path to the script} to either .bash or .zshrc.
Add alias ki="{path to the script} to either .bash or .zshrc.
Add alias klf="{path to the script} to either .bash or .zshrc. Run source .bash or source .zshrc.

Run export KUBECONFIG=$KUBECONFIG:$HOME/.kube/kubeconfig.yaml to export configs.

Prints logs in console

Switch contexts in k8

# kc {environment}

Switch namespace in k8

# kc {environment} {namespace}

Prints logs live from pod

# klf {deployment-name}

# kl {servicename} {last n lines from logs} {search by this word in logs}.

# kl {servicename} 0 {search by this word in whole logs}.

Prints ingress details in console

# kl {servicename}

Prints deployment details in console

# kd {servicename}

About

Bash script to help searching in k8 pods using kubectl.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages