Accessing_Application_with_Service
Accessing an Application within a Service
To create a Service
for a Deployment
:
kubectl expose deployment/nginx --port=80 --type=NodePort
# service/nginx-deployment exposed
kubectl get svc
# NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
# nginx-deployment NodePort 10.133.63.157 <none> 80:32289/TCP 48s
We can then access the application by going to the address http://$server_IP:32289
.