From e54f1479ed4b8f442560eca06c03c9319669a32c Mon Sep 17 00:00:00 2001
From: Remi  PLANEL <rplanel@pasteur.fr>
Date: Mon, 6 Nov 2023 15:00:39 +0100
Subject: [PATCH] set path to values files

---
 .gitlab-ci.yml                         | 10 ++---
 deploy/df-wiki/values.development.yaml | 37 ++++++++++++++++++-
 deploy/df-wiki/values.production.yaml  | 51 ++++++++++++++++++++++----
 deploy/df-wiki/values.yaml             |  8 +---
 4 files changed, 84 insertions(+), 22 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bce3b19f..69c55d3e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -124,9 +124,8 @@ build:prod:
   stage: deploy
   image: harbor.pasteur.fr/kube-system/helm-kubectl:$HELM_VERSION
   variables:
-    CI_DEBUG_TRACE: "true"
+    CI_DEBUG_TRACE: "false"
     TEAM_ID: "df"
-    DEPLOY_STRATEGY: RollingUpdate
 
   script:
     - helm dependency update deploy/df-wiki/
@@ -137,14 +136,12 @@ build:prod:
       --set registry.password=${DEPLOY_TOKEN}
       --set registry.host=${CI_REGISTRY}
       --set ingress.hosts[0].host="${PUBLIC_URL}"
-      --set ingress.hosts[0].paths[0].path="/wiki"
-      --set ingress.hosts[0].paths[0].pathType="Prefix"
       --set imagePullSecrets[0].name="registry-pull-secret-${CI_COMMIT_REF_SLUG}"
       --set image.repository="$CI_REGISTRY_IMAGE/$IMAGE_NAME"
       --set image.tag="$CI_COMMIT_SHORT_SHA"
       --set env="${ENV:-development}"
-      --values values.yaml
-      --values values.${ENV:-development}.yaml
+      --values deploy/df-wiki/values.yaml
+      --values deploy/df-wiki/values.${ENV:-development}.yaml
 
 deploy:dev:
   extends: .deploy
@@ -157,6 +154,7 @@ deploy:dev:
     NODE_ENV: "development"
     KUBE_NAMESPACE: "defense-finder-dev"
     PUBLIC_URL: "defense-finder.dev.pasteur.cloud"
+    CI_DEBUG_TRACE: "true"
     ENV: "development"
   environment:
     name: k8sdev-01
diff --git a/deploy/df-wiki/values.development.yaml b/deploy/df-wiki/values.development.yaml
index 719e6d53..16e39d5e 100644
--- a/deploy/df-wiki/values.development.yaml
+++ b/deploy/df-wiki/values.development.yaml
@@ -11,4 +11,39 @@ ingress:
         - path: /wiki
           pathType: Prefix
 strategy:
-  type: Recreate
\ No newline at end of file
+  type: Recreate
+
+resources:
+  limits:
+    cpu: 300m
+    memory: 400Mi
+  requests:
+    cpu: 200m
+    memory: 256Mi
+
+autoscaling:
+  enabled: false
+
+
+meilisearch:
+  environment:
+    MEILI_MASTER_KEY: "MASTER_KEY"
+  ingress:
+    enabled: true
+    className: internal
+    annotations:
+      nginx.ingress.kubernetes.io/proxy-body-size: 100m
+    hosts:
+      - "defense-finder-meilisearch.dev.pasteur.cloud"
+    path: /
+  persistence:
+    enabled: true
+    storageClass: isilon
+    size: "1Gi"
+  resources: 
+    limits:
+      cpu: 1000m
+      memory: 1Gi
+    requests:
+      cpu: 800m
+      memory: 800Mi
\ No newline at end of file
diff --git a/deploy/df-wiki/values.production.yaml b/deploy/df-wiki/values.production.yaml
index 8cff37f6..2abd4827 100644
--- a/deploy/df-wiki/values.production.yaml
+++ b/deploy/df-wiki/values.production.yaml
@@ -1,17 +1,52 @@
+image:
+  pullPolicy: Always
+
 ingress:
   enabled: false
-  className: ""
   annotations:
     - kubernetes.io/ingress.class: internal
-    # nginx.ingress.kubernetes.io/rewrite-target: /$2
-    # kubernetes.io/ingress.class: nginx
-    # kubernetes.io/tls-acme: "true"
   hosts:
     - host: chart-example.local
       paths:
         - path: /wiki
           pathType: Prefix
-  tls: []
-  #  - secretName: chart-example-tls
-  #    hosts:
-  #      - chart-example.local
+strategy:
+  type: RollingUpdate
+
+resources:
+  limits:
+    cpu: 1000m
+    memory: 700Mi
+  requests:
+    cpu: 1000m
+    memory: 1Gi
+
+autoscaling:
+  enabled: true
+  minReplicas: 1
+  maxReplicas: 5
+  targetCPUUtilizationPercentage: 80
+  # targetMemoryUtilizationPercentage: 80 
+
+meilisearch:
+  environment:
+    MEILI_MASTER_KEY: "MASTER_KEY"
+  ingress:
+    enabled: true
+    className: internal
+    annotations:
+      nginx.ingress.kubernetes.io/proxy-body-size: 100m
+    hosts:
+      - "defense-finder-meilisearch.pasteur.cloud"
+    path: /
+  persistence:
+    enabled: true
+    storageClass: isilon
+    size: "10Gi"
+  resources: 
+    limits:
+      cpu: 2000m
+      memory: 3Gi
+    requests:
+      cpu: 1000m
+      memory: 1Gi
\ No newline at end of file
diff --git a/deploy/df-wiki/values.yaml b/deploy/df-wiki/values.yaml
index 738d7f95..fd0eaf46 100644
--- a/deploy/df-wiki/values.yaml
+++ b/deploy/df-wiki/values.yaml
@@ -63,13 +63,7 @@ ingress:
   #    hosts:
   #      - chart-example.local
 
-resources:
-  limits:
-    cpu: 300m
-    memory: 400Mi
-  requests:
-    cpu: 200m
-    memory: 256Mi
+resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
-- 
GitLab