From 17d3c307a9274d4cf917f49258fe1a2653aacea4 Mon Sep 17 00:00:00 2001 From: nleconte-csgroup Date: Fri, 19 Apr 2024 10:39:18 +0200 Subject: [PATCH] feat: add dpr mockup --- README.md | 12 ++++ charts/mockup-processor-dpr/.helmignore | 23 +++++++ charts/mockup-processor-dpr/Chart.yaml | 8 +++ charts/mockup-processor-dpr/README.md | 63 ++++++++++++++++++ .../mockup-processor-dpr/templates/NOTES.txt | 4 ++ .../templates/deployment.yaml | 65 +++++++++++++++++++ .../templates/secret.yaml | 9 +++ .../templates/service.yaml | 14 ++++ charts/mockup-processor-dpr/values.yaml | 50 ++++++++++++++ 9 files changed, 248 insertions(+) create mode 100644 charts/mockup-processor-dpr/.helmignore create mode 100644 charts/mockup-processor-dpr/Chart.yaml create mode 100644 charts/mockup-processor-dpr/README.md create mode 100644 charts/mockup-processor-dpr/templates/NOTES.txt create mode 100644 charts/mockup-processor-dpr/templates/deployment.yaml create mode 100644 charts/mockup-processor-dpr/templates/secret.yaml create mode 100644 charts/mockup-processor-dpr/templates/service.yaml create mode 100644 charts/mockup-processor-dpr/values.yaml diff --git a/README.md b/README.md index b0003d6..1959b37 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,18 @@ The catalog's database is a PostgreSQL database with the PostGIS extension. It i The frontend is a simple FastAPI interface based on Swagger exposing the endpoints. A user can use it to interact with the rs-server backends (CADIP, ADGS, catalog, etc). +## [mockup-station-adgs](charts/mockup-station-adgs) + +A simple mock for ADGS station. + +## [mockup-station-cadip](charts/mockup-station-cadip) + +A simple mock for CADIP station. + +## [mockup-processor-dpr](charts/mockup-processor-dpr) + +A simple mock for DPR processor. + --- Find more documentation on the [rs-server repository](https://github.com/RS-PYTHON/rs-server). diff --git a/charts/mockup-processor-dpr/.helmignore b/charts/mockup-processor-dpr/.helmignore new file mode 100644 index 0000000..691fa13 --- /dev/null +++ b/charts/mockup-processor-dpr/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ \ No newline at end of file diff --git a/charts/mockup-processor-dpr/Chart.yaml b/charts/mockup-processor-dpr/Chart.yaml new file mode 100644 index 0000000..c6af7a6 --- /dev/null +++ b/charts/mockup-processor-dpr/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +appVersion: {{APP_VERSION}} +description: MOCKUP PROCESSOR DPR +name: mockup-processor-dpr +version: {{CHART_VERSION}} +maintainers: + - name: CS GROUP + url: https://github.com/RS-PYTHON/rs-helm \ No newline at end of file diff --git a/charts/mockup-processor-dpr/README.md b/charts/mockup-processor-dpr/README.md new file mode 100644 index 0000000..6b44672 --- /dev/null +++ b/charts/mockup-processor-dpr/README.md @@ -0,0 +1,63 @@ +# rs-server-adgs + +![Version: 0.0.1-a7](https://img.shields.io/badge/Version-0.0.1--a7-informational?style=flat-square) ![AppVersion: v0.1a7](https://img.shields.io/badge/AppVersion-v0.1a7-informational?style=flat-square) + +RS SERVER ADGS + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| CS GROUP | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| app.confDir | string | `"/app/conf"` | Config directory for the application | +| app.eodagConfigFile | string | `"adgs_ws_config.yaml"` | EODAG configuration file for the application | +| app.port | int | `8000` | Port for the application | +| app.station.endpoint.secret.password | string | `"test"` | Password to authenticate with the ADGS endpoint | +| app.station.endpoint.secret.username | string | `"test"` | Username to authenticate with the ADGS endpoint | +| app.station.endpoint.url | string | `"http://mockup-station-adgs-svc.processing.svc.cluster.local:8080/Products"` | ADGS URL | +| app.stationConfigFile | string | `"stations_cfg.json"` | Station configuration file for the application | +| app.uacURL | string | `"http://apikeymanager.processing.svc.cluster.local:8000/check/api_key"` | URL of the API Key Manager service | +| app.workDir | string | `"/app"` | Working directory for the application | +| image.PullPolicy | string | `"Always"` | Image pull policy | +| image.name | string | `"rs-server-adgs"` | Image name | +| image.registry | string | `"ghcr.io"` | Image registry | +| image.repository | string | `"rs-python"` | Image repository | +| image.tag | string | `"latest"` | Image tag version | +| ingress.host | string | `"subdomain.example.com"` | Ingress host name | +| ingress.issuer.name | string | `"letsencrypt-prod"` | Ingress Issuer name | +| ingress.issuer.type | string | `"cluster-issuer"` | Ingress Issuer type | +| ingress.path | string | `"/adgs"` | Ingress path | +| namespace | string | `"processing"` | Namespace for the deployment | +| obs.endpoint | string | `"http://minio.minio.svc.cluster.local:9000"` | URL of the object storage service endpoint | +| obs.region | string | `"sbg"` | Region of the object storage service | +| obs.secret.ak | string | `"TDr8foJqSygBQ9YFmWDy"` | Access Key to authenticate with the object storage service | +| obs.secret.sk | string | `"z2RaqjFttnVZRTsLLqmy4PE6PzJOKzPsE47alDBs"` | Secret Key to authenticate with the object storage service | +| postgres.db | string | `"rspydemo"` | PostgreSQL database name | +| postgres.host | string | `"postgresql-cluster-rw.database.svc.cluster.local"` | PostgreSQL service URL | +| postgres.port | string | `"5432"` | PostgreSQL port | +| postgres.secret.pass | string | `"test"` | Password to authenticate with the PostgreSQL service | +| postgres.secret.user | string | `"test"` | Username to authenticate with the PostgreSQL service | +| probe.liveness.initialDelaySeconds | int | `30` | InitialDelaySeconds for the liveness probe | +| probe.liveness.path | string | `"/health"` | Path for the liveness probe | +| probe.liveness.periodSeconds | int | `30` | periodSeconds for the liveness probe | +| probe.liveness.port | int | `8000` | Port for the liveness probe | +| probe.liveness.timeoutSeconds | int | `5` | timeoutSeconds for the liveness probe | +| probe.readiness.initialDelaySeconds | int | `30` | InitialDelaySeconds for the readiness probe | +| probe.readiness.path | string | `"/health"` | Path for the readiness probe | +| probe.readiness.periodSeconds | int | `30` | periodSeconds for the readiness probe | +| probe.readiness.port | int | `8000` | Port for the readiness probe | +| probe.readiness.timeoutSeconds | int | `5` | timeoutSeconds for the readiness probe | +| replicaCount | int | `1` | Number of replicas for the deployment | +| resources.limit.cpu | string | `"500m"` | Pod CPU limit | +| resources.limit.ram | string | `"1000Mi"` | Pod memory limit | +| resources.request.cpu | string | `"100m"` | Pod CPU request | +| resources.request.ram | string | `"256Mi"` | Pod memory request | +| service.port | int | `8080` | Port for the service | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/mockup-processor-dpr/templates/NOTES.txt b/charts/mockup-processor-dpr/templates/NOTES.txt new file mode 100644 index 0000000..94135a2 --- /dev/null +++ b/charts/mockup-processor-dpr/templates/NOTES.txt @@ -0,0 +1,4 @@ +{{ .Chart.Name }} +====== + +This is a chart for the installation of {{ .Release.Name }} in version {{ .Chart.Version}} \ No newline at end of file diff --git a/charts/mockup-processor-dpr/templates/deployment.yaml b/charts/mockup-processor-dpr/templates/deployment.yaml new file mode 100644 index 0000000..9c96fa3 --- /dev/null +++ b/charts/mockup-processor-dpr/templates/deployment.yaml @@ -0,0 +1,65 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: {{ .Release.Name }} + namespace: {{ .Values.namespace }} + generation: 1 + labels: + app: {{ .Release.Name }} + annotations: + deployment.kubernetes.io/revision: '1' +spec: + selector: + matchLabels: + app: {{ .Release.Name }} + replicas: {{ .Values.replicaCount }} + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 100% + maxUnavailable: 50% + template: + metadata: + name: {{ .Release.Name }} + labels: + app: {{ .Release.Name }} + type: {{ .Values.namespace }} + spec: + terminationGracePeriodSeconds: 30 + containers: + - name: {{ .Release.Name }} + image: {{ .Values.image.registry }}/{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.PullPolicy }} + resources: + requests: + memory: {{ .Values.resources.request.ram }} + cpu: {{ .Values.resources.request.cpu }} + limits: + memory: {{ .Values.resources.limit.ram }} + cpu: {{ .Values.resources.limit.cpu }} + ports: + - name: web + protocol: TCP + containerPort: {{ .Values.app.port }} + env: + - name: S3_ENDPOINT + value: {{ .Values.obs.endpoint }} + - name: S3_REGION + value: {{ .Values.obs.region }} + - name: S3_ACCESSKEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-obs + key: ak + - name: S3_SECRETKEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-obs + key: sk + securityContext: + privileged: false + #imagePullSecrets: + #- name: {{ .Values.image.imagePullSecrets }} + restartPolicy: Always + securityContext: {} + revisionHistoryLimit: 10 \ No newline at end of file diff --git a/charts/mockup-processor-dpr/templates/secret.yaml b/charts/mockup-processor-dpr/templates/secret.yaml new file mode 100644 index 0000000..92de171 --- /dev/null +++ b/charts/mockup-processor-dpr/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-obs + namespace: {{ .Values.namespace }} +type: Opaque +data: + ak: {{ .Values.obs.secret.ak | b64enc | quote }} + sk: {{ .Values.obs.secret.sk | b64enc | quote }} diff --git a/charts/mockup-processor-dpr/templates/service.yaml b/charts/mockup-processor-dpr/templates/service.yaml new file mode 100644 index 0000000..8cebc09 --- /dev/null +++ b/charts/mockup-processor-dpr/templates/service.yaml @@ -0,0 +1,14 @@ +kind: Service +apiVersion: v1 +metadata: + name: {{ .Release.Name }}-svc + labels: + app: {{ .Release.Name }}-svc +spec: + selector: + app: {{ .Release.Name }} + ports: + - name: {{ .Release.Name }}-service + protocol: TCP + port: {{ .Values.service.port }} + targetPort: {{ .Values.app.port }} \ No newline at end of file diff --git a/charts/mockup-processor-dpr/values.yaml b/charts/mockup-processor-dpr/values.yaml new file mode 100644 index 0000000..1106f1e --- /dev/null +++ b/charts/mockup-processor-dpr/values.yaml @@ -0,0 +1,50 @@ +# -- Namespace for the deployment +namespace: processing + +# -- Number of replicas for the deployment +replicaCount: 1 + +service: + # -- Port for the service + port: 8080 + +app: + # -- Port for the application + port: 8000 + +obs: + # -- URL of the object storage service endpoint + endpoint: http://minio.minio.svc.cluster.local:9000 + # -- Region of the object storage service + region: sbg + secret: + # -- Access Key to authenticate with the object storage service + ak: TDr8foJqSygBQ9YFmWDy + # -- Secret Key to authenticate with the object storage service + sk: z2RaqjFttnVZRTsLLqmy4PE6PzJOKzPsE47alDBs + +image: + #imagePullSecrets: regcred + # -- Image registry + registry: ghcr.io + # -- Image repository + repository: rs-python + # -- Image name + name: rs-testmeans_dpr-processor-mock + # -- Image tag version + tag: latest + # -- Image pull policy + PullPolicy: Always + #imagePullSecrets: regcred + +resources: + request: + # -- Pod memory request + ram: "256Mi" + # -- Pod CPU request + cpu: "100m" + limit: + # -- Pod memory limit + ram: "1000Mi" + # -- Pod CPU limit + cpu: "500m" \ No newline at end of file