Advertisement
Javi

k8s: cli tips

Feb 25th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. # K8s tips
  2.  
  3. * Get the pods behind one service
  4.  
  5. ```
  6. kubectl get pods --show-labels | grep -F -f <(kubectl get svc --no-headers -o wide | awk '{print $7}')
  7. ```
  8.  
  9. * Patch the deployment with a dummy annotation to force the update (only works with alwayspull policies)
  10.  
  11. ```
  12. kubectl patch deployment $DEPNAME -p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"`date +'%s'`\"}}}}}"
  13. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement