liveBook · Manning

Service

As explained in Quarkus in Action

A Kubernetes Service is an API resource that provides stable network access to a set of Kubernetes workloads.

A Kubernetes Service gives dynamically created workloads a stable network identity. It groups matching pods behind one logical endpoint, so clients can connect using the Service name instead of tracking changing pod IP addresses. section 10.6

A Service supports application communication by providing:

  • Name-based discovery: connecting to the Service name reaches the associated workloads. section 10.6
  • Logical grouping: the Service represents a set of pods rather than one fixed instance. section 10.6
  • Optional load balancing across Service instances, handled by Kubernetes. section 10.6
  • Declared exposure through generated Kubernetes manifests alongside a Deployment and, optionally, a ServiceMonitor. section 11.3.3

Expose the Inventory service

Adding the Quarkus Kubernetes extension and building the application generates Kubernetes YAML. The Service can expose HTTP on port 80 and forward it to the application on port 8083, while gRPC uses port 9000 and targetPort 9000. Apply the manifest with kubectl apply -f inventory-service/target/kubernetes/kubernetes.yml, then inspect the pods and use port-forwarding when testing locally. section 11.3.3

Figure 10.16 Communication between pods via a Kubernetes service proxy
figure

A communication diagram shows how one pod reaches another through the Kubernetes Service proxy. section 10.6

How Quarkus in Action covers it

How deep it goes
Defines grouping, name-based access, optional load balancing, ports, and generated manifests without covering cluster setup or selector internals.
Examples
Uses an Inventory service manifest exposing HTTP and gRPC ports, then applies it with kubectl and tests through port-forwarding.
What it assumes
Assumes basic Kubernetes deployment tooling while leaving cluster setup and kubectl installation outside the treatment.
What you can do after
Apply generated Kubernetes manifests and connect to deployed workloads through stable Service names and ports.
How it connects
Connects service discovery with pods, deployments, load balancing, Kubernetes manifests, and service monitoring.

Also explained in

Compare how 12 books explain service →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.