Skip to content

Commit

Permalink
Merge pull request #91 from benjyiw/master
Browse files Browse the repository at this point in the history
  • Loading branch information
drpebcak authored Nov 21, 2022
2 parents 363bf45 + 30571ef commit 73c3e5d
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
48 changes: 48 additions & 0 deletions chart/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "fusionauth.fullname" $ }}
{{- with .Values.serviceMonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "fusionauth.name" . }}
helm.sh/chart: {{ include "fusionauth.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.serviceMonitor.namespaceSelector }}
namespaceSelector:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "fusionauth.name" . }}
helm.sh/chart: {{ include "fusionauth.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
endpoints:
- port: http
{{- with .Values.serviceMonitor.path }}
path: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.basicAuth }}
basicAuth:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
22 changes: 22 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,25 @@ serviceAccount:
create: false
# serviceAccount.name -- Service account name to use. If not set the "default" service account will be used
name: ""

# serviceMonitor -- Configures a Prometheus operator ServiceMonitor custom resource
# Ref: https://fusionauth.io/docs/v1/tech/tutorials/prometheus
serviceMonitor:
# serviceMonitor.enabled -- Enables creation of a ServiceMonitor
enabled: false
# serviceMonitor.basicAuth -- Configures basic auth for prometheus, this is required for the serviceMonitor to work with FusionAuth because metrics sit behind an authenticated endpoint
basicAuth: {}
# password:
# name: myBasicAuthSecret
# key: password
# username:
# name: myBasicAuthSecret
# key: user
# serviceMonitor.path -- Configures path to metrics, defaults to FusionAuth's prometheus metrics API endpoint
path: api/prometheus/metrics
namespaceSelector: {}
annotations: {}
labels: {}
interval: null
scrapeTimeout: null
relabelings: []

0 comments on commit 73c3e5d

Please sign in to comment.