If you decide it's time to do some clean up, you may delete the service and the deployment by executing the HTTP DELETE request, for example:
$ curl http://localhost:8000/ \ apis/extensions/v1beta1/namespaces/default/deployments/rest-example \ -XDELETE $ curl http://localhost:8080/ \ api/v1/namespaces/default/services/rest-example -XDELETE
Finding out the proper API operation REST paths (endpoints) can be very inconvenient just by looking at the web documentation or by spying what URLs are being called by kubectl. There's a better way of doing this; OpenAPI specification of the Kubernetes api-server. Let's look at how we can get this specification.