Skip to content

Commit

Permalink
feat(metrics): ServiceMonitors for arango/redpanda
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Jul 31, 2022
1 parent aeaf116 commit 0db653d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/oada/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ app.kubernetes.io/part-of: oada
{{ .Values.kafka.brokers | join "," | default $brokers }}
{{- end -}}

{{/* Whether add Prometheus monitors */}}
{{/* Whether to add Prometheus monitors */}}
{{- define "oada.prometheus" -}}
{{ .Values.prometheus | default (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }}
{{- end -}}
Expand Down
2 changes: 2 additions & 0 deletions charts/oada/templates/arangodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
image: {{ .Values.arangodb.image }}:{{ .Values.arangodb.tag }}
mode: Single
environment: {{ .Values.global.development | ternary "Development" "Production" }}
metrics:
enabled: {{ include "oada.prometheus" . }}
externalAccess:
{{/* Disable external access for Production */}}
type: {{ .Values.global.development | ternary "Auto" "None" }}
Expand Down
2 changes: 2 additions & 0 deletions charts/oada/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ spec:
app.kubernetes.io/instance: {{ $.Release.Name }}
podMetricsEndpoints:
- port: prometheus
namespaceSelector:
any: false
{{- end }}
---
{{ end -}}
21 changes: 21 additions & 0 deletions charts/oada/templates/redpanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,25 @@ spec:
enabled: true
{{- end }}
developerMode: {{ .Values.global.development }}
{{- if eq (include "oada.prometheus" $) "true" }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: {{ .Release.Namespace }}
name: redpanda-{{ .Release.Name }}
labels:
app.kubernetes.io/name: redpanda
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "oada.chart.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: redpanda
app.kubernetes.io/instance: {{ .Release.Name }}
endpoints:
- port: admin
namespaceSelector:
any: false
{{- end }}
{{- end }}

0 comments on commit 0db653d

Please sign in to comment.