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
import io | |
import selectors | |
import subprocess | |
import sys | |
def capture_subprocess_output(subprocess_args): | |
# Start subprocess | |
# bufsize = 1 means output is line buffered | |
# universal_newlines = True is required for line buffering | |
process = subprocess.Popen(subprocess_args, |
# -*- coding: utf-8 -*- | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.x509.oid import NameOID | |
import datetime | |
import uuid |
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g') | |
echo $PACKAGE_VERSION |
autopy - simple, cross-platform GUI automation toolkit. MIT - https://github.com/msanders/autopy/