kubectl get pods -n cloudplex-system | grep $1- | awk '{print $1}'
kubectl delete po $( getpo $1 )
kubectl get pods -o=jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t\t\t"}{range .spec.containers[0]}{.image}{", "}{end}{end}' |\
sort
save it in a file klog
#!/bin/bash
LINES_IN=$2
LINES=${LINES_IN:-100}
kubectl get pods -n cloudplex-system -l app=$1 | grep -v NAME | awk '{print $1}' | xargs -I {} kubectl logs -f --tail=$LINES {} $1
run it as
klog <service-name> <number of lines | this is optional>
klog tarantula 100
save it in file kexec
#!/bin/bash
POD=$(kubectl get pods -n cloudplex-system -l app=$1 | grep -v NAME | awk '{print $1}')
kubectl exec -it $POD -c $1 bash
run it as
kexec <service-name>
kexec tarantula
links