47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
# EXAMPLE — a component that is NOT simulated, pointed at the real system.
|
|
#
|
|
# This is the payoff of keeping the topology honest: there is no pod here at
|
|
# all, yet `example-remote.<namespace>.svc.cluster.local` resolves exactly as it
|
|
# does when the same component is mocked. Callers are identical in both cases,
|
|
# so moving a dependency from mocked to real is a one-line change and nothing
|
|
# downstream is touched.
|
|
#
|
|
# Use this when the real system is reachable and you want it in the loop.
|
|
# Note that reachability depends on where you are running: systems restricted to
|
|
# a managed workspace will not resolve from a laptop at all, which is the whole
|
|
# reason most components should stay mocked.
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: example-remote
|
|
labels:
|
|
rig.component/impl: remote
|
|
spec:
|
|
type: ExternalName
|
|
externalName: real-system.internal.example.com
|
|
---
|
|
# If the real system has no DNS name — only an IP, which is common for legacy
|
|
# hosts — ExternalName cannot express it. Use a bare Service plus manual
|
|
# Endpoints instead, and delete the block above.
|
|
#
|
|
# apiVersion: v1
|
|
# kind: Service
|
|
# metadata:
|
|
# name: example-remote
|
|
# labels:
|
|
# rig.component/impl: remote
|
|
# spec:
|
|
# ports:
|
|
# - port: 80
|
|
# targetPort: 8080
|
|
# ---
|
|
# apiVersion: v1
|
|
# kind: Endpoints
|
|
# metadata:
|
|
# name: example-remote # must match the Service name exactly
|
|
# subsets:
|
|
# - addresses:
|
|
# - ip: 10.0.0.42
|
|
# ports:
|
|
# - port: 8080
|