Skip to content

Commit 281af5b

Browse files
authored
MINOR: kubernetes-ingress: Allow creating metrics service if controller service is not LoadBalancer (#306)
There doesn't seem to be any benefit or reason to *prevent* users from creating an additional service to monitor metrics, even if the main service is not of type `LoadBalancer`. Also, same for if the stats port is already exposed. I'd like to be able to create an additional service for scraping metrics regardless. Signed-off-by: Jason Vigil <[email protected]>
1 parent ddf2cab commit 281af5b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kubernetes-ingress/templates/controller-service-metrics.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ limitations under the License.
1818
The following Service resource will be created upon certain conditions:
1919
- The ServiceMonitor integration is enabled
2020
- A Service resource must be created
21-
- The stats port is not exposed
22-
- The Service is type LoadBalancer
2321

2422
The reason for that is that the Ingress Controller would make it available to the outside
2523
sensitive data such as its metrics, and the operator wants to keep these data private
@@ -28,7 +26,7 @@ sensitive data such as its metrics, and the operator wants to keep these data pr
2826
To let the Prometheus Operator being able to scrape the metrics, an additional service
2927
is going to be created, allowing it to expose of these in the internal Kubernetes networking.
3028
*/}}
31-
{{- if and (.Values.controller.serviceMonitor.enabled) (.Values.controller.service.enabled) (not .Values.controller.service.enablePorts.stat) (eq .Values.controller.service.type "LoadBalancer") }}
29+
{{- if and (.Values.controller.serviceMonitor.enabled) (.Values.controller.service.enabled) }}
3230
apiVersion: v1
3331
kind: Service
3432
metadata:

0 commit comments

Comments
 (0)