IBM Cloud Docs
Deleting webhooks from a cluster

Deleting webhooks from a cluster

Some troubleshooting and debugging steps might require you to temporarily remove certain webhooks from your cluster. Follow these steps to remove webhooks, then reapply them after you have resolved your issue.

  1. List the mutating webhooks in your cluster.

    oc get mutatingwebhookconfigurations
    
  2. For each mutating webhook, copy the component YAML file and delete the webhook.

    1. Run the command to copy the YAML file. Save the YAML file so you can reapply it later.

      oc get mutatingwebhookconfigurations <WEBHOOK-NAME> -o yaml > <WEBHOOK-NAME>.yml
      
    2. Delete the mutating webhook.

      oc delete mutatingwebhookconfigurations <WEBHOOK-NAME>
      
  3. List the validating webhooks in your cluster.

    oc get validatingwebhookconfigurations
    
  4. Identify any validating webhooks that are not included in the following list.

    • alertmanagerconfigs.openshift.io
    • managed-storage-validation-webhooks
    • multus.openshift.io
    • performance-addon-operator
    • prometheusrules.openshift.io
    • snapshot.storage.k8s.io

    Any validating webhook that is included in this list should not be deleted in the following steps.

  5. For each validating webhook that is not included in the previous list, copy the component YAML file and delete the webhook.

    1. Run the command to copy the YAML file. Save the YAML file so you can reapply it later.

      oc get validatingwebhookconfigurations <WEBHOOK-NAME> -o yaml > <WEBHOOK-NAME>.yml
      
    2. Delete the validating webhook.

      oc delete validatingwebhookconfigurations <WEBHOOK-NAME>
      
  6. When you are done troubleshooting your worker node issue, reapply the webhook YAML files.

    oc apply -f <webhook-yaml-file>