Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
5 changes: 5 additions & 0 deletions .github/workflows/helm-charts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ jobs:
INFLUXDB_ENTERPRISE_LICENSE_KEY: "${{ secrets.INFLUXDB_ENTERPRISE_LICENSE_KEY }}"
if: steps.list-changed.outputs.changed == 'true'

- name: Create custom resources
run: |
kubectl create -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/bundle.yaml
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
id: install
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/patterns.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Error loading config file
Release not loaded
2 changes: 1 addition & 1 deletion charts/telegraf/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: telegraf
version: 1.8.22
version: 1.8.23
appVersion: 1.24.2
deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
Expand Down
8 changes: 8 additions & 0 deletions charts/telegraf/ci/prometheus-monitor-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config:
outputs:
- prometheus_client:
listen: ":9273"
serviceMonitor:
create: true
labels:
team: losers
11 changes: 11 additions & 0 deletions charts/telegraf/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,17 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}

{{/*
Create the name of the service monitor to use
*/}}
{{- define "telegraf.serviceMonitorName" -}}
{{- if .Values.serviceMonitor.create -}}
{{ default (include "telegraf.fullname" .) .Values.serviceMonitor.name }}
{{- else -}}
{{ default "default" .Values.serviceMonitor.name }}
{{- end -}}
{{- end -}}

{{/*
Get health configuration
*/}}
Expand Down
25 changes: 25 additions & 0 deletions charts/telegraf/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.serviceMonitor.create }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Comment thread
Efrat19 marked this conversation as resolved.
name: {{ template "telegraf.serviceMonitorName" . }}
labels:
{{- include "telegraf.labels" . | nindent 4 }}
Comment thread
alespour marked this conversation as resolved.
{{- if .Values.serviceMonitor.labels }}
{{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.annotations }}
annotations:
{{- toYaml .Values.serviceMonitor.annotations | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "telegraf.labels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: prometheus-client
Comment thread
Efrat19 marked this conversation as resolved.
Outdated
path: /metrics
{{- end }}
11 changes: 11 additions & 0 deletions charts/telegraf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ serviceAccount:
name:
# Annotations for the ServiceAccount
annotations: {}

serviceMonitor:
Comment thread
Efrat19 marked this conversation as resolved.
# Specifies whether a ServiceMonitor should be created
create: false
# The name of the ServiceMonitor to use.
# If not set and create is true, a name is generated using the fullname template
name:
# Extra Labels for the ServiceMonitor
labels: {}
# Annotations for the ServiceMonitor
annotations: {}
## Exposed telegraf configuration
## For full list of possible values see `/docs/all-config-values.yaml` and `/docs/all-config-values.toml`
## ref: https://docs.influxdata.com/telegraf/v1.1/administration/configuration/
Expand Down