feat(charon-relay): split metrics port to ClusterIP-only Service#287
Open
apham0001 wants to merge 2 commits into
Open
feat(charon-relay): split metrics port to ClusterIP-only Service#287apham0001 wants to merge 2 commits into
apham0001 wants to merge 2 commits into
Conversation
2a09597 to
916505c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The default `charon-relay` Service exposes port 3620 (Charon `--monitoring-address`) on the public LoadBalancer alongside the P2P (3610) and HTTP (3640) ports. Metrics are only ever scraped in-cluster, so 3620 has no reason to be reachable from the public internet.
Ref: ObolNetwork/obol-infrastructure#2652
Changes
Verification
```bash
Legacy mode (default): port 3620 still on LB
helm template test charts/charon-relay --set clusterSize=1 | yq 'select(.kind == "Service")'
New mode: port 3620 off LB, separate ClusterIP Service exists
helm template test charts/charon-relay --set clusterSize=1 \
--set metricsService.enabled=true --set serviceMonitor.enabled=true \
| yq 'select(.kind == "Service" or .kind == "ServiceMonitor")'
```
Migration
Existing releases keep working unchanged. To opt-in:
```yaml
metricsService:
enabled: true
serviceMonitor:
enabled: true # if you have prometheus-operator
```
This is non-breaking. The metrics endpoint URL changes from `{lb-ip}:3620` to `{release}-{i}-metrics.{ns}.svc.cluster.local:3620` — only relevant for external scrapers, which shouldn't exist (the whole point of this change).