Skip to content

Instantly share code, notes, and snippets.

@joshy91
Created July 13, 2018 21:12
Show Gist options
  • Save joshy91/40fa82a4a356854ce8d4269360c03629 to your computer and use it in GitHub Desktop.
Save joshy91/40fa82a4a356854ce8d4269360c03629 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Status of pods where app=nginx
kubectl get pods -l app=nginx
#Give an nginx pod a label “test=sure”
kubectl label pod nginx-deployment-6fdbb596db-2s2tp test=sure
#Detailed description of pod with label “test=sure”
kubectl describe pod -l test=sure
#Give all pods where app=nginx a label “tier=frontend”
kubectl label pods -l app=nginx tier=frontend
kubectl delete pod -l test=sure
#New node pops up
kubectl get pods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment