Skip to content

Commit

Permalink
chore: update storage-calculator and adjust metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Dec 18, 2024
1 parent e405f6d commit 67fa4d4
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 @@ -42,3 +42,5 @@ annotations:
artifacthub.io/changes: |
- kind: changed
description: update dbaas-operator chart dependency to 0.3.1
- 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,4 +448,4 @@ 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

0 comments on commit 67fa4d4

Please sign in to comment.