kubectl explain
kubens/kubectx https://github.com/ahmetb/kubectx
kubecfg https://gist.github.com/caruccio/5c25ef92d7ad0f2e8d2e1b39c0271110
kubectl explain
kubens/kubectx https://github.com/ahmetb/kubectx
kubecfg https://gist.github.com/caruccio/5c25ef92d7ad0f2e8d2e1b39c0271110
$ cat kubectl-show_tls
#!/bin/bash
BIN_AWK=${0}.awk
command kubectl get secret -o json "$@" \
| jq 'select(.type="kubernetes.io/tls") | .data|.[]|values|@base64d' \
| xargs printf "%b" \
#!/bin/bash | |
usage() | |
{ | |
echo "Usage: kubectl show-secret [-n namespace] secret [...secret]" | |
exit | |
} | |
while [ $# -gt 0 ]; do | |
while getopts n: opt; do |
#!/bin/bash | |
# | |
# Install: | |
# $ echo 'source ~/bin/aws-assume-role' >> ~/.bashrc | |
# | |
# Usage: | |
# $ aws-assume-role [name] | |
# | |
# Prerequisite: | |
# Create an IAM role like this in the account you what access: |
#!/bin/bash | |
ContainerCreating=$(tput setaf 13) # magenta | |
Pending=$(tput setaf 3) # yellow | |
Running=$(tput setaf 2) # green | |
Error=$(tput setaf 1) # red | |
BackOf="$Error" | |
Terminating=$(tput setaf 8) # gray | |
Finished="$Terminating" | |
Completed="$Terminating" |
#!/bin/bash | |
function usage() | |
{ | |
echo Usage: $0 '[--cpu/-c|--memory/-m]' nodes... | |
echo Sort by memory is the default | |
exit ${1:-0} | |
} | |
node_names=() |
#!/bin/bash | |
kubectl api-resources --verbs=list -o name --namespaced=false | while read kind; do | |
echo -n "$kind: " | |
kubectl get --ignore-not-found -A $kind | wc -l | |
done 2>/dev/null | |
kubectl api-resources --verbs=list -o name --namespaced=true | while read kind; do | |
echo -n "$kind: " | |
kubectl get --ignore-not-found -A $kind | wc -l |
#!/bin/bash | |
function usage() | |
{ | |
echo Usage: $0 '[--namespace NS/-n NS] [--all/-a|POD...]' | |
exit $1 | |
} | |
all_pods=false | |
pod_names=() |
#!/bin/bash | |
## | |
## kubectl port-forward on selected services, combined by all service ports. | |
## | |
function kpfz() | |
{ | |
local svc_ports_command="jq -r '.items[] | | |
{ | |
name: .metadata.name, |