Do subscribe for more learning materials.These console commands may not work anymore.Ĭl_showHUD 0 - This will remove the HUD (user interface). We'll be covering more Kubernetes tutorials. You may verify it by listing all the deployments: :~/pod-create# kubectl get deployments :~/pod-create# kubectl delete -f deployment-definition.yml Now, if you refer the same YAML file for deletion purpose, it will delete the resources (deployments here) associated with that file. You can see the Deployment now: :~# kubectl get deployments -all-namespaces :~/pod-create# kubectl delete -f deployment-definition.ymlĬreate a new deployment using deployment-definition.yml file: :~# cat pod-create/deployment-definition.ymlĬreate the deployment using the above YAML file: :~/pod-create# kubectl apply -f deployment-definition.yml You may also use the YAML configuration file to delete the resource associated with it. You can delete more than one Kubernetes deployments by providing their names like this: :~/pod-create# kubectl delete deployment my-dep my-dep-2 -namespace=defaultĭeleting Kubernetes deployments using its YAML configuration file :~# kubectl get deployments -all-namespaces When you have the namespace and the deployment name, you can specify it to the kubectl delete deployment command: :~# kubectl delete deployments -namespace=webapps webapps-depĪs you can see, webapps-dep has been deleted. Kube-system calico-kube-controllers 1/1 1 1 46d NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE You may also list all the deployments from all the namespaces: :~# kubectl get deployments -all-namespaces To see all the namespaces, use the following command: :~# kubectl get namespaces List all available namespaces and their deployments It is like a separate a virtual cluster within Kubernetes cluster.įor example, you can have separate namespaces to isolate your workloads for production, staging and development environments. Namespaces are intended for use in environments with many users spread across multiple teams, or projects. The kubectl delete deployments command deletes deployments which are present in "default" namespace unless you provide a different namespace. Deleting Kubernetes Deployment from specific namespace
You may also use deploy or deployments (with an s) instead of deployment in the kubectl delete deployment command. You may verify it by checking the available deployments: :~/pod-create# kubectl get deployments It should show an output telling you that your deployment is deleted: :~/pod-create# kubectl delete deployments my-dep Once you have the Deployment name, simply use it like this: kubectl delete deployments my-dep
Though it usually gets tab completed, you would be better with the name of the Deployment you want to delete. Use kubectl delete deployment command for deleting Kubernetes deployments I'll also show you another way of deleting deployments in Kubernetes. I'll discuss it in a bit more detail with steps to get the deployment name. When you are practicing Kubernetes, you'll often need to delete Kubernetes deployments.ĭeleting deployments is easy, thanks to the kubectl delete deployments command: kubectl delete deployment deployment_name A Kubernetes Deployment runs multiple replicas of your application and automatically replaces any instances that fail or become unresponsive.