forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable/nextcloud] Add prometheus metrics exporter (helm#22876)
* [stable/nextcloud] Add prometheus metrics exporter Signed-off-by: Tom Koch <[email protected]> * [stable/nextcloud] Add new line at end of values.yaml Signed-off-by: Tom Koch <[email protected]> * [stable/nextcloud] Use specific metrics img-tag, add service for metrics Signed-off-by: Tom Koch <[email protected]> * [stable/nextcloud] Add docu for metrics, add annotations to metrics service Signed-off-by: Tom Koch <[email protected]> Signed-off-by: Adrien Loiseau <[email protected]>
- Loading branch information
1 parent
1e6a61f
commit 4fe6c54
Showing
5 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{{- if .Values.metrics.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "nextcloud.fullname" . }}-metrics | ||
labels: | ||
app.kubernetes.io/name: {{ include "nextcloud.name" . }} | ||
helm.sh/chart: {{ include "nextcloud.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: metrics | ||
spec: | ||
replicas: {{ .Values.metrics.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "nextcloud.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
annotations: {{- toYaml .Values.metrics.podAnnotations | nindent 8 }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "nextcloud.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: metrics | ||
{{- if .Values.metrics.podLabels }} | ||
{{ toYaml .Values.metrics.podLabels | indent 8 }} | ||
{{- end }} | ||
spec: | ||
containers: | ||
- name: metrics-exporter | ||
image: "{{ .Values.metrics.image.repository }}:{{ .Values.metrics.image.tag }}" | ||
imagePullPolicy: {{ .Values.metrics.image.pullPolicy }} | ||
env: | ||
- name: NEXTCLOUD_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "nextcloud.fullname" . }} | ||
key: nextcloud-username | ||
- name: NEXTCLOUD_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "nextcloud.fullname" . }} | ||
key: nextcloud-password | ||
- name: NEXTCLOUD_SERVER | ||
value: http{{ if .Values.metrics.https }}s{{ end }}://{{ .Values.nextcloud.host }} | ||
- name: NEXTCLOUD_TIMEOUT | ||
value: {{ .Values.metrics.timeout }} | ||
ports: | ||
- name: metrics | ||
containerPort: 9205 | ||
{{- if .Values.metrics.resources }} | ||
resources: {{- toYaml .Values.metrics.resources | nindent 10 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- if .Values.metrics.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "nextcloud.fullname" . }}-metrics | ||
labels: | ||
labels: | ||
app.kubernetes.io/name: {{ include "nextcloud.name" . }} | ||
helm.sh/chart: {{ include "nextcloud.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- if .Values.metrics.service.labels -}} | ||
{{ toYaml .Values.metrics.service.labels | nindent 4 }} | ||
{{- end -}} | ||
{{- if .Values.metrics.service.annotations }} | ||
annotations: {{ toYaml .Values.metrics.service.annotations | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ .Values.metrics.service.type }} | ||
{{ if eq .Values.metrics.service.type "LoadBalancer" -}} {{ if .Values.metrics.service.loadBalancerIP }} | ||
loadBalancerIP: {{ .Values.metrics.service.loadBalancerIP }} | ||
{{ end -}} | ||
{{- end -}} | ||
ports: | ||
- name: metrics | ||
port: 9205 | ||
targetPort: metrics | ||
selector: | ||
app.kubernetes.io/name: {{ include "nextcloud.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters