This page describes the process to delete an online prediction model and all the resources associated with it.
Before you begin
To get the permissions that you need to access Online Prediction,
ask your Project IAM Admin to grant you the Vertex AI
Prediction User (vertex-ai-prediction-user) role.
For information about this role, see Prepare IAM permissions.
Additionally, to get the permissions that you need to delete objects in a
bucket, ask your Project IAM Admin to grant you the Project Bucket Object Admin
(project-bucket-object-admin) role in the project.
Delete resources
If you want to delete an online prediction model and all the resources associated with it, perform the following steps:
Delete the
DeployedModelcustom resource associated with your model on the prediction cluster:kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG delete -f DEPLOYED_MODEL_NAME.yamlReplace the following:
PREDICTION_CLUSTER_KUBECONFIG: the path to the kubeconfig file in the prediction cluster.DEPLOYED_MODEL_NAME: the name of theDeployedModeldefinition file.
Edit the
Endpointcustom resource in one of the following ways:If the endpoint that the
DeployedModeluses doesn't host other models, delete theEndpointcustom resource on the prediction cluster:kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG delete -f ENDPOINT_NAME.yamlReplace
ENDPOINT_NAMEwith the name of theEndpointdefinition file.If the endpoint that the
DeployedModeluses hosts other models, perform the following steps:Update the
Endpointcustom resource on the prediction cluster:kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG edit -f ENDPOINT_NAME.yamlReplace
ENDPOINT_NAMEwith the name of theEndpointdefinition file.On the YAML file, manually delete the
serviceRefobject containing theDeployedModelreference you deleted previously.Save the changes on the YAML file.
Delete your model from the storage bucket. For more information about how to delete objects from storage buckets, see Delete storage objects in projects.