2026-08-22 17:30:45 +01:00
|
|
|
# A Service gives a stable way to reach a set of Pods, even as individual
|
|
|
|
|
# Pods are created and destroyed and get new internal IP addresses over
|
|
|
|
|
# time. This Service selects any Pod labelled app: demo (see
|
|
|
|
|
# deployment.yaml) and forwards traffic to it.
|
|
|
|
|
#
|
2026-10-28 13:02:14 +00:00
|
|
|
# ClusterIP keeps this demo internal: this Hetzner deployment does not use
|
|
|
|
|
# MetalLB or a cloud load balancer. Reach it with kubectl port-forward over
|
|
|
|
|
# the private Kubernetes API rather than opening public application ports.
|
2026-08-22 17:30:45 +01:00
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
|
|
|
|
name: demo
|
|
|
|
|
namespace: demo
|
|
|
|
|
spec:
|
2026-10-28 13:02:14 +00:00
|
|
|
type: ClusterIP
|
2026-08-22 17:30:45 +01:00
|
|
|
selector:
|
|
|
|
|
app: demo
|
|
|
|
|
ports:
|
|
|
|
|
- port: 80
|
|
|
|
|
targetPort: 80
|