From 48734a4847758c0c93e9c38454662173ed27e653 Mon Sep 17 00:00:00 2001 From: tshafir Date: Mon, 26 Feb 2024 11:13:43 +0200 Subject: [PATCH 1/6] bump ocean-metric-exporter version and add liveness & readiness probes --- charts/ocean-metric-exporter/Chart.yaml | 2 +- .../ocean-metric-exporter/templates/deployment.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/ocean-metric-exporter/Chart.yaml b/charts/ocean-metric-exporter/Chart.yaml index 35658f6..d88bc98 100644 --- a/charts/ocean-metric-exporter/Chart.yaml +++ b/charts/ocean-metric-exporter/Chart.yaml @@ -3,7 +3,7 @@ name: ocean-metric-exporter description: A Helm chart for Ocean Metric Exporter type: application version: 1.0.6 -appVersion: 1.0.3 +appVersion: 1.0.4 home: https://github.com/spotinst/charts/tree/main/charts/ocean-metric-exporter icon: https://docs.spot.io/_media/images/spot_mark.png sources: diff --git a/charts/ocean-metric-exporter/templates/deployment.yaml b/charts/ocean-metric-exporter/templates/deployment.yaml index b12a86a..4f29f15 100644 --- a/charts/ocean-metric-exporter/templates/deployment.yaml +++ b/charts/ocean-metric-exporter/templates/deployment.yaml @@ -90,6 +90,18 @@ spec: - --deny-labels={{ join "," .Values.metricsConfiguration.denyLabels }} resources: {{- toYaml .Values.resources | nindent 12 }} + livenessProbe: + initialDelaySeconds: 10 + timeoutSeconds: 10 + httpGet: + path: /health/liveness + port: exporter + readinessProbe: + initialDelaySeconds: 10 + timeoutSeconds: 10 + httpGet: + path: /health/readiness + port: exporter {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} From 9aa91b9b2425b123c5d83a1a75fae1b9f3d3a1c2 Mon Sep 17 00:00:00 2001 From: tshafir Date: Mon, 26 Feb 2024 12:45:28 +0200 Subject: [PATCH 2/6] bump ocean-metric-exporter chart version --- charts/ocean-metric-exporter/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ocean-metric-exporter/Chart.yaml b/charts/ocean-metric-exporter/Chart.yaml index d88bc98..2abf307 100644 --- a/charts/ocean-metric-exporter/Chart.yaml +++ b/charts/ocean-metric-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: ocean-metric-exporter description: A Helm chart for Ocean Metric Exporter type: application -version: 1.0.6 +version: 1.0.7 appVersion: 1.0.4 home: https://github.com/spotinst/charts/tree/main/charts/ocean-metric-exporter icon: https://docs.spot.io/_media/images/spot_mark.png From c5f402df13d9dc7e24e46359c9c14d9760006d93 Mon Sep 17 00:00:00 2001 From: tshafir Date: Mon, 26 Feb 2024 12:46:08 +0200 Subject: [PATCH 3/6] update helm docs --- charts/ocean-metric-exporter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ocean-metric-exporter/README.md b/charts/ocean-metric-exporter/README.md index 9aa0c67..1831a29 100644 --- a/charts/ocean-metric-exporter/README.md +++ b/charts/ocean-metric-exporter/README.md @@ -1,6 +1,6 @@ # ocean-metric-exporter -![Version: 1.0.6](https://img.shields.io/badge/Version-1.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.3](https://img.shields.io/badge/AppVersion-1.0.3-informational?style=flat-square) +![Version: 1.0.7](https://img.shields.io/badge/Version-1.0.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.4](https://img.shields.io/badge/AppVersion-1.0.4-informational?style=flat-square) A Helm chart for Ocean Metric Exporter. From ca0021d791634fec939b045d32a19f0092030bf2 Mon Sep 17 00:00:00 2001 From: tshafir Date: Wed, 6 Mar 2024 13:21:41 +0200 Subject: [PATCH 4/6] added optional probes to ocean metric exporter --- charts/ocean-metric-exporter/README.md | 12 +++++++ .../templates/_helpers.tpl | 26 +++++++++++++++ .../templates/deployment.yaml | 13 +------- charts/ocean-metric-exporter/values.yaml | 33 +++++++++++++++++++ 4 files changed, 72 insertions(+), 12 deletions(-) diff --git a/charts/ocean-metric-exporter/README.md b/charts/ocean-metric-exporter/README.md index 1831a29..ba46431 100644 --- a/charts/ocean-metric-exporter/README.md +++ b/charts/ocean-metric-exporter/README.md @@ -48,6 +48,18 @@ helm install my-release spot/ocean-metric-exporter | oceanController.secretName | Optional | `"spotinst-kubernetes-cluster-controller"` | Secret name. | | podAnnotations | Optional | `{}` | Pod annotations. Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ | | podEnvVariables | Optional | `[]` | Additional environment variables for the exporter container. | +| probes.enabled | Bool | `false` | Whether to include both liveness and readiness probe, this option will ignore the nested enabled booleans. | +| probes.liveness.enabled | Bool | `false` | Whether to include liveness probe, this will be ignored if probes.enabled was set to true. | +| probes.liveness.failureThreshold | Integer | `3` | Liveness probe failure threshold. | +| probes.liveness.initialDelaySeconds | Integer | `15` | Liveness probe initial delay. | +| probes.liveness.periodSeconds | Integer | `10` | Liveness probe period. | +| probes.liveness.timeoutSeconds | Integer | `1` | Liveness probe timeout. | +| probes.readiness.enabled | Bool | `false` | Whether to include readiness probe, this will be ignored if probes.enabled was set to true. | +| probes.readiness.failureThreshold | Integer | `3` | Readiness probe failure threshold. | +| probes.readiness.initialDelaySeconds | Integer | `15` | Readiness probe initial delay. | +| probes.readiness.periodSeconds | Integer | `10` | Readiness probe period. | +| probes.readiness.successThreshold | Integer | `1` | Readiness probe success threshold. | +| probes.readiness.timeoutSeconds | Integer | `1` | Readiness probe timeout. | | replicaCount | Optional | `1` | Replicas. Ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#replicas | | resources | Optional | `{"limits":{"cpu":"500m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"50Mi"}}` | Resource requests and limits. Ref: http://kubernetes.io/docs/user-guide/compute-resources/ | | service.create | Optional | `true` | Controls whether a service should be created. | diff --git a/charts/ocean-metric-exporter/templates/_helpers.tpl b/charts/ocean-metric-exporter/templates/_helpers.tpl index 1e29533..f3abfa2 100644 --- a/charts/ocean-metric-exporter/templates/_helpers.tpl +++ b/charts/ocean-metric-exporter/templates/_helpers.tpl @@ -103,3 +103,29 @@ Container command. {{- printf "[ \"java\", \"-Dspring.profiles.active=prod,default\", \"-jar\", \"/app/app.jar\" ]" -}} {{- end }} +{{/* +probes. +*/}} +{{- define "ocean-metric-exporter.probes" -}} +{{- if or .Values.probes.liveness.enabled .Values.probes.enabled }} +livenessProbe: + httpGet: + path: /health/liveness + port: exporter + initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.liveness.periodSeconds }} + failureThreshold: {{ .Values.probes.liveness.failureThreshold }} + timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }} +{{- end}} +{{- if or .Values.probes.readiness.enabled .Values.probes.enabled }} +readinessProbe: + httpGet: + path: /health/readiness + port: exporter + initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.readiness.periodSeconds }} + failureThreshold: {{ .Values.probes.readiness.failureThreshold }} + successThreshold: {{ .Values.probes.readiness.successThreshold }} + timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} +{{- end}} +{{- end }} \ No newline at end of file diff --git a/charts/ocean-metric-exporter/templates/deployment.yaml b/charts/ocean-metric-exporter/templates/deployment.yaml index 4f29f15..0903100 100644 --- a/charts/ocean-metric-exporter/templates/deployment.yaml +++ b/charts/ocean-metric-exporter/templates/deployment.yaml @@ -90,18 +90,7 @@ spec: - --deny-labels={{ join "," .Values.metricsConfiguration.denyLabels }} resources: {{- toYaml .Values.resources | nindent 12 }} - livenessProbe: - initialDelaySeconds: 10 - timeoutSeconds: 10 - httpGet: - path: /health/liveness - port: exporter - readinessProbe: - initialDelaySeconds: 10 - timeoutSeconds: 10 - httpGet: - path: /health/readiness - port: exporter + {{- include "ocean-metric-exporter.probes" . | nindent 8 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/ocean-metric-exporter/values.yaml b/charts/ocean-metric-exporter/values.yaml index 81a6d51..9ef550f 100644 --- a/charts/ocean-metric-exporter/values.yaml +++ b/charts/ocean-metric-exporter/values.yaml @@ -63,6 +63,39 @@ service: # -- (Optional) Controls whether a service should be created. create: true +# Probes configuration +probes: + # -- (Bool) Whether to include both liveness and readiness probe, this option will ignore the nested enabled booleans. + enabled: false + + # Liveness probe configuration. + liveness: + # -- (Bool) Whether to include liveness probe, this will be ignored if probes.enabled was set to true. + enabled: false + # -- (Integer) Liveness probe initial delay. + initialDelaySeconds: 15 + # -- (Integer) Liveness probe period. + periodSeconds: 10 + # -- (Integer) Liveness probe failure threshold. + failureThreshold: 3 + # -- (Integer) Liveness probe timeout. + timeoutSeconds: 1 + + # Readiness probe configuration. + readiness: + # -- (Bool) Whether to include readiness probe, this will be ignored if probes.enabled was set to true. + enabled: false + # -- (Integer) Readiness probe initial delay. + initialDelaySeconds: 15 + # -- (Integer) Readiness probe period. + periodSeconds: 10 + # -- (Integer) Readiness probe failure threshold. + failureThreshold: 3 + # -- (Integer) Readiness probe success threshold. + successThreshold: 1 + # -- (Integer) Readiness probe timeout. + timeoutSeconds: 1 + # -- (Optional) Exporter Metrics Configurations metricsConfiguration: # -- (Array[string]) List of Categories to enable - if empty will get no metrics. Additional possible values can be found here: https://docs.spot.io/ocean/tools-and-integrations/prometheus/scrape?id=categories From 15080fb7dfc393b9be8789fea4a38aa42f380bc4 Mon Sep 17 00:00:00 2001 From: tshafir Date: Wed, 6 Mar 2024 13:32:17 +0200 Subject: [PATCH 5/6] changed default value for probes.enabled --- charts/ocean-metric-exporter/README.md | 2 +- charts/ocean-metric-exporter/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/ocean-metric-exporter/README.md b/charts/ocean-metric-exporter/README.md index ba46431..a08c693 100644 --- a/charts/ocean-metric-exporter/README.md +++ b/charts/ocean-metric-exporter/README.md @@ -48,7 +48,7 @@ helm install my-release spot/ocean-metric-exporter | oceanController.secretName | Optional | `"spotinst-kubernetes-cluster-controller"` | Secret name. | | podAnnotations | Optional | `{}` | Pod annotations. Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ | | podEnvVariables | Optional | `[]` | Additional environment variables for the exporter container. | -| probes.enabled | Bool | `false` | Whether to include both liveness and readiness probe, this option will ignore the nested enabled booleans. | +| probes.enabled | Bool | `true` | Whether to include both liveness and readiness probe, if this is set to true it will ignore the nested enabled booleans. | | probes.liveness.enabled | Bool | `false` | Whether to include liveness probe, this will be ignored if probes.enabled was set to true. | | probes.liveness.failureThreshold | Integer | `3` | Liveness probe failure threshold. | | probes.liveness.initialDelaySeconds | Integer | `15` | Liveness probe initial delay. | diff --git a/charts/ocean-metric-exporter/values.yaml b/charts/ocean-metric-exporter/values.yaml index 9ef550f..be049d2 100644 --- a/charts/ocean-metric-exporter/values.yaml +++ b/charts/ocean-metric-exporter/values.yaml @@ -65,8 +65,8 @@ service: # Probes configuration probes: - # -- (Bool) Whether to include both liveness and readiness probe, this option will ignore the nested enabled booleans. - enabled: false + # -- (Bool) Whether to include both liveness and readiness probe, if this is set to true it will ignore the nested enabled booleans. + enabled: true # Liveness probe configuration. liveness: From 140af5fb9d94d02f1f80c0066a79f918a918c1a3 Mon Sep 17 00:00:00 2001 From: tshafir Date: Wed, 6 Mar 2024 15:55:50 +0200 Subject: [PATCH 6/6] update helm-docs to 1.13.1 --- Makefile.devel.mk | 2 +- charts/ocean-kubernetes-controller/README.md | 2 +- charts/ocean-metric-exporter/README.md | 2 +- charts/ocean-network-client/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.devel.mk b/Makefile.devel.mk index fbd904b..40209f3 100644 --- a/Makefile.devel.mk +++ b/Makefile.devel.mk @@ -72,5 +72,5 @@ docs: $(Q) echo "$$HELP_DOCS" else docs: ## Document the charts - @docker run --rm --volume "$(shell pwd):/helm-docs" -u $(shell id -u) jnorwood/helm-docs:v1.12.0 + @docker run --rm --volume "$(shell pwd):/helm-docs" -u $(shell id -u) jnorwood/helm-docs:v1.13.1 endif diff --git a/charts/ocean-kubernetes-controller/README.md b/charts/ocean-kubernetes-controller/README.md index de9e9d0..46985c8 100644 --- a/charts/ocean-kubernetes-controller/README.md +++ b/charts/ocean-kubernetes-controller/README.md @@ -131,4 +131,4 @@ Kubernetes: `>=1.20.0-0` | updateStrategy | object | `{}` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/charts/ocean-metric-exporter/README.md b/charts/ocean-metric-exporter/README.md index a08c693..6175e8d 100644 --- a/charts/ocean-metric-exporter/README.md +++ b/charts/ocean-metric-exporter/README.md @@ -66,4 +66,4 @@ helm install my-release spot/ocean-metric-exporter | tolerations | Optional | `[{"key":"node-role.kubernetes.io/master","operator":"Exists"},{"key":"node-role.kubernetes.io/control-plane","operator":"Exists"}]` | Tolerations for nodes that have taints on them. Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/charts/ocean-network-client/README.md b/charts/ocean-network-client/README.md index dae86d2..5258e03 100644 --- a/charts/ocean-network-client/README.md +++ b/charts/ocean-network-client/README.md @@ -41,4 +41,4 @@ helm install my-release spot/ocean-network-client | tolerations | Optional | `[{"operator":"Exists"}]` | Tolerations - Enable pods to run an all nodes in cluster Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)