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
| #!/bin/bash -e | |
| # Usage ./k8s-service-account-kubeconfig.sh ( namespace ) ( service account name ) | |
| TEMPDIR=$( mktemp -d ) | |
| trap "{ rm -rf $TEMPDIR ; exit 255; }" EXIT | |
| SA_SECRET=$( kubectl get sa -n $1 $2 -o jsonpath='{.secrets[0].name}' ) |
| #!/usr/bin/perl | |
| use Cwd; | |
| use File::Path; | |
| my $tree = $ARGV[0]; | |
| sub saw ($) { | |
| my($leaf) = @_; | |
| my $cwd = getcwd; |
| OpenSSL: | |
| ./openssl s_client -connect google.com:443 -CAfile /etc/ssl/certs/ca-bundle.crt -tls1_2 | |
| CONNECTED(00000003) | |
| 139935467882144:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:s3_pkt.c:340: | |
| Ruby: | |
| require 'socket' | |
| require 'openssl' |