CloudsArk
Routes Networking and Ingress Openshift

OpenShift Service Explained

Learn practical openshift service explained with oc commands, OpenShift manifests, verification steps, common mistakes, and production-focused guidance.

OpenShift Service Explained

Introduction

A Service routes traffic to pods selected by labels. If a service has no endpoints, the selector does not match ready pods or the pods are not listening on the target port.

When You Need This

Use this when traffic does not reach an OpenShift application, TLS behavior is unclear, DNS fails inside the cluster, or NetworkPolicy changes affect pod communication.

Key Objects and Commands

oc get service web -n app
oc describe service web -n app
oc get endpoints web -n app
oc get pods -n app --show-labels

Example output:

NAME   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
web    ClusterIP   172.30.21.144   <none>        8080/TCP   18m

NAME   ENDPOINTS           AGE
web    10.128.2.14:8080    18m

Step-by-Step Configuration

  1. Confirm the project and object names.
  2. Check route, service, endpoint, pod, and policy status.
  3. Apply only the network change that matches the failed layer.

Verification

oc get endpoints web -n app
oc get pods -n app --show-labels
oc exec deploy/web -n app -- ss -lntp

Troubleshooting

Follow the path from client to route, route to service, service to endpoint, endpoint to pod, and pod to container port.

Common Mistakes

  • Using labels on the Deployment but not on the pod template.
  • Pointing targetPort at the wrong container port.
  • Assuming a service works before endpoints exist.

Quick Checklist

  • Confirm the active project.
  • Inspect the exact object named in the error.
  • Read recent events.
  • Apply one focused fix.
  • Verify status after the change.

Summary

OpenShift Service Explained is easier to troubleshoot when each network layer is verified separately instead of treating every failure as a router problem.