Delete Pod without restarting other resources/object
I currently have this bash script that do cleanup obsolete resources for deployment, services, and configmaps. when I try to add the kubectl delete pod
on the script, then it will delete all the remaining pods, but the problem is for a certain scenario wherein I will cleanup only the pods that do not have or without the object like the deployment, services, and configmaps it will also restart the pods due to the kubectl delete pod
and I do not want the other pods or resources also to restart but only delete the specific pod that have only an object pod, then for the other pod that have the object of deployment, services, and configmaps should not be restarted.
.bashrc ps1 var to check for current k8s namespace
I wrote the following bash to get my current k8s namespace that I eventually add to my PS1 var: