Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| ################################################################## | |
| # /etc/elasticsearch/elasticsearch.yml | |
| # | |
| # Base configuration for a write heavy cluster | |
| # | |
| # Cluster / Node Basics | |
| cluster.name: logng | |
| # Node can have abritrary attributes we can use for routing |
| function errexit() { | |
| local err=$? | |
| set +o xtrace | |
| local code="${1:-1}" | |
| echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
| # Print out the stack trace described by $function_stack | |
| if [ ${#FUNCNAME[@]} -gt 2 ] | |
| then | |
| echo "Call tree:" | |
| for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |
| function drips(){ | |
| docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /' | |
| } |
| 7003 gcloud compute instances list | |
| 7004 gcloud auth login | |
| 8152 gcloud compute instances stop instance-2 | |
| 8153 gcloud config set project dark-caldron-89709 | |
| 8154 gcloud components update | |
| 8155 gcloud compute instances stop instance-2 | |
| 8156 gcloud compute instances list | |
| 8157 gcloud compute instances start instance-2 | |
| 8189 gcloud compute forwarding-rules list | |
| 8190 gcloud compute networks describe default --format json |
| " _ _ " | |
| " _ /|| . . ||\ _ " | |
| " ( } \||D ' ' ' C||/ { % " | |
| " | /\__,=_[_] ' . . ' [_]_=,__/\ |" | |
| " |_\_ |----| |----| _/_|" | |
| " | |/ | | | | \| |" | |
| " | /_ | | | | _\ |" | |
| It is all fun and games until someone gets hacked! |
| === http status codes =================================================== | |
| 1xx Informational | |
| 100 Continue | |
| 101 Switching Protocols | |
| 102 Processing (WebDAV; RFC 2518) | |
| 2xx Success | |
| 200 OK | |
| 201 Created |
| ########################################## | |
| #### input | |
| ########################################## | |
| # syslog logging | |
| <source> | |
| type tail | |
| path /var/log/syslog, /var/log/auth.log, /var/log/kern.log | |
| pos_file /tmp/td-agent/pos/syslog | |
| refresh_interval 1 |
| # https://www.percona.com/blog/2008/11/07/poor-mans-query-logging/ | |
| tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e ' | |
| while(<>) { chomp; next if /^[^ ]+[ ]*$/; | |
| if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) { | |
| if (defined $q) { print "$q\n"; } | |
| $q=$_; | |
| } else { | |
| $_ =~ s/^[ \t]+//; $q.=" $_"; | |
| } |