Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcdelacruz/e00c18c5cf8fc59a8d4394796506f7ce to your computer and use it in GitHub Desktop.
Save rcdelacruz/e00c18c5cf8fc59a8d4394796506f7ce to your computer and use it in GitHub Desktop.
Simple bash script to cleanup the Cluster Metrics components from openshift-infra project
#!/bin/bash
echo -e "\n --- \n deleting project objects... \n --- \n"
oc project openshift-infra
for i in $(oc get secret | egrep "(hawkular|heapster|metrics)" | awk '{ print $1 }'); \
do
oc delete secret $i; \
done
oc delete rc hawkular-metrics heapster hawkular-cassandra-1
oc delete svc \
hawkular-cassandra \
hawkular-cassandra-nodes \
hawkular-metrics heapster
oc delete route hawkular-metrics
oc delete sa cassandra hawkular heapster metrics-deployer
oc delete template \
hawkular-cassandra-node-emptydir \
hawkular-cassandra-node-pv \
hawkular-cassandra-services \
hawkular-heapster hawkular-metrics \
hawkular-support
oc delete pvc metrics-cassandra-1
echo -e "\n --- \n finish! \n --- \n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment