Skip to content

Commit

Permalink
deploy: add prom service monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiraudo authored and alambare committed Jun 21, 2024
1 parent 5cffcfc commit bb1ca21
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 78 deletions.
6 changes: 3 additions & 3 deletions charts/eodag-server/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.19.3
digest: sha256:de997835d9ce9a9deefc2d70d8c62b11aa1d1a76ece9e86a83736ab9f930bf4d
generated: "2024-06-03T18:43:30.71045378+02:00"
version: 2.4.0
digest: sha256:b371e6f7f1449fa3abdcb97a04b0bbb2b5d36a4facb8e79041ac36a455b02bb0
generated: "2023-06-19T12:39:44.271254606+02:00"
6 changes: 3 additions & 3 deletions charts/eodag-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v2
appVersion: 2.12.1
appVersion: 3.0.0
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
tags:
- bitnami-common
version: 2.x.x
version: 2.x
description: EODAG (Earth Observation Data Access Gateway) is a tool for searching,
aggregating results and downloading remote sensed images offering a unified API
for data access regardless of the data provider.
Expand All @@ -15,4 +15,4 @@ name: eodag-server
sources:
- https://github.com/CS-SI/eodag
type: application
version: 2.12.1
version: 2.13.0
7 changes: 2 additions & 5 deletions charts/eodag-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The command removes all the Kubernetes components associated with the chart and
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |


### Common parameters

| Name | Description | Value |
Expand All @@ -59,6 +60,7 @@ The command removes all the Kubernetes components associated with the chart and
| `clusterDomain` | Kubernetes cluster domain name | `cluster.local` |
| `extraDeploy` | Array of extra objects to deploy with the release | `[]` |


### EODAG Server parameters

| Name | Description | Value |
Expand Down Expand Up @@ -177,11 +179,6 @@ The command removes all the Kubernetes components associated with the chart and
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
| `serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
| `serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` |
| `autoscaling.enabled` | Enable autoscaling | `false` |
| `autoscaling.minReplicas` | Minimum number of replicas | `1` |
| `autoscaling.maxReplicas` | Maximum number of replicas | `10` |
| `autoscaling.targetCPU` | Target CPU utilization percentage | `""` |
| `autoscaling.targetMemory` | Target Memory utilization percentage | `""` |


```console
Expand Down
10 changes: 9 additions & 1 deletion charts/eodag-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,22 @@ spec:
- name: EODAG_LOGGING
value: {{ .Values.logLevel | quote }}
{{- end }}
- name: EODAG_CORS_ALLOWED_ORIGINS
value: "*"
{{- if .Values.otel.enabled }}
{{- if .Values.otel.endpoint }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .Values.otel.endpoint | quote }}
{{- end }}
{{- if .Values.otel.timeout }}
- name: OTEL_EXPORTER_OTLP_TIMEOUT
value: {{ .Values.otel.timeout | quote }}
{{- end }}
{{- if .Values.otel.interval }}
- name: OTEL_METRIC_EXPORT_INTERVAL
value: {{ .Values.otel.interval | quote }}
{{- end }}
{{- end }}
{{- if or .Values.extraEnvVarsCM .Values.extraEnvVarsSecret }}
envFrom:
{{- if .Values.extraEnvVarsCM }}
Expand Down Expand Up @@ -200,7 +208,7 @@ spec:
protocol: TCP
volumeMounts:
- name: config
mountPath: /etc/otelcol/config.yaml
mountPath: /etc/otelcol-contrib/config.yaml
subPath: otelcol_config.yml
{{- end }}
{{- if .Values.sidecars }}
Expand Down
48 changes: 0 additions & 48 deletions charts/eodag-server/templates/hpa.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/eodag-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
nodePort: null
{{- end }}
{{- if and .Values.otel.enabled .Values.otel.collector.enabled }}
- port: 8888
- port: 9090
targetPort: prom-exporter
protocol: TCP
name: metrics
Expand Down
37 changes: 37 additions & 0 deletions charts/eodag-server/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- if and .Values.otel.enabled .Values.otel.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: metrics
path: /metrics
{{- if .Values.otel.serviceMonitor.interval }}
interval: {{ .Values.otel.serviceMonitor.interval }}
{{- end }}
{{- if .Values.otel.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.otel.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.otel.serviceMonitor.relabelings }}
relabelings:
{{- include "common.tplvalues.render" (dict "value" .Values.otel.serviceMonitor.relabelings "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.otel.serviceMonitor.relabelings }}
metricRelabelings:
{{- include "common.tplvalues.render" (dict "value" .Values.otel.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "common.names.namespace" . }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
{{- end }}
48 changes: 31 additions & 17 deletions charts/eodag-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,43 @@ otel:
image:
registry: docker.io
repository: otel/opentelemetry-collector-contrib
tag: "0.90.1"
tag: "0.95.0"
ports:
otlpReceiver: 4318
prometheusExporter: 8888
prometheusExporter: 8000
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: IfNotPresent
serviceMonitor:
## @param otel.serviceMonitor.enabled if `true`, creates a Prometheus Operator PodMonitor
##
enabled: false
## @param otel.serviceMonitor.namespace Namespace for the PodMonitor Resource (defaults to the Release Namespace)
##
namespace: ""
## @param otel.serviceMonitor.interval Interval at which metrics should be scraped.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
## e.g:
## interval: 10s
##
interval: ""
## @param otel.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
## e.g:
## scrapeTimeout: 10s
##
scrapeTimeout: ""
## @param otel.serviceMonitor.labels Labels that can be used so PodMonitor will be discovered by Prometheus
##
labels: {}
## @param otel.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping
##
relabelings: []
## @param otel.serviceMonitor.metricRelabelings MetricRelabelConfigs to apply to samples before ingestion
##
metricRelabelings: []

## @param replicaCount Number of EODAG Server replicas
##
Expand Down Expand Up @@ -552,7 +580,7 @@ config:
# credentials:
# username:
# password:
# usgs:
# cop_cds:
# priority: # Lower value means lower priority (Default: 0)
# api:
# outputs_prefix:
Expand Down Expand Up @@ -763,17 +791,3 @@ serviceAccount:
## @param serviceAccount.automountServiceAccountToken Automount service account token for the server service account
##
automountServiceAccountToken: true

## Autoscaling configuration
## @param autoscaling.enabled Enable autoscaling
## @param autoscaling.minReplicas Minimum number of replicas
## @param autoscaling.maxReplicas Maximum number of replicas
## @param autoscaling.targetCPU Target CPU utilization percentage
## @param autoscaling.targetMemory Target Memory utilization percentage
##
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
targetCPU: ""
targetMemory: ""

0 comments on commit bb1ca21

Please sign in to comment.