Skip to content

Commit

Permalink
chore: update storage-calcluator and add metrics monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Feb 23, 2024
1 parent 3e0f034 commit 4f2f2a3
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 9 deletions.
10 changes: 3 additions & 7 deletions charts/lagoon-remote/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type: application
# This is the chart version. This version number should be incremented each
# time you make changes to the chart and its templates, including the app
# version.
version: 0.87.0
version: 0.88.0

dependencies:
- name: lagoon-build-deploy
Expand All @@ -45,10 +45,6 @@ dependencies:
annotations:
artifacthub.io/changes: |
- kind: changed
description: remove insights-remote service if not enabled
- kind: removed
description: removed old kubernetes build deploy references
description: update storage-calculator to v0.5.1
- kind: changed
description: updated to insights-remote:v0.0.8
- kind: changed
description: updated lagoon-build-deploy chart to v0.26.3
description: added metrics to storage-calculator
2 changes: 2 additions & 0 deletions charts/lagoon-remote/ci/linter-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ sshPortal:
storageCalculator:
enabled: true
serviceMonitor:
enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ spec:
command:
- /manager
args:
- "--metrics-bind-address=127.0.0.1:8080"
- "--metrics-bind-address=0.0.0.0:8080"
- "--prometheus-metrics=true"
{{- with .Values.storageCalculator.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
ports:
- name: metrics
containerPort: 8080
env:
{{- range $name, $value := .Values.storageCalculator.extraEnvs }}
- name: {{ .name }}
Expand Down
17 changes: 17 additions & 0 deletions charts/lagoon-remote/templates/storage-calculator.service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.storageCalculator.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}-metrics
labels:
metrics-only: "true"
{{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }}
spec:
type: {{ .Values.storageCalculator.metricsService.type }}
ports:
- port: {{ .Values.storageCalculator.metricsService.ports.metrics }}
targetPort: metrics
name: metrics
selector:
{{- include "lagoon-remote.storageCalculator.selectorLabels" . | nindent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if and .Values.storageCalculator.enabled .Values.storageCalculator.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}
labels:
{{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }}
spec:
endpoints:
- port: metrics
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
metrics-only: "true"
{{- include "lagoon-remote.storageCalculator.selectorLabels" . | nindent 6 }}
{{- end }}
10 changes: 9 additions & 1 deletion charts/lagoon-remote/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,16 @@ storageCalculator:
# template
name:

metricsService:
type: ClusterIP
ports:
metrics: 9912

serviceMonitor:
enabled: true

image:
repository: uselagoon/remote-calculator
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v0.2.3
tag: v0.5.1

0 comments on commit 4f2f2a3

Please sign in to comment.