clean_old_namespace.yaml 847 B

1234567891011121314151617
  1. ---
  2. - name: remove metrics components on {{ openshift_metrics_old_project }}
  3. command: >
  4. {{ openshift_client_binary }} -n {{ openshift_metrics_old_project }} --config={{ mktemp.stdout }}/admin.kubeconfig
  5. delete --ignore-not-found --selector=metrics-infra
  6. all,sa,secrets,templates,routes,pvc,rolebindings,clusterrolebindings,clusterrole
  7. register: delete_metrics
  8. changed_when: delete_metrics.stdout != 'No resources found'
  9. - name: remove rolebindings on {{ openshift_metrics_old_project }}
  10. command: >
  11. {{ openshift_client_binary }} -n {{ openshift_metrics_old_project }} --config={{ mktemp.stdout }}/admin.kubeconfig
  12. delete --ignore-not-found
  13. rolebinding/hawkular-view
  14. clusterrolebinding/heapster-cluster-reader
  15. clusterrolebinding/hawkular-metrics
  16. changed_when: delete_metrics.stdout != 'No resources found'