tanzu apps workload delete

This topic tells you about the Tanzu Apps CLI tanzu apps workload delete command. This command deletes workloads in a cluster. Deleting a workload does not mean the images published in the registry are deleted with it.

Default view

A message is displayed in the terminal asking if a workload should be deleted unless the --yes flag is used. If you indicate “Y”, then the workload starts a deletion process inside the cluster.

tanzu apps workload delete spring-pet-clinic
❓ Really delete the workload "spring-pet-clinic"? Yes
👍 Deleted workload "spring-pet-clinic"
tanzu apps workload delete spring-pet-clinic --yes
👍 Deleted workload "spring-pet-clinic"

Workload Delete flags

--all

Deletes all workloads in a namespace.

tanzu apps workload delete --all
❓ Really delete all workloads in the namespace "default"? (y/N) Y
👍 Deleted workloads in namespace "default"
tanzu apps workload delete --all -n my-namespace
❓ Really delete all workloads in the namespace "my-namespace"? Yes
👍 Deleted workloads in namespace "my-namespace"

--file, -f

Path to a file that contains the specification of the workload to be deleted.

tanzu apps workload delete -f path/to/file/spring-petclinic.yaml
❓ Really delete the workload "spring-petclinic"? Yes
👍 Deleted workload "spring-petclinic"

--namespace, -n

Specifies the namespace in which the workload is to be deleted.

tanzu apps workload delete spring-petclinic -n spring-petclinic-ns
❓ Really delete the workload "spring-petclinic"? Yes
👍 Deleted workload "spring-petclinic"

--wait

Waits until workload is deleted.

tanzu apps workload delete -f path/to/file/spring-petclinic.yaml --wait
❓ Really delete the workload "spring-petclinic"? Yes
👍 Deleted workload "spring-petclinic"
Waiting for workload "spring-petclinic" to be deleted...
Workload "spring-petclinic" was deleted

--wait-timeout

Sets a timeout to wait for workload to be deleted.

tanzu apps workload delete -f path/to/file/spring-petclinic.yaml --wait --wait-timeout 1m
❓ Really delete the workload "spring-petclinic"? Yes
👍 Deleted workload "spring-petclinic"
Waiting for workload "spring-petclinic" to be deleted...
Workload "spring-petclinic" was deleted
tanzu apps workload delete spring-petclinic -n spring-petclinic-ns --wait --wait-timeout 1m
❓ Really delete the workload "spring-petclinic"? Yes
👍 Deleted workload "spring-petclinic"
Waiting for workload "spring-petclinic" to be deleted...
Error: timeout after 1m waiting for "spring-petclinic" to be deleted
To view status run: tanzu apps workload get spring-petclinic --namespace spring-petclinic-ns
Error: exit status 1

✖  exit status 1

--yes, -f

Assume yes on all the survey prompts.

tanzu apps workload delete spring-petclinic --yes
👍 Deleted workload "spring-petclinic"
check-circle-line exclamation-circle-line close-line
Scroll to top icon