Skip to content
Snippets Groups Projects
Commit bec85f9d authored by Siarhei Poliak [EPAM / GCP]'s avatar Siarhei Poliak [EPAM / GCP]
Browse files

GONRG-9462 add internal elastic by default

parent 71c1fa22
No related branches found
No related tags found
1 merge request!1423Gonrg 9462 internal elastic in gc
Pipeline #251298 failed
......@@ -75,11 +75,11 @@ Then, configure the variables in the variables.tf file using any code editor:
`data_partition_name` | Name of Data Partition ID. Must contain only lowercase letters and numbers. Maximum length is 25 characters | string | `"osdu"` | `"osdu"` | yes
`bucket_lifetime` | How many days the archived files will be stored in buckets | number | `100` | `3660` | yes
`bucket_storage_class` | Storage classes of the Cloud Storage | string | `MULTI_REGIONAL`| `STANDARD` | yes
`internal_elastic` | Elastic type. Must be configured correctly when using external elastic | bool | `true` | `true` | yes
`elastic_user` | Elastic user configurations. Must contain configuration of elastic user.| string | elastic | elastic | yes
`elastic_pass` | Elastic pass configurations. Must contain configuration of elastic pass.| string | p@ssw0rd | p@ssw0rd | yes
`elastic_host` | Elastic host configurations. Must contain configuration of elastic host.| string | elasticsearch | elasticsearch | yes
`elastic_port` | Elastic port configurations. Must contain configuration of elastic port.| string | 9200 | 9200 | yes
`internal_elastic` | Elastic type. Use internal by default, must be changed when using external | bool | `true` | `true` | yes
`elastic_user` | Elastic user configurations. Must contain configuration of elastic user `if external elastic is used`.| string | elastic | none | yes
`elastic_pass` | Elastic pass configurations. Must contain configuration of elastic pass `if external elastic is used`.| string | p@ssw0rd | none | yes
`elastic_host` | Elastic host configurations. Must contain configuration of elastic host `if external elastic is used`.| string | elasticsearch | none | yes
`elastic_port` | Elastic port configurations. Must contain configuration of elastic port `if external elastic is used`.| string | 9200 | none | yes
`vpc_network_name` | VPC network name | string | `default` | `default` | yes
`instance_tier` | Machine type | srting | `db-f1-micro` |`db-f1-micro` | yes
`db_name_entitlements` | Database name for Entitlements | string | `entitlements` | `entitlements` | yes
......
......@@ -92,7 +92,7 @@ variable "bucket_storage_class" {
# End of Buckets' inputs #
#Elastic type.
#The internal type is used by default, when using an external elastic, the default data must be changed to the correct one for the external elastic
#The internal type is used by default, when using an external elastic, the data must be changed if the external elastic is used
variable "internal_elastic" {
description = "Elastic type"
type = bool
......@@ -102,25 +102,25 @@ variable "internal_elastic" {
variable "elastic_user" {
description = "Elastic user"
type = string
default = "elastic"
default = ""
}
variable "elastic_pass" {
description = "Elastic password"
type = string
default = "p@ssw0rd"
default = ""
}
variable "elastic_host" {
description = "Elastic host"
type = string
default = "elasticsearch"
default = ""
}
variable "elastic_port" {
description = "Elastic port"
type = string
default = "9200"
default = ""
}
# postgresql
......
......@@ -170,11 +170,6 @@ elastic_port = "<REPLACE_ME>"
| **project_zone** | your Google Cloud project zone | string | `us-central1-c`| us-central1-c | yes |
| **datastore_location** | Location of Datastore (default) database. Available locations: `https://cloud.google.com/datastore/docs/locations` | string | `nam5`| nam5 | yes |
| **data_partition_name** | Name of Data Partition. Must contain only lowercase letters and numbers. Maximum length of the element is 25 characters | string | `"osdu1"` | `"osdu"` | yes
| **internal_elastic** | The default internal elastic is used. When using an external elastic, use the value false, and all credentials must be replaced with the correct ones for the external elastic | bool | `true` | `true` | yes
| **elastic_user** | Elastic user configurations. Must contain configuration of elastic user.| string | `elastic` | `elastic` | yes
| **elastic_pass** | Elastic pass configurations. Must contain configuration of elastic pass.| string | `p@ssw0rd` | `p@ssw0rd` | yes
| **elastic_host** | Elastic host configurations. Must contain configuration of elastic host.| string | `elasticsearch` | `elasticsearch` | yes
| **elastic_port** | Elastic port configurations. Must contain configuration of elastic port.| string | `9200` | `9200` | yes
| **admin_user_email** | email for admin person in project or at google identity service | string | `user@example.com` | none | yes |
| **services_deployment_enabled** | Flag that defines whether to deploy only infrastructure (false) or infrastructure with services (true) | bool | `true` | `true` | yes |
| **is_spot** | Flag that enables spot nodes in the node pool. | bool | `false` | `false` | yes |
......
......@@ -24,11 +24,6 @@ provider "google" {
module "osdu" {
source = "git::https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-gcp-provisioning.git//modules/osdu"
project_id = var.project_id
internal_elastic = var.internal_elastic
elastic_user = var.elastic_user
elastic_pass = var.elastic_pass
elastic_host = var.elastic_host
elastic_port = var.elastic_port
admin_user_email = var.admin_user_email
project_region = var.project_region
project_zone = var.project_zone
......
......@@ -42,38 +42,6 @@ variable "data_partition_name" {
default = "osdu"
}
#Elastic type.
#The internal type is used by default, when using an external elastic, the default data must be changed to the correct one for the external elastic
variable "internal_elastic" {
description = "Elastic type"
type = bool
default = "true"
}
variable "elastic_user" {
description = "Elastic user"
type = string
default = "elastic"
}
variable "elastic_pass" {
description = "Elastic password"
type = string
default = "p@ssw0rd"
}
variable "elastic_host" {
description = "Elastic host"
type = string
default = "elasticsearch"
}
variable "elastic_port" {
description = "Elastic port"
type = string
default = "9200"
}
# In case of using custom Domain Name provide value for the variable below.
# By default Google Cloud Endpoints Service will be used as a DNS record in the form of: osdu.endpoints.PROJECT_ID.cloud.goog
variable "domain" {
......
......@@ -44,6 +44,8 @@ elasticsearch:
enabled: ${elastic_enabled}
security:
elasticPassword: ${elastic_password}
service:
port: ${elastic_port}
keycloak:
enabled: false
......
......@@ -123,31 +123,35 @@ variable "sql_deletion_protection" {
}
# --- End of Postgresql vars --- #
# --- Elastic vars --- #
# --- elastic vars --- #
variable "internal_elastic" {
description = "Elastic type"
type = bool
default = "true"
default = true
}
variable "elastic_user" {
description = "Elastic user"
type = string
default = ""
}
variable "elastic_pass" {
description = "Elastic password"
type = string
default = ""
}
variable "elastic_host" {
description = "Elastic host"
type = string
default = ""
}
variable "elastic_port" {
description = "Elastic port"
type = string
default = ""
}
# --- End of Elastic vars --- #
......
......@@ -21,21 +21,21 @@ locals {
"DATA_PARTITION_ID" = var.data_partition_name
},
"elastic-bootstrap-gcsm" = {
"ELASTIC_HOST_SYSTEM" = var.elastic_host
"ELASTIC_PASS_SYSTEM" = var.elastic_pass
"ELASTIC_PORT_SYSTEM" = var.elastic_port
"ELASTIC_USER_SYSTEM" = var.elastic_user
"ELASTIC_HOST_SYSTEM" = var.elastic_host != "" ? var.elastic_host : "elasticsearch"
"ELASTIC_PASS_SYSTEM" = var.elastic_pass != "" ? var.elastic_pass : random_password.elastic.result
"ELASTIC_PORT_SYSTEM" = var.elastic_port != "" ? var.elastic_port : "9200"
"ELASTIC_USER_SYSTEM" = var.elastic_user != "" ? var.elastic_user : "elastic"
},
"search-gcsm" = {
"ELASTIC_HOST_SYSTEM" = var.elastic_host
"ELASTIC_HOST_SYSTEM" = var.elastic_host != "" ? var.elastic_host : "elasticsearch"
"ELASTIC_PASS_SYSTEM" = random_password.search.result
"ELASTIC_PORT_SYSTEM" = var.elastic_port
"ELASTIC_PORT_SYSTEM" = var.elastic_port != "" ? var.elastic_port : "9200"
"ELASTIC_USER_SYSTEM" = format("%s-%s", "search-service", random_id.name_suffix.hex)
},
"indexer-gcsm" = {
"ELASTIC_HOST_SYSTEM" = var.elastic_host
"ELASTIC_HOST_SYSTEM" = var.elastic_host != "" ? var.elastic_host : "elasticsearch"
"ELASTIC_PASS_SYSTEM" = random_password.indexer.result
"ELASTIC_PORT_SYSTEM" = var.elastic_port
"ELASTIC_PORT_SYSTEM" = var.elastic_port != "" ? var.elastic_port : "9200"
"ELASTIC_USER_SYSTEM" = format("%s-%s", "indexer-service", random_id.name_suffix.hex)
},
"entitlements-gcsm" = merge([
......
......@@ -19,6 +19,15 @@ resource "random_id" "name_suffix" {
byte_length = 4
}
# Elastic
resource "random_password" "elastic" {
length = 20
lower = true
numeric = true
upper = true
special = false
}
# PostgreSQL
resource "random_password" "db_password" {
length = 20
......
......@@ -37,8 +37,9 @@ resource "local_file" "helm_values" {
schema_version = var.schema_version
schema_name = var.schema_name
# elastic
elastic_password = var.elastic_pass
elastic_enabled = var.internal_elastic
elastic_password = var.elastic_pass != "" ? var.elastic_pass : random_password.elastic.result
elastic_enabled = var.internal_elastic != "" ? var.internal_elastic : "true"
elastic_port = var.elastic_port != "" ? var.elastic_port : "9200"
# policy
policy_bucket = "${var.project_id}-opa-policies"
opa_image = local.opa_image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment