Skip to content

Commit

Permalink
Merge pull request #711 from uselagoon/storage-calc-metrics
Browse files Browse the repository at this point in the history
chore: update storage-calculator and adjust metrics endpoint
  • Loading branch information
tobybellwood authored Dec 18, 2024
2 parents 4897cd2 + ead5151 commit 2e64b6a
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 12 deletions.
2 changes: 2 additions & 0 deletions charts/lagoon-remote/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ annotations:
description: daemonset to manage node sysctl changes
- kind: changed
description: update uselagoon/lagoon-ssh-portal/ssh-portal from v0.41.3 to v0.41.4
- kind: changed
description: update storage-calculator to v0.7.0 and adjust metrics endpoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.storageCalculator.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}
labels:
{{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "lagoon-remote.storageCalculator.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ spec:
command:
- /manager
args:
- "--metrics-bind-address=0.0.0.0:8080"
- "--metrics-bind-address=:8443"
- "--leader-elect=true"
- "--prometheus-metrics=true"
{{- with .Values.storageCalculator.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
ports:
- name: metrics
containerPort: 8080
- containerPort: 8443
name: https
env:
{{- range $name, $value := .Values.storageCalculator.extraEnvs }}
- name: {{ .name }}
Expand Down
40 changes: 40 additions & 0 deletions charts/lagoon-remote/templates/storage-calculator.role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.storageCalculator.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}-leader-election
labels:
{{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{- if .Values.storageCalculator.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: RoleBinding
metadata:
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}-leader-election
labels:
{{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}
kind: Role
name: {{ include "lagoon-remote.storageCalculator.fullname" . }}-leader-election
subjects:
- kind: ServiceAccount
name: {{ include "lagoon-remote.storageCalculator.serviceAccountName" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ spec:
type: {{ .Values.storageCalculator.metricsService.type }}
ports:
- port: {{ .Values.storageCalculator.metricsService.ports.metrics }}
targetPort: metrics
name: metrics
targetPort: https
protocol: TCP
name: https
selector:
{{- include "lagoon-remote.storageCalculator.selectorLabels" . | nindent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
{{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }}
spec:
endpoints:
- port: metrics
- port: https
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
Expand Down
4 changes: 2 additions & 2 deletions charts/lagoon-remote/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ storageCalculator:
metricsService:
type: ClusterIP
ports:
metrics: 9912
metrics: 8443

serviceMonitor:
enabled: true
Expand All @@ -448,7 +448,7 @@ storageCalculator:
repository: uselagoon/remote-calculator
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v0.6.0
tag: v0.7.0

# sysctlConfigure is used to configure sysctl options on nodes for use by elasticsearch/opensearch pods used in lagoon
# https://github.com/uselagoon/lagoon/issues/2588
Expand Down

0 comments on commit 2e64b6a

Please sign in to comment.