There are several interim pods generated during workload creation in TAP. These pods are created for various purposes, such as fetching source code, building application container image, or writing configuration to a destination (git or registry) for further deployment to a run cluster.
The kubectl get pods command is normally overwhelmed by completed pods over time, thus hindering the effective monitoring and control of live pods.
🛶 Pods
NAME READY STATUS RESTARTS AGE
tanzu-java-web-app-build-11-###-pod 0/1 Completed 0 6d12h
tanzu-java-web-app-build-12-###-pod 0/1 Completed 0 22h
tanzu-java-web-app-build-31-###-pod 0/1 Completed 0 60d
tanzu-java-web-app-config-writer-6###-pod 0/1 Completed 0 21d
tanzu-java-web-app-config-writer-7###-pod 0/1 Completed 0 6d12h
tanzu-java-web-app-config-writer-a###-pod 0/1 Completed 0 60d
tanzu-java-web-app-config-writer-g###-pod 0/1 Completed 0 45d
To remove those "Completed" Pods, we shall clean up Pods either in "Succeeded" or "Failed" status.
kubectl delete pod --field-selector=status.phase==Succeeded |
kubectl delete pod --field-selector=status.phase==Failed |
We can also combine the commands to delete both succeeded and failed pods at once. This ensures the removal of both completed and failed pods from our cluster.
kubectl delete pod --field-selector=status.phase==Succeeded,status.phase==Failed |