8080/TCP 14m
#. Access a Service.
A Service can be accessed from containers or nodes in a cluster.
Create a pod, access the pod, and run the **curl** command to access *IP address:Port* or the domain name of the Service, as shown in the following figure.
The domain name suffix can be omitted. In the same namespace, you can directly use **nginx-clusterip:8080** for access. In other namespaces, you can use **nginx-clusterip.default:8080** for access.
.. code-block::
# kubectl run -i --tty --image nginx:alpine test --rm /bin/sh
If you do not see a command prompt, try pressing Enter.
/ # curl 10.247.74.52:8080
Welcome to nginx!
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.
For online documentation and support please refer to
nginx.org.
Commercial support is available at
nginx.com.
Thank you for using nginx.
/ # curl nginx-clusterip.default.svc.cluster.local:8080
...
Welcome to nginx!
...
/ # curl nginx-clusterip.default:8080
...
Welcome to nginx!
...
/ # curl nginx-clusterip:8080
...
Welcome to nginx!
...