Using kubectl to tear down from yaml

3/7/2018

I created a .yaml file following this tutorial. You deploy the web service with kubectl apply -f shopfront-service.yaml. So far so good. The author says nothing though about how to tear everything down.

With TerraForm or CloudFormation you use the same .yaml file to remove all resources. I would think that K8 would also support cleaning up using the same .yaml file, but I can't find any way to do this.

Is there a way to delete resources with the same .yaml file used to create the deployment?

-- Dean Schulze
kubectl
kubernetes
yaml

1 Answer

3/7/2018

kubectl delete -f shopfront-service.yaml
see kubectl delete docs

-- stacksonstacks
Source: StackOverflow