Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.17 KB

14_cheatsheet.md

File metadata and controls

27 lines (18 loc) · 1.17 KB

Cheatsheet

This is a placeholder to work with the students and determine what they find valuable in this sheet.

Deleting your lab

WARNING: You should ALWAYS validate the output before using oc delete. You can do that by replacing oc delete with oc get, or if using with xargs prefix with echo.

WARNING: Always double check, and triple check before running oc delete!!!

WARNING: Be very careful when copying and pasting directly into a terminal!!!

# List/validate resources to be deleted by labels
oc -n [-tools] get all -l build=rocketchat-[username]

# Delete by labels
oc -n [-tools] delete all -l build=rocketchat-[username]

# List/validate resources to be deleted by get+grep+delete
oc -n [-dev] get all,pvc,secret,configmap -o name --no-headers | grep -i -F -e '-[username]'

# Delete resources by using get+grep+delete
oc -n [-dev] get all -o name --no-headers | grep -i -F -e '-[username]' | xargs -I {} oc  -n [-dev] delete '{}'

# Delete data/unrecoverable resources (not covered by 'all') by using get+grep+delete
oc -n [-dev] get pvc,secret,configmap -o name --no-headers | grep -i -F -e '-[username]' | xargs -I {} oc -n [-dev] delete '{}'