For accessing your application running in a pod, you have a few possibilities depending on your scenario. In debugging and testing scenarios, you can access your application in the following simple ways:
- Use kubectl exec to create an ad hoc, interactive pod. We used this approach in the previous chapters.
- Use kubectl proxy to access any service type. This approach works only for HTTP(S) endpoints as it uses proxy functionality provided by Kubernetes API Server.
- Use kubectl port-forward. You can use this approach to access individual Pods or Pods running in a Deployment or behind a service.
If you would like to expose the application for end users in production, you can use the following:
- A service object with the LoadBalancer or NodePort type: We have already demonstrated how to use the LoadBalancer Service in the previous section.
- Using an Ingress...