Skip to content

Commit

Permalink
Merge pull request #125 from elmariofredo/mv/add-metrics-auth
Browse files Browse the repository at this point in the history
Mv/add metrics auth
  • Loading branch information
dirsigler authored Sep 3, 2023
2 parents 3767f3e + df5ef36 commit 92a04d1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/uptime-kuma/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ name: uptime-kuma
sources:
- https://github.com/louislam/uptime-kuma
type: application
version: 2.12.2
version: 2.13.2
1 change: 1 addition & 0 deletions charts/uptime-kuma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ A self-hosted Monitoring tool like "Uptime-Robot".
| serviceMonitor.scrapeTimeout | string | `"10s"` | Timeout if metrics can't be retrieved in given time interval |
| serviceMonitor.selector | object | `{}` | Prometheus ServiceMonitor selector, only select Prometheus's with these labels (if not set, select any Prometheus) |
| serviceMonitor.tlsConfig | object | `{}` | TLS configuration to use when scraping, only applicable for scheme https. |
| serviceMonitor.basicAuth | object | `{}` | BasicAuth configuration to use when scraping.
| strategy.type | string | `"Recreate"` | |
| tolerations | list | `[]` | |
| useDeploy | bool | `true` | |
Expand Down
12 changes: 12 additions & 0 deletions charts/uptime-kuma/templates/servicemonitor.auth.secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if and .Values.serviceMonitor.enabled .Values.serviceMonitor.basicAuth }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "uptime-kuma.fullname" . }}-metrics-basic-auth
namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }}
type: kubernetes.io/basic-auth
stringData:
{{- range $key, $value := .Values.serviceMonitor.basicAuth }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/uptime-kuma/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ spec:
metricRelabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.serviceMonitor.basicAuth }}
basicAuth:
{{- range $key, $value := . }}
{{ $key }}:
name: {{ include "uptime-kuma.fullname" $ }}-metrics-basic-auth
key: {{ $key }}
{{- end }}
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/uptime-kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ serviceMonitor:
# -- Additional annotations to add to the ServiceMonitor
annotations: {}

# -- BasicAuth credentials for scraping metrics, use API token
# basicAuth:
# # username: ""
# password: ""

# -- Use this option to set a custom DNS policy to the created deployment
dnsPolicy: ""

Expand Down

0 comments on commit 92a04d1

Please sign in to comment.