diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml index f88266e66..52d95a3e1 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/deployment.yaml @@ -87,9 +87,11 @@ spec: value: '{{ $val }}' {{- end }} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/alerts/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/alerts/templates/serviceMonitor.yaml new file mode 100644 index 000000000..14ed00461 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/alerts/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "alerts.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "alerts.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "alerts.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/alerts/values.yaml b/scripts/helmcharts/openreplay/charts/alerts/values.yaml index 5cf71717c..5df8b27b9 100644 --- a/scripts/helmcharts/openreplay/charts/alerts/values.yaml +++ b/scripts/helmcharts/openreplay/charts/alerts/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml index d34883b5a..7fe85e43e 100644 --- a/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/templates/deployment.yaml @@ -81,9 +81,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/assets/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/assets/templates/serviceMonitor.yaml new file mode 100644 index 000000000..2df5a4085 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/assets/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "assets.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "assets.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "assets.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/assets/values.yaml b/scripts/helmcharts/openreplay/charts/assets/values.yaml index 2a9160c23..dd1b1ce9f 100644 --- a/scripts/helmcharts/openreplay/charts/assets/values.yaml +++ b/scripts/helmcharts/openreplay/charts/assets/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: true diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/assist/templates/serviceMonitor.yaml new file mode 100644 index 000000000..598a8fa43 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/assist/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "assist.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "assist.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "assist.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/assist/values.yaml b/scripts/helmcharts/openreplay/charts/assist/values.yaml index ab8b7cd1c..a256801fb 100644 --- a/scripts/helmcharts/openreplay/charts/assist/values.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/values.yaml @@ -40,6 +40,18 @@ securityContext: {} # type: ClusterIP # port: 9000 +serviceMonitor: + enabled: false + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s + service: type: ClusterIP ports: diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml index f3eb46d1d..9b5044a59 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml @@ -97,9 +97,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/serviceMonitor.yaml new file mode 100644 index 000000000..1c0f1baa2 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "chalice.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "chalice.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "chalice.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/chalice/values.yaml b/scripts/helmcharts/openreplay/charts/chalice/values.yaml index e1b56ebfd..4f79714c9 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/values.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 8000 + ports: + http: 8000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: true diff --git a/scripts/helmcharts/openreplay/charts/db/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/db/templates/deployment.yaml index fd879d92f..0b12738af 100644 --- a/scripts/helmcharts/openreplay/charts/db/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/db/templates/deployment.yaml @@ -53,9 +53,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/db/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/db/templates/serviceMonitor.yaml new file mode 100644 index 000000000..103c833f7 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/db/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "db.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "db.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "db.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/db/values.yaml b/scripts/helmcharts/openreplay/charts/db/values.yaml index a57e79572..10e6004ac 100644 --- a/scripts/helmcharts/openreplay/charts/db/values.yaml +++ b/scripts/helmcharts/openreplay/charts/db/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false diff --git a/scripts/helmcharts/openreplay/charts/ender/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/ender/templates/deployment.yaml index bbdb35c00..e822f232a 100644 --- a/scripts/helmcharts/openreplay/charts/ender/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/ender/templates/deployment.yaml @@ -51,9 +51,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/ender/templates/service.yaml b/scripts/helmcharts/openreplay/charts/ender/templates/service.yaml index be0b79e9e..d72fe8658 100644 --- a/scripts/helmcharts/openreplay/charts/ender/templates/service.yaml +++ b/scripts/helmcharts/openreplay/charts/ender/templates/service.yaml @@ -7,9 +7,11 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: http + {{- range $key, $val := .Values.service.ports }} + - port: {{ $val }} + targetPort: {{ $key }} protocol: TCP - name: http + name: {{ $key }} + {{- end}} selector: {{- include "ender.selectorLabels" . | nindent 4 }} diff --git a/scripts/helmcharts/openreplay/charts/ender/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/ender/templates/serviceMonitor.yaml new file mode 100644 index 000000000..dfaf830ec --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/ender/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "ender.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "ender.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "ender.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/ender/values.yaml b/scripts/helmcharts/openreplay/charts/ender/values.yaml index 9c5cf6d9c..1f80ad2d2 100644 --- a/scripts/helmcharts/openreplay/charts/ender/values.yaml +++ b/scripts/helmcharts/openreplay/charts/ender/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false diff --git a/scripts/helmcharts/openreplay/charts/heuristics/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/heuristics/templates/deployment.yaml index 79a7d1e72..2d96a4423 100644 --- a/scripts/helmcharts/openreplay/charts/heuristics/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/heuristics/templates/deployment.yaml @@ -51,9 +51,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/heuristics/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/heuristics/templates/serviceMonitor.yaml new file mode 100644 index 000000000..f17a9c230 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/heuristics/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "heuristics.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "heuristics.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "heuristics.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/heuristics/values.yaml b/scripts/helmcharts/openreplay/charts/heuristics/values.yaml index 6b2eeaa0d..bd59ed0a2 100644 --- a/scripts/helmcharts/openreplay/charts/heuristics/values.yaml +++ b/scripts/helmcharts/openreplay/charts/heuristics/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false diff --git a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml index 0c4399518..130d20fd8 100644 --- a/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/http/templates/deployment.yaml @@ -79,9 +79,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/http/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/http/templates/serviceMonitor.yaml new file mode 100644 index 000000000..069a83640 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/http/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "http.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "http.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "http.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/http/values.yaml b/scripts/helmcharts/openreplay/charts/http/values.yaml index 04b370b17..aa95c5f19 100644 --- a/scripts/helmcharts/openreplay/charts/http/values.yaml +++ b/scripts/helmcharts/openreplay/charts/http/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 80 + ports: + http: 80 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: true diff --git a/scripts/helmcharts/openreplay/charts/integrations/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/integrations/templates/deployment.yaml index 942f8c0a5..77282e854 100644 --- a/scripts/helmcharts/openreplay/charts/integrations/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/integrations/templates/deployment.yaml @@ -53,9 +53,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/scripts/helmcharts/openreplay/charts/integrations/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/integrations/templates/serviceMonitor.yaml new file mode 100644 index 000000000..ade44eec2 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/integrations/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "integrations.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "integrations.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "integrations.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/integrations/values.yaml b/scripts/helmcharts/openreplay/charts/integrations/values.yaml index f7420e694..054a78d8b 100644 --- a/scripts/helmcharts/openreplay/charts/integrations/values.yaml +++ b/scripts/helmcharts/openreplay/charts/integrations/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false diff --git a/scripts/helmcharts/openreplay/charts/peers/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/peers/templates/serviceMonitor.yaml new file mode 100644 index 000000000..a84610638 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/peers/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "peers.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "peers.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "peers.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/peers/values.yaml b/scripts/helmcharts/openreplay/charts/peers/values.yaml index 3dffa62e7..44ef464c8 100644 --- a/scripts/helmcharts/openreplay/charts/peers/values.yaml +++ b/scripts/helmcharts/openreplay/charts/peers/values.yaml @@ -40,6 +40,18 @@ securityContext: {} # type: ClusterIP # port: 9000 +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s + service: type: ClusterIP ports: diff --git a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml index 91e778e07..5e7891eff 100644 --- a/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/sink/templates/deployment.yaml @@ -71,9 +71,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: diff --git a/scripts/helmcharts/openreplay/charts/sink/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/sink/templates/serviceMonitor.yaml new file mode 100644 index 000000000..1cb154bda --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/sink/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "sink.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "sink.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "sink.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/sink/values.yaml b/scripts/helmcharts/openreplay/charts/sink/values.yaml index 508670e42..1534c61fa 100644 --- a/scripts/helmcharts/openreplay/charts/sink/values.yaml +++ b/scripts/helmcharts/openreplay/charts/sink/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false diff --git a/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml index b36c06c94..9cea54233 100644 --- a/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/storage/templates/deployment.yaml @@ -65,9 +65,11 @@ spec: value: '{{ $val }}' {{- end}} ports: - - name: http - containerPort: {{ .Values.service.port }} + {{- range $key, $val := .Values.service.ports }} + - name: {{ $key }} + containerPort: {{ $val }} protocol: TCP + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: diff --git a/scripts/helmcharts/openreplay/charts/storage/templates/serviceMonitor.yaml b/scripts/helmcharts/openreplay/charts/storage/templates/serviceMonitor.yaml new file mode 100644 index 000000000..0591c0a23 --- /dev/null +++ b/scripts/helmcharts/openreplay/charts/storage/templates/serviceMonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "storage.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "storage.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + {{- .Values.serviceMonitor.scrapeConfigs | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "storage.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/scripts/helmcharts/openreplay/charts/storage/values.yaml b/scripts/helmcharts/openreplay/charts/storage/values.yaml index 2dbd9cd6e..37fc2fbec 100644 --- a/scripts/helmcharts/openreplay/charts/storage/values.yaml +++ b/scripts/helmcharts/openreplay/charts/storage/values.yaml @@ -38,7 +38,21 @@ securityContext: {} service: type: ClusterIP - port: 9000 + ports: + http: 9000 + metrics: 8888 + +serviceMonitor: + enabled: true + additionalLabels: + release: monitoring + scrapeConfigs: + - port: metrics + honorLabels: true + interval: 15s + path: /metrics + scheme: http + scrapeTimeout: 10s ingress: enabled: false