Cheatsheets

k8s

  • Scale up all deployments in NS
    kubectl get deployment -o json | jq  -r '.items[] | .metadata.name ' | xargs -I{} kubectl scale {} --replicas=3
  • Show all resources in namespace
    kubectl api-resources -o name | xargs -I {} kubectl get {} --show-kind --ignore-not-found
  • Troubleshoot DNS resolution with infoblox tools
    kubectl run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools
  • port fwd with selector
    kubectl port-forward -n xxx "$(kubectl get -n xxx pod --selector=nginxhello=app -o jsonpath='{.items..metadata.name}')" 4040
    
    
    

Links

https://awesome-go.com/ – goLang goodies

Commands

  • Remove all comments from vim console
    g/\v^(#|$|;)/d