From 1ec0cce1d9fb80bf9bbf8a46feeed6dd5e3306cd Mon Sep 17 00:00:00 2001
From: "Aliaksandr Ramanovich (EPAM)" <aliaksandr_ramanovich1@epam.com>
Date: Fri, 3 Jan 2025 15:30:41 +0000
Subject: [PATCH] gc: add tls flags for partition template

---
 devops/gc/deploy/README.md                          | 1 +
 devops/gc/deploy/templates/configmap-bootstrap.yaml | 1 +
 devops/gc/deploy/values.yaml                        | 1 +
 devops/gc/pipeline/override-stages.yml              | 4 ++++
 provider/partition-gc/bootstrap/data_gc.sh          | 8 ++++++++
 5 files changed, 15 insertions(+)

diff --git a/devops/gc/deploy/README.md b/devops/gc/deploy/README.md
index 6918be0c8..ef0bd0c83 100644
--- a/devops/gc/deploy/README.md
+++ b/devops/gc/deploy/README.md
@@ -115,6 +115,7 @@ First you need to set variables in **values.yaml** file using any code editor. S
 **data.partitionNamespace** | datastore namespace where partition will store the data | string | `partition` | yes
 **data.datafierSa** | datafier service account | string | `datafier` | yes
 **data.indexerAugmenterEnabled** | enable indexer Augmenter | string | `false` | no
+**data.elasticHttps** | Configuration of the communication protocol for search and indexer services | boolean | - | yes |
 
 ### Deployment variables
 
diff --git a/devops/gc/deploy/templates/configmap-bootstrap.yaml b/devops/gc/deploy/templates/configmap-bootstrap.yaml
index 3f354266b..93e995adc 100644
--- a/devops/gc/deploy/templates/configmap-bootstrap.yaml
+++ b/devops/gc/deploy/templates/configmap-bootstrap.yaml
@@ -29,3 +29,4 @@ data:
   {{- end }}
   SERVICE_ACCOUNT: {{ printf "%s@%s.iam.gserviceaccount.com" .Values.data.datafierSa .Values.data.projectId | quote }}
   DATABASE_ID: "{{ $databaseId }}"
+  ELASTIC_HTTPS: {{ .Values.data.elasticHttps | quote}}
diff --git a/devops/gc/deploy/values.yaml b/devops/gc/deploy/values.yaml
index f1ac971b1..4986a1a3e 100644
--- a/devops/gc/deploy/values.yaml
+++ b/devops/gc/deploy/values.yaml
@@ -21,6 +21,7 @@ data:
   edsEnabled: "false"
   autocompleteEnabled: "true"
   databaseId: ""
+  elasticHttps: ""
   # deployments
   requestsCpu: "5m"
   requestsMemory: "350Mi"
diff --git a/devops/gc/pipeline/override-stages.yml b/devops/gc/pipeline/override-stages.yml
index a0d764c3d..0600cd1f4 100644
--- a/devops/gc/pipeline/override-stages.yml
+++ b/devops/gc/pipeline/override-stages.yml
@@ -37,6 +37,7 @@ gc-deploy: # reuse common deploy job for test deployment
       --set istio.sidecarInject=false
       --set data.edsEnabled=true
       --set data.databaseId=\(default\)
+      --set data.elasticHttps=true
     GC_SA_EMAIL: $GC_SA_GKE_EMAIL
 
 gc-test:
@@ -83,6 +84,7 @@ gc-verified-deploy: # verified deploy after tests
     GC_HELM_SETS: >-
       --set data.edsEnabled=true
       --set data.databaseId=\(default\)
+      --set data.elasticHttps=true
 
 # Dev2 jobs
 gc-dev2-deploy: # reuse common deploy job for test deployment
@@ -139,6 +141,7 @@ gc-dev2-verified-deploy: # verified deploy after tests
     GC_HELM_SETS: >-
       --set data.edsEnabled=true
       --set data.databaseId=\(default\)
+      --set data.elasticHttps=true
 
 gc-preship-deploy:
   extends: .gc-preship-variables
@@ -151,3 +154,4 @@ gc-preship-deploy:
       --set global.dataPartitionId=m19
       --set data.edsEnabled=true
       --set data.databaseId=\(default\)
+      --set data.elasticHttps=true
diff --git a/provider/partition-gc/bootstrap/data_gc.sh b/provider/partition-gc/bootstrap/data_gc.sh
index a765d8fca..50fe27f7e 100644
--- a/provider/partition-gc/bootstrap/data_gc.sh
+++ b/provider/partition-gc/bootstrap/data_gc.sh
@@ -112,6 +112,14 @@ gc_partition_data() {
     "elasticsearch.8.password": {
       "sensitive": true,
       "value": "ELASTIC_PASS${PARTITION_SUFFIX}"
+    },
+    "elasticsearch.8.https": {
+      "sensitive": false,
+      "value": "${ELASTIC_HTTPS}"
+    },
+    "elasticsearch.8.tls": {
+      "sensitive": false,
+      "value": "${ELASTIC_HTTPS}"
     }
   }
 }
-- 
GitLab