Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servicemonitor #11

Merged
merged 8 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion clients/harbor-client/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: snappcloud-harbor-client
description: A Helm chart for snappcloud-harbor-client

type: application
version: 0.1.2
version: 0.1.3
appVersion: "0.0.3"
3 changes: 2 additions & 1 deletion clients/harbor-client/charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ metadata:
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
selector:
Expand Down
26 changes: 23 additions & 3 deletions clients/harbor-client/charts/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "snappcloud-harbor-client.fullname" . }}
labels:
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "snappcloud-harbor-client.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "snappcloud-harbor-client.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
interval: 30s
{{- if .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
path: /metrics
honorLabels: {{ .Values.serviceMonitor.honorLabels }}
{{- if .Values.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- tpl (toYaml .Values.serviceMonitor.metricRelabelings | nindent 4) . }}
{{- end }}
{{- if .Values.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.serviceMonitor.relabelings | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "snappcloud-harbor-client.selectorLabels" . | nindent 6 }}
{{- end -}}


2 changes: 1 addition & 1 deletion clients/proxy-client/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: snappcloud-proxy-client
description: A Helm chart for snappcloud-proxy-client

type: application
version: 0.1.2
version: 0.1.3
appVersion: "0.0.3"
2 changes: 1 addition & 1 deletion clients/proxy-client/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
containerPort: 9090
protocol: TCP
env:
- name: PROXY_URL
Expand Down
3 changes: 2 additions & 1 deletion clients/proxy-client/charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ metadata:
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
selector:
Expand Down
26 changes: 23 additions & 3 deletions clients/proxy-client/charts/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "snappcloud-proxy-client.fullname" . }}
labels:
{{- include "snappcloud-proxy-client.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "snappcloud-proxy-client.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "snappcloud-proxy-client.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
interval: 30s
{{- if .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
path: /metrics
honorLabels: {{ .Values.serviceMonitor.honorLabels }}
{{- if .Values.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- tpl (toYaml .Values.serviceMonitor.metricRelabelings | nindent 4) . }}
{{- end }}
{{- if .Values.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.serviceMonitor.relabelings | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "snappcloud-proxy-client.selectorLabels" . | nindent 6 }}
{{- end -}}


2 changes: 1 addition & 1 deletion clients/proxy-client/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ podLabels: { }

service:
type: ClusterIP
port: 8080
port: 9090

resources:
limits:
Expand Down
Loading