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
apiVersion: "druid.apache.org/v1alpha1" | |
kind: "Druid" | |
metadata: | |
name: tiny-cluster | |
spec: | |
image: apache/druid:0.21.1 | |
# Optionally specify image for all nodes. Can be specify on nodes also | |
# imagePullSecrets: | |
# - name: tutu | |
startScript: /druid.sh |
#!/bin/bash | |
# Usage ./cleanup-k8s-terminating-namespace.sh <namespace> | |
NAMESPACE=$1 | |
echo Cleaning up namespace $1 | |
kubectl proxy & | |
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' > /tmp/temp.json |
#!/bin/sh | |
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d | |
# delete all evicted pods from all namespaces | |
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff state from all namespaces | |
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces |
#!/bin/bash -e | |
# Distro: Amazon Linux AMI release 2015.03 | |
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
# Builds the dependencies in parallel prior to starting FFmpeg build. | |
sudo yum update -y | |
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel yasm libogg libvorbis-devel libvpx-devel |