diff --git a/charts/lagoon-remote/Chart.yaml b/charts/lagoon-remote/Chart.yaml index 26141057..82bb4736 100644 --- a/charts/lagoon-remote/Chart.yaml +++ b/charts/lagoon-remote/Chart.yaml @@ -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 @@ -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.0 - 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 diff --git a/charts/lagoon-remote/ci/linter-values.yaml b/charts/lagoon-remote/ci/linter-values.yaml index 9c7e7d9d..fcb91171 100644 --- a/charts/lagoon-remote/ci/linter-values.yaml +++ b/charts/lagoon-remote/ci/linter-values.yaml @@ -98,3 +98,5 @@ sshPortal: storageCalculator: enabled: true + serviceMonitor: + enabled: false diff --git a/charts/lagoon-remote/templates/storage-calculator.deployment.yaml b/charts/lagoon-remote/templates/storage-calculator.deployment.yaml index f4cc3ecf..49dcd6df 100644 --- a/charts/lagoon-remote/templates/storage-calculator.deployment.yaml +++ b/charts/lagoon-remote/templates/storage-calculator.deployment.yaml @@ -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 }} diff --git a/charts/lagoon-remote/templates/storage-calculator.service.yaml b/charts/lagoon-remote/templates/storage-calculator.service.yaml new file mode 100644 index 00000000..8a73bfdf --- /dev/null +++ b/charts/lagoon-remote/templates/storage-calculator.service.yaml @@ -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 }} diff --git a/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml b/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml new file mode 100644 index 00000000..fc339b51 --- /dev/null +++ b/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml @@ -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 }} diff --git a/charts/lagoon-remote/values.yaml b/charts/lagoon-remote/values.yaml index 866f1871..d234de67 100644 --- a/charts/lagoon-remote/values.yaml +++ b/charts/lagoon-remote/values.yaml @@ -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.0