If you want to delete an online prediction model and all the resources associated with it, perform the following steps:
Delete the
DeployedModel
custom resource associated with your model on the prediction 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 cluster.DEPLOYED_MODEL_NAME
: the name of theDeployedModel
definition file.
Edit the
Endpoint
custom resource in one of the following ways:If the endpoint that the
DeployedModel
uses doesn't host other models, delete theEndpoint
custom resource on the prediction cluster:kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG delete -f ENDPOINT_NAME.yaml
Replace
ENDPOINT_NAME
with the name of theEndpoint
definition file.If the endpoint that the
DeployedModel
uses hosts other models, perform the following steps:Update the
Endpoint
custom resource on the prediction cluster:kubectl --kubeconfig PREDICTION_CLUSTER_KUBECONFIG edit -f ENDPOINT_NAME.yaml
Replace
ENDPOINT_NAME
with the name of theEndpoint
definition file.On the YAML file, manually delete the
serviceRef
object containing theDeployedModel
reference 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.