Repository navigation
Serve the Rspamd web interface and metrics on a ClusterIP Service - #206
Merged
Merged
Conversation
Collaborator
|
I like the idea, but a few changes:
|
The main Service carried every port, including the Rspamd web interface (11334) and the metrics exporter. With service.type LoadBalancer or NodePort, both were then reachable from outside the cluster, and the Rspamd controller could be reached directly, bypassing any authentication the rspamd ingress puts in front of it. Both ports now live only on a new ClusterIP Service, <fullname>-internal, and the main Service no longer has them. The internal Service also carries the prometheus.io/* annotations (it is the one with the metrics port), and takes service.labels, service.ipFamilyPolicy and service.ipFamilies like the main Service. The rspamd ingress routes to it, and the ServiceMonitor selects it by app.kubernetes.io/component=internal, so a scrape never hits both Services. The README documents the change under Ports. Tests: tests/service_test.yaml covers the main Service without the ports and annotations, the internal Service's ports, annotations, labels and IP families, the empty case, the ingress backend and the ServiceMonitor selector. helm lint and kube-score pass.
tillo
force-pushed
the
rspamd-internal-service
branch
from
November 24, 2026 07:56
192d1df to
1c01e6f
Compare
Contributor
Author
|
Thanks for the review. Updated and rebased onto master:
Each point has a test in |
Collaborator
|
Thanks! |
Merged
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.
The main Service carries every port, including the Rspamd web interface (11334) and the metrics exporter. With
service.type: LoadBalancerorNodePort, both are reachable from outside the cluster, and the Rspamd controller can be reached directly, bypassing any authentication on the rspamd ingress.This moves both ports to a new ClusterIP Service,
<fullname>-internal, and removes them from the main Service:app.kubernetes.io/component: internal), so metrics are never scraped twiceprometheus.io/*annotations move to the internal Service, since it is the one with the metrics portservice.labels,service.ipFamilyPolicyandservice.ipFamiliesapply to the internal Service tooTests:
tests/service_test.yaml(8 cases); all unit tests pass and snapshots are unchanged;helm lintpasses with both CI values files, and.ci/scripts/kube-score.shpasses.