Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flag to use Prometheus Operator Service Monitor #1688

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions install/helm/open-match/templates/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,21 @@ spec:
{{- include "openmatch.container.common" . | nindent 8 }}
{{- include "kubernetes.probe" (dict "port" .Values.backend.httpPort "isHTTPS" .Values.global.tls.enabled) | nindent 8 }}
{{- end }}
{{- if and (index .Values "open-match-core" "enabled") (index .Values "global" "monitoring" "enabled")}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "openmatch.backend.hostName" . }}-service-monitor
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: backend
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- end }}
18 changes: 18 additions & 0 deletions install/helm/open-match/templates/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,21 @@ spec:
{{- include "openmatch.container.common" . | nindent 8 }}
{{- include "kubernetes.probe" (dict "port" .Values.frontend.httpPort "isHTTPS" .Values.global.tls.enabled) | nindent 8 }}
{{- end }}
{{- if and (index .Values "open-match-core" "enabled") (index .Values "global" "monitoring" "enabled")}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "openmatch.frontend.hostName" . }}-service-monitor
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: frontend
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- end }}
18 changes: 18 additions & 0 deletions install/helm/open-match/templates/query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,21 @@ spec:
{{- include "openmatch.container.common" . | nindent 8 }}
{{- include "kubernetes.probe" (dict "port" .Values.query.httpPort "isHTTPS" .Values.global.tls.enabled) | nindent 8 }}
{{- end }}
{{- if and (index .Values "open-match-core" "enabled") (index .Values "global" "monitoring" "enabled")}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "openmatch.query.hostName" . }}-service-monitor
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: query
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- end }}
18 changes: 18 additions & 0 deletions install/helm/open-match/templates/swaggerui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,21 @@ spec:
{{- include "openmatch.container.common" . | nindent 8 }}
{{- include "kubernetes.probe" (dict "port" .Values.swaggerui.httpPort) | nindent 8 }}
{{- end }}
{{- if and (index .Values "open-match-core" "swaggerui" "enabled") (index .Values "global" "monitoring" "enabled")}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "openmatch.swaggerui.hostName" . }}-service-monitor
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: swaggerui
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- end }}
18 changes: 18 additions & 0 deletions install/helm/open-match/templates/synchronizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,21 @@ spec:
{{- include "openmatch.container.common" . | nindent 8 }}
{{- include "kubernetes.probe" (dict "port" .Values.synchronizer.httpPort "isHTTPS" .Values.global.tls.enabled) | nindent 8 }}
{{- end }}
{{- if and (index .Values "open-match-core" "enabled") (index .Values "global" "monitoring" "enabled")}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "openmatch.synchronizer.hostName" . }}-service-monitor
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: synchronizer
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- end }}
4 changes: 4 additions & 0 deletions install/helm/open-match/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ global:
tag: 0.0.0-dev
pullPolicy: Always

# Enable monitoring if you want to create Prometheus Operator Service Monitor for every service
monitoring:
enabled: false

# Expose the telemetry configurations to all subcharts because prometheus, for example,
# requires pod-level annotation to customize its scrape path.
# See definitions in templates/_helpers.tpl - "prometheus.annotations" section for details
Expand Down
4 changes: 4 additions & 0 deletions install/helm/open-match/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ global:
tag: 1.8.1
pullPolicy: Always

# Enable monitoring if you want to create Prometheus Operator Service Monitor for every service
monitoring:
enabled: false

# Expose the telemetry configurations to all subcharts because prometheus, for example,
# requires pod-level annotation to customize its scrape path.
# See definitions in templates/_helpers.tpl - "prometheus.annotations" section for details
Expand Down