kubectl explain
kubens/kubectx https://github.com/ahmetb/kubectx
kubecfg https://gist.github.com/caruccio/5c25ef92d7ad0f2e8d2e1b39c0271110
# curl -sL https://gist.github.com/caruccio/b9eb86e307ecc293d5b832af8c577605/raw/kubectl-setup.sh | bash | |
mkdir -p ~/bin ~/opt | |
if [ -d ~/opt/kubectx ]; then | |
cd ~/opt/kubectx | |
git pull | |
else | |
git clone https://github.com/ahmetb/kubectx ~/opt/kubectx | |
fi |
# Install: add this function to your ~/.bashrc or ~/.profile | |
# Open a new shell and use it: | |
# | |
# $ for_dir /tmp /home /var -- ls -la | |
# | |
function for_dir() | |
{ | |
local dirs=() |
#!/bin/bash | |
function download() | |
{ | |
KUBECTL_VERSIONS=( | |
$(curl -s "https://api.github.com/repos/kubernetes/kubernetes/releases?per_page=100" \ | |
| jq -r '.[] | .tag_name' \ | |
| grep '^v[0-9]\.[0-9][0-9]\?\.[0-9][0-9]\?$' \ | |
| sort -Vr \ | |
| awk -F . '!a[$1 FS $2]++' \ |
#!/usr/bin/env python | |
class TermSequence: | |
'''Reference: https://stackoverflow.com/a/33206814/1006369 | |
''' | |
sequence = [] | |
# standard 4-bit color codes | |
black = 30 | |
red = 31 |
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 -r '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" |