title: How do I un-expose (undo expose) service?
body: <p>In Kubernetes, it is possible to make a service running in cluster externally accessible by running <code>kubectl expose deployment</code>.  Why deployment as opposed to service is beyond my simpleton's comprehension.  That aside, I would like to also be able to undo this operation afterwards.  Think of a scenario, where I need to get access to the service that normally is only accessible inside the cluster for debugging purposes and then to restore original situation.</p>
  
  <p>Is there any way of doing this short of deleting the deployment and creating it afresh?</p>
  
  <hr>
  
  <p>PS. Actually deleting service and deployment doesn't help. Re-creating service and deployment with the same name will result in service being exposed.</p>