I am using openshift and I am unable to access service from outside. I have 2 yaml files service, and deployment. I am pulling nginx image. image is pulled successfully and service is created but i am unable to access nginx page from browser nor curl is working from cli.
below is the output of oc get all command
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/nginx-svc NodePort 17x.x.x.x <none> 80:3000x/TCP 15h
deployment and everything is running.
A Service is only accessible within the cluster. To access your Service from outside the cluster, you'll need to add a Route / Ingress object.
You can also check my answer on the following question to understand the difference between Routes and Services: https://stackoverflow.com/questions/62354040/kubernetes-vs-openshift-routes-and-services/62361379#62361379
So the easiest way to create such a Route would be to use the oc expose command like so:
oc expose svc nginx-svcThen you can use oc get routes to see the URL for that Route.