diff --git a/charts/lagoon-remote/Chart.yaml b/charts/lagoon-remote/Chart.yaml index 239ba341..b16bedcf 100644 --- a/charts/lagoon-remote/Chart.yaml +++ b/charts/lagoon-remote/Chart.yaml @@ -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 diff --git a/charts/lagoon-remote/templates/storage-calculator.clusterrolebinding.yaml b/charts/lagoon-remote/templates/storage-calculator.clusterrolebinding.yaml new file mode 100644 index 00000000..0ea9f30e --- /dev/null +++ b/charts/lagoon-remote/templates/storage-calculator.clusterrolebinding.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/lagoon-remote/templates/storage-calculator.deployment.yaml b/charts/lagoon-remote/templates/storage-calculator.deployment.yaml index 49dcd6df..be671197 100644 --- a/charts/lagoon-remote/templates/storage-calculator.deployment.yaml +++ b/charts/lagoon-remote/templates/storage-calculator.deployment.yaml @@ -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 }} diff --git a/charts/lagoon-remote/templates/storage-calculator.role.yaml b/charts/lagoon-remote/templates/storage-calculator.role.yaml new file mode 100644 index 00000000..1fbf4b66 --- /dev/null +++ b/charts/lagoon-remote/templates/storage-calculator.role.yaml @@ -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 }} diff --git a/charts/lagoon-remote/templates/storage-calculator.rolebinding.yaml b/charts/lagoon-remote/templates/storage-calculator.rolebinding.yaml index 0ea9f30e..9b156132 100644 --- a/charts/lagoon-remote/templates/storage-calculator.rolebinding.yaml +++ b/charts/lagoon-remote/templates/storage-calculator.rolebinding.yaml @@ -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" . }} diff --git a/charts/lagoon-remote/templates/storage-calculator.service.yaml b/charts/lagoon-remote/templates/storage-calculator.service.yaml index 8a73bfdf..a2c5a02d 100644 --- a/charts/lagoon-remote/templates/storage-calculator.service.yaml +++ b/charts/lagoon-remote/templates/storage-calculator.service.yaml @@ -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 }} diff --git a/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml b/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml index fc339b51..33b14443 100644 --- a/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml +++ b/charts/lagoon-remote/templates/storage-calculator.servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: {{- include "lagoon-remote.storageCalculator.labels" . | nindent 4 }} spec: endpoints: - - port: metrics + - port: https namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/charts/lagoon-remote/values.yaml b/charts/lagoon-remote/values.yaml index 05b7f29e..af7028ba 100644 --- a/charts/lagoon-remote/values.yaml +++ b/charts/lagoon-remote/values.yaml @@ -439,7 +439,7 @@ storageCalculator: metricsService: type: ClusterIP ports: - metrics: 9912 + metrics: 8443 serviceMonitor: enabled: true @@ -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