Delete an online prediction model

If you want to delete an online prediction model and all the resources associated with it, perform the following steps:

  1. Delete the DeployedModel custom resource (CR) associated with your model on the Prediction user cluster:

    kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG delete -f DEPLOYED_MODEL_NAME.yaml
    

    Replace the following:

    • PREDICTION_CLUSTER_KUBECONFIG: the path to the kubeconfig file in the Prediction user cluster.
    • DEPLOYED_MODEL_NAME: the name of the DeployedModel definition file.
  2. Edit the Endpoint CR in one of the following ways:

    • If the endpoint that the DeployedModel uses doesn't host other models, delete the Endpoint CR on the Prediction user cluster:

      kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG delete -f ENDPOINT_NAME.yaml
      

      Replace ENDPOINT_NAME with the name of the Endpoint definition file.

    • If the endpoint that the DeployedModel uses hosts other models, perform the following steps:

      1. Update the Endpoint CR on the Prediction user cluster:

        kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG edit -f ENDPOINT_NAME.yaml
        

        Replace ENDPOINT_NAME with the name of the Endpoint definition file.

      2. On the YAML file, manually delete the serviceRef object containing the DeployedModel reference you deleted previously.

      3. Save the changes on the YAML file.

  3. Delete your model from the storage bucket. For more information about how to delete objects from storage buckets, see Delete storage objects in projects.