How to remove a port from the service? #967
-
The additional port example shows how to add a port to the service deployed by the cluster operator. I need the opposite: I want to remove the Prometheus port from the service, since I publish the service outside of the cluster and don't want to publish internal metrics to the world. But I can't figure out how to do that, and I can't find anything in the documentation. The example indicates that the overrides will be applied using strategic merge patch, so I unsuccessfully tried this override: override:
service:
spec:
ports:
- $patch: delete
name: prometheus-tls
port: 15691 So I tried to patch the service after deployment, using this patch file: spec:
ports:
- $patch: delete
name: prometheus-tls
port: 15691 which gives me the desired result when I do a dry run like this:
But when I actually apply the patch to the service, it has no effect - I suspect that the cluster operator overwrites my change again? Am I overlooking something? Is there any supported way to remove the port? Or do I need to publish an additional service manually? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think the only way right now is to create a separate service - leave the default one as-is and define your own alongside RabbitmqCluster. I think what was meant by the strategic merge was the general "append or replace" strategy of such merge, which is exactly what makes it hard to remove a specific bit. Whether this port is even necessary on the default one would be worth checking. The way scraping endpoints works with Prometheus Operator changed since we initially implemented this and perhaps right now it's just not needed. |
Beta Was this translation helpful? Give feedback.
I think the only way right now is to create a separate service - leave the default one as-is and define your own alongside RabbitmqCluster. I think what was meant by the strategic merge was the general "append or replace" strategy of such merge, which is exactly what makes it hard to remove a specific bit.
Whether this port is even necessary on the default one would be worth checking. The way scraping endpoints works with Prometheus Operator changed since we initially implemented this and perhaps right now it's just not needed.