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