### Using DB Module with Existing Database HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/db/README.md Provides an example of how to instantiate the database module (`./db`) in HCL, configuring it to connect to an existing database. It demonstrates setting the `db_existing` variable with specific values for the port, read-only endpoint, and read-write endpoint. ```HCL module "database" { source = "./db" db_existing = { port = 3306 ro = "read-endpoint.example.com" rw = "write-endpoint.example.com" } } ``` -------------------------------- ### Deploying All Components with bin/operator - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to deploy all components managed by the `bin/operator` script. Running the script without any arguments triggers a full deployment. ```bash bin/operator ``` -------------------------------- ### Testing EKS Cluster Deployment with bin/operator (Environment Example) - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command, shown in the `bin/environment` section, demonstrating how to perform a dry run test of EKS cluster deployment using the `bin/operator` script with the `eks` component and the `-t` (test) option. ```bash bin/operator eks -t ``` -------------------------------- ### Configure Module to Deploy New MinIO (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/file/README.md Example demonstrating how to configure the `file_storage` Terraform module to deploy a new MinIO instance. This involves providing credentials (`file`), internal settings (`file_internal`), and resource allocation details (`file_resources`). ```HCL module "file_storage" { source = "./file" file = { password = "securepassword" upload_bucket = "uploads" username = "minio-user" } file_internal = { node = "high-storage" port = 9000 service = "minio-storage" version = "6.0.3" } file_resources = { pool_size = "500Gi" pool_servers = 4 pool_server_volumes = 1 resources = { limits = { cpu = "1" memory = "2Gi" } requests = { cpu = "500m" memory = "1Gi" } } ssl = true } } ``` -------------------------------- ### Creating EKS Cluster with bin/environment - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to set up a new EKS cluster using the `bin/environment` script with the `eks` component. Requires prior configuration in `env.tfvars` including VPC and subnet IDs. ```bash bin/environment eks ``` -------------------------------- ### Using DB Module to Deploy New Cluster HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/db/README.md Provides an example of how to instantiate the database module (`./db`) in HCL to deploy a new Percona XtraDB Cluster. It demonstrates setting the `db`, `db_internal`, and `db_resources` variables with configurations for database credentials, internal settings (like backup, PMM, version), and resource allocation (PV size, replicas, CPU/memory limits/requests). ```HCL module "database" { source = "./db" db = { db_name = "myapp" db_password = "securepassword" db_root_password = "securerootpassword" db_username = "myappuser" } db_internal = { backup = true disable_unsafe_checks = false logcollector_enable = true node = "high-memory" pmm_enable = true port = 3306 service = "myapp-db" version = "8.0" } db_resources = { pv_size = "50Gi" replicas = 3 resources = { limits = { cpu = "2" memory = "4Gi" } requests = { cpu = "1" memory = "2Gi" } } } } ``` -------------------------------- ### Configure Module to Deploy New OpenSearch Instance (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/search/README.md Example Terraform HCL code demonstrating how to configure the 'search' module to deploy a new OpenSearch instance. It sets variables for credentials ('search'), internal deployment settings ('search_internal'), and resource allocation ('search_resources'). ```hcl module "search" { source = "./search" search = { index = "my-index" password = "securepassword" root_password = "securerootpassword" user = "opensearch-user" } search_internal = { node = "high-memory" port = 9200 service = "my-opensearch" version = "2.16.0" } search_resources = { pv_size = "50Gi" replicas = 3 resources = { requests = { cpu = "2" memory = "4Gi" } } } } ``` -------------------------------- ### Deploying Specific App Pod with bin/operator - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to deploy a specific application pod, `groundx`, using the `bin/operator` script. This allows for granular control over individual application deployments. ```bash bin/operator groundx ``` -------------------------------- ### Testing Init Task Deployment with bin/operator - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to perform a dry run test of deploying an initialization task, `add`, using the `bin/operator` script with the `-t` (test) option. ```bash bin/operator add -t ``` -------------------------------- ### Creating AWS VPC with bin/environment - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to create a new AWS VPC and subnets using the `bin/environment` script with the `aws-vpc` component. This is a prerequisite for setting up an EKS cluster. ```bash bin/environment aws-vpc ``` -------------------------------- ### Deploying GroundX On-Prem to Kubernetes (Bash) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Executes the main setup script for GroundX On-Prem. This script uses the configured `env.tfvars` file to create a new namespace and deploy the GroundX services into the target Kubernetes cluster (either existing or newly created EKS). ```bash operator/setup ``` -------------------------------- ### Configure Module with Existing MinIO (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/file/README.md Example showing how to configure the `file_storage` Terraform module to connect to an existing MinIO instance. This is achieved by providing the necessary connection details within the `file_existing` block. ```HCL module "file_storage" { source = "./file" file_existing = { base_domain = "minio.example.com" bucket = "my-bucket" password = "securepassword" port = 9000 ssl = true username = "minio-user" } } ``` -------------------------------- ### Copying GroundX On-Prem Configuration File (Bash) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Copies the example Terraform configuration file (`env.tfvars.example`) to the active configuration file (`env.tfvars`). This file is used by Terraform to configure the GroundX On-Prem deployment, requiring modification for admin credentials and optional settings. ```bash cp operator/env.tfvars.example operator/env.tfvars ``` -------------------------------- ### Destroying EKS Cluster with bin/operator (Environment Example) - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command, shown in the `bin/environment` section, demonstrating how to destroy an EKS cluster using the `bin/operator` script with the `eks` component and the `-c` (clear/destroy) option. ```bash bin/operator eks -c ``` -------------------------------- ### Deploying Services Group with bin/operator - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to deploy a specific functional group, the `services` group, using the `bin/operator` script. This group includes components like cache, db, file, search, and stream. ```bash bin/operator services ``` -------------------------------- ### Configure Module to Use Existing OpenSearch Instance (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/search/README.md Example Terraform HCL code demonstrating how to configure the 'search' module to connect to an existing OpenSearch instance. It sets the 'search_existing' variable with the base domain, base URL, and port of the existing instance. ```hcl module "search" { source = "./search" search_existing = { base_domain = "opensearch.example.com" base_url = "https://opensearch.example.com:9200" port = 9200 } } ``` -------------------------------- ### Using Existing Redis Cache Configuration (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/cache/README.md Demonstrates how to configure the `cache` module to connect to an existing Redis cache. It sets the `cache_existing` variable with the address, instance flag, and port of the external Redis instance. This example assumes the `cache` module is sourced from the local `./cache` directory. ```HCL module "cache" { source = "./cache" cache_existing = { addr = "redis.example.com" is_instance = true port = 6379 } } ``` -------------------------------- ### Deploying New Redis Cache with Custom Settings (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/cache/README.md Provides an example of how to configure the `cache` module to deploy a new Redis cache with specific internal settings and resource allocations. It sets the `cache_internal` variable to customize the image, path, node, port, service, and version, and the `cache_resources` variable to define replicas, CPU, and memory limits/requests. ```HCL module "cache" { source = "./cache" cache_internal = { image = { repository = "custom-redis" tag = "6.2" } mount_path = "/data/redis" node = "high-memory" port = 6380 service = "my-redis" version = "6.2" } cache_resources = { replicas = 3 resources = { limits = { cpu = "2" memory = "4Gi" } requests = { cpu = "1" memory = "2Gi" } } } } ``` -------------------------------- ### Getting GroundX On-Prem API Endpoint (Bash) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Uses `kubectl` to retrieve service information within the `eyelevel` namespace after deployment. The output will include the external IP address of the GroundX load balancer, which serves as the API endpoint. ```bash kubectl -n eyelevel get svc ``` -------------------------------- ### Using Existing Kafka Module (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/stream/README.md Demonstrates how to use the `stream` module to configure the application to connect to an existing Kafka instance. This is achieved by setting the `stream_existing` variable with the specific `base_domain`, `base_url`, and `port` of the existing Kafka cluster. ```HCL module "stream" { source = "./stream" stream_existing = { base_domain = "kafka.example.com" base_url = "kafka://kafka.example.com:9092" port = 9092 } } ``` -------------------------------- ### Destroying Specific Service with bin/operator - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Example command to destroy a specific service component, the `db` service, using the `bin/operator` script with the `-c` (clear/destroy) option. ```bash bin/operator db -c ``` -------------------------------- ### Deploying New Kafka Cluster Module (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/stream/README.md Demonstrates how to use the `stream` module to deploy a new Kafka cluster. This is done by configuring the `stream_internal` variable with basic settings (node, port, service, version) and the `stream_resources` variable with detailed resource allocation and configuration for partitions, retention, segment size, service, zookeeper, and general resource limits/requests. ```HCL module "stream" { source = "./stream" stream_internal = { node = "high-cpu" port = 9092 service = "my-kafka" version = "3.4.0" } stream_resources = { partitions = 6 retention_bytes = 2147483648 # 2GB segment_bytes = 536870912 # 512MB service = { replicas = 5 storage = "50Gi" } zookeeper = { replicas = 3 storage = "20Gi" } resources = { limits = { cpu = "2" memory = "4Gi" } requests = { cpu = "1" memory = "2Gi" } } } } ``` -------------------------------- ### Defining DB Credentials Variable HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/db/README.md Defines the structure for the `db` variable, which holds the necessary credentials for creating a new database within the deployed cluster. It is an object containing string fields for the database name, user password, root password, and username. ```HCL variable "db" { type = object({ db_name = string db_password = string db_root_password = string db_username = string }) } ``` -------------------------------- ### Define Variable for Search Service Credentials (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/search/README.md Defines a Terraform variable object type for configuring OpenSearch credentials and index information. This includes the desired index name, user, password, and root password for accessing the OpenSearch instance. ```hcl variable "search" { type = object({ index = string password = string root_password = string user = string }) } ``` -------------------------------- ### Define New MinIO Credentials Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/file/README.md Defines a Terraform variable `file` of type object to hold credentials and the upload bucket name for a *new* MinIO deployment managed by this module. These credentials will be used by the application to interact with the deployed MinIO instance. ```HCL variable "file" { type = object({ password = string upload_bucket = string username = string }) } ``` -------------------------------- ### Define Variable for Internal OpenSearch Deployment Settings (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/search/README.md Defines a Terraform variable object type for customizing settings when deploying a new OpenSearch instance internally. Key parameters include the node type, port, service name, and OpenSearch version. ```hcl variable "search_internal" { type = object({ chart = object({...}) image = object({...}) node = string port = number service = string version = string }) } ``` -------------------------------- ### Defining Redis Resource Allocation Configuration (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/cache/README.md Defines the HCL variable structure for specifying resource limits and requests for a new Redis deployment. It includes the number of replicas (`replicas`) and nested objects for CPU and memory `limits` and `requests`. This allows control over the resources allocated to the Redis pods. ```HCL variable "cache_resources" { type = object({ replicas = number resources = object({ limits = object({ cpu = string memory = string }) requests = object({ cpu = string memory = string }) }) }) } ``` -------------------------------- ### Define Variable for OpenSearch Resource Allocation (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/search/README.md Defines a Terraform variable object type for controlling resource allocation for a new OpenSearch deployment. This includes specifying the persistent volume size, the number of replicas for high availability, and CPU/memory requests for the nodes. ```hcl variable "search_resources" { type = object({ pv_size = string replicas = number resources = object({ requests = object({ cpu = string memory = string }) }) }) } ``` -------------------------------- ### Defining DB Resource Allocation Variable HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/db/README.md Defines the structure for the `db_resources` variable, controlling resource allocation for a new Percona XtraDB Cluster deployment. It specifies the size of persistent volumes (`pv_size`), the number of replicas, and resource limits and requests (CPU/memory) for database nodes and the HAProxy proxy. ```HCL variable "db_resources" { type = object({ proxy = object({...}) pv_size = string replicas = number resources = object({ limits = object({...}) requests = object({...}) }) }) } ``` -------------------------------- ### Define MinIO Resource Allocation Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/file/README.md Defines a Terraform variable `file_resources` of type object to control resource allocation and storage pool configuration for a *new* MinIO deployment. This variable allows customization of storage size, server/volume counts, CPU/memory limits, and SSL enablement. ```HCL variable "file_resources" { type = object({ operator = object({...}) pool_size = string pool_servers = number pool_server_volumes = number pv_path = string resources = object({...}) ssl = bool }) } ``` -------------------------------- ### Defining Existing DB Variable HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/db/README.md Defines the structure for the `db_existing` variable used to configure connection details for an already provisioned database. It specifies the required type as an object with numeric port and string read-only (ro) and read-write (rw) endpoints. This variable should be left null if deploying a new database. ```HCL variable "db_existing" { type = object({ port = number ro = string rw = string }) } ``` -------------------------------- ### Define Existing MinIO Configuration Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/file/README.md Defines a Terraform variable `file_existing` of type object to hold configuration details for connecting to an existing MinIO instance. This variable should be populated if you are using an external MinIO deployment instead of letting the module deploy a new one. ```HCL variable "file_existing" { type = object({ base_domain = string bucket = string password = string port = number ssl = bool username = string }) } ``` -------------------------------- ### Define Variable for Existing OpenSearch Configuration (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/search/README.md Defines a Terraform variable object type for specifying parameters of an existing OpenSearch instance. This variable is used to connect the application to a pre-existing deployment instead of creating a new one. Parameters include the base domain, full URL, and port. ```hcl variable "search_existing" { type = object({ base_domain = string base_url = string port = number }) } ``` -------------------------------- ### Define Internal MinIO Settings Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/file/README.md Defines a Terraform variable `file_internal` of type object for configuring internal aspects of a *new* MinIO deployment. This includes settings related to the Helm chart, node affinity, port, service name, and MinIO version. ```HCL variable "file_internal" { type = object({ chart_base = string chart_repository = string node = string operator = object({...}) port = number pv_access = string service = string tenant = object({...}) version = string }) } ``` -------------------------------- ### Defining Kafka Resources Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/stream/README.md Defines the HCL variable `stream_resources` used to control resource allocation and configuration for a new Kafka deployment. It is an object type allowing customization of operator settings, topic partitions, log retention/segment sizes, service replicas/storage, and Zookeeper replicas/storage. ```HCL variable "stream_resources" { type = object({ operator = object({...}) partitions = number resources = object({...}) retention_bytes = number segment_bytes = number service = object({...}) zookeeper = object({...}) }) } ``` -------------------------------- ### Defining Existing Kafka Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/stream/README.md Defines the HCL variable `stream_existing` used to configure the module to connect to an existing Kafka instance. It is an object type specifying the required parameters: `base_domain`, `base_url`, and `port`. Leave this variable null to trigger the deployment of a new Kafka instance. ```HCL variable "stream_existing" { type = object({ base_domain = string base_url = string port = number }) } ``` -------------------------------- ### Defining New Redis Deployment Configuration (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/cache/README.md Defines the HCL variable structure for configuring parameters when deploying a new Redis cache. It includes settings for the Redis image (`image`), persistence path (`mount_path`), node type (`node`), operator version (`operator_version`), port (`port`), service name (`service`), and Redis version (`version`). These settings are used by the Helm deployment. ```HCL variable "cache_internal" { type = object({ image = object({...}) is_instance = bool mount_path = string node = string operator_version = string port = number service = string version = string }) } ``` -------------------------------- ### Defining Existing Redis Cache Configuration (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/cache/README.md Defines the HCL variable structure for specifying details of an already existing Redis cache. It includes fields for the cache address (`addr`), whether it's a standalone instance (`is_instance`), and the port number (`port`). This variable should be set if you are not deploying a new cache. ```HCL variable "cache_existing" { type = object({ addr = string is_instance = bool port = number }) } ``` -------------------------------- ### Defining Internal DB Settings Variable HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/db/README.md Defines the structure for the `db_internal` variable, used to customize various internal settings for a new Percona XtraDB Cluster deployment. This object includes boolean flags for features like backup, log collection, and PMM, along with string fields for node type, service name, and version, and a numeric port. ```HCL variable "db_internal" { type = object({ backup = bool chart = object({...}) disable_unsafe_checks = bool ip_type = string logcollector_enable = bool node = string pmm_enable = bool port = number service = string version = string }) } ``` -------------------------------- ### Defining Internal Kafka Variable (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/services/stream/README.md Defines the HCL variable `stream_internal` used to configure parameters for deploying a new Kafka cluster if no existing instance is specified. It is an object type containing settings like the Helm chart details (`url`, `version`), node type, port, service name, and Kafka version. ```HCL variable "stream_internal" { type = object({ chart = object({ url = string version = string }) node = string port = number service = string version = string }) } ``` -------------------------------- ### Configuring GroundX Python SDK Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md This snippet shows how to initialize the GroundX Python client using your admin API key and the base URL for your On-Prem instance. The base URL is constructed by appending '/api' to your external IP address. ```python from groundx import GroundX external_ip = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxx.us-east-2.elb.amazonaws.com' api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" client = GroundX(api_key=api_key, base_url=f"http://{external_ip}/api") ``` -------------------------------- ### Configuring GroundX TypeScript SDK Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md This snippet demonstrates how to initialize the GroundX TypeScript client. It requires your API key and the environment URL, which is formed by adding '/api' to your On-Prem instance's external IP. ```typescript import { GroundXClient } from "groundx"; const external_ip = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxx.us-east-2.elb.amazonaws.com' const groundx = new GroundXClient({ apiKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", environment: `http://${external_ip}/api`; }); ``` -------------------------------- ### Creating AWS VPC and EKS Cluster for GroundX (Bash) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Runs the script to provision the necessary AWS infrastructure for GroundX On-Prem. This includes setting up a new VPC and an Amazon EKS cluster, prompting the user for the desired AWS region during execution. ```bash environment/aws/setup-eks ``` -------------------------------- ### Using bin/environment Script - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Provides the general command structure for the `bin/environment` script, used to manage VPCs and Kubernetes clusters. It takes a component argument and optional flags. ```bash bin/environment [component] [options] ``` -------------------------------- ### Using bin/operator Script - Bash Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/bin/README.md Provides the general command structure for the `bin/operator` script, used to manage GroundX On-Prem deployments including functional groups, apps, and services. It takes a component argument and optional flags. ```bash bin/operator [component] [options] ``` -------------------------------- ### Configure Search Service Settings (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines local variables `create_search` to check if a new search service is needed based on existing parameters, and `search_settings` to configure the search base domain, base URL, and port, prioritizing existing values using `coalesce`. ```HCL locals { create_search = var.search_existing.base_domain == null || var.search_existing.base_url == null || var.search_existing.port == null search_settings = { base_domain = coalesce(var.search_existing.base_domain, "${var.search_internal.service}-cluster-master.${var.app_internal.namespace}.svc.cluster.local") base_url = coalesce(var.search_existing.base_url, "https://${var.search_internal.service}-cluster-master.${var.app_internal.namespace}.svc.cluster.local:${var.search_internal.port}") port = coalesce(var.search_existing.port, var.search_internal.port) } } ``` -------------------------------- ### Determining Summary Service Creation - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `create_summary` to determine if a new summary service should be set up. Creation is needed if either the existing API key or base URL for the summary service is not provided. ```HCL locals { create_summary = var.summary_existing.api_key == null || var.summary_existing.base_url == null } ``` -------------------------------- ### Configure Streaming Service Settings (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines local variables `create_stream` to check if a new streaming service is needed based on existing parameters, and `stream_settings` to configure the streaming base domain and port, prioritizing existing values using `coalesce`. ```HCL locals { create_stream = var.stream_existing.base_domain == null || var.stream_existing.base_url == null || var.stream_existing.port == null stream_settings = { base_domain = coalesce(var.stream_existing.base_domain, "${var.stream_internal.service}-cluster-cluster-kafka-bootstrap.${var.app_internal.namespace}.svc.cluster.local") port = coalesce(var.stream_existing.port, var.stream_internal.port) } } ``` -------------------------------- ### Tearing Down GroundX On-Prem Deployment Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md These bash commands are used to dismantle the GroundX On-Prem application and services. It is crucial to run these commands in the specified order to ensure a clean teardown. ```bash bin/operator app -c bin/operator services -c bin/operator init -c ``` -------------------------------- ### Configure File Storage Settings (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines local variables `create_file` to check if new file storage is needed based on existing parameters, and `file_settings` to configure various file storage parameters like domain, bucket, password, port, ssl, and username, prioritizing existing values using `coalesce`. ```HCL locals { create_file = var.file_existing.base_domain == null || var.file_existing.bucket == null || var.file_existing.password == null || var.file_existing.port == null || var.file_existing.ssl == null file_settings = { base_domain = coalesce(var.file_existing.base_domain, "${var.file_internal.service}.${var.app_internal.namespace}.svc.cluster.local") bucket = coalesce(var.file_existing.bucket, var.file.upload_bucket) dependency = coalesce(var.file_existing.base_domain, "${var.file_internal.service}-tenant-hl.${var.app_internal.namespace}.svc.cluster.local") password = coalesce(var.file_existing.password, var.file.password) port = coalesce(var.file_existing.port, var.file_internal.port) ssl = coalesce(var.file_existing.ssl, var.file_resources.ssl) username = coalesce(var.file_existing.username, var.file.username) } } ``` -------------------------------- ### Resource Requirements for eyelevel-gpu-summary Node Group Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Outlines the maximum resource requirements per pod for services deployed to the eyelevel-gpu-summary node group. These pods have specific demands on GPU, disk space, CPU, and RAM. ```text 10 GB GPU memory 36 GB disk drive space 1.5 CPU core 7 GB RAM ``` -------------------------------- ### Resource Requirements for eyelevel-cpu-memory Node Group Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Specifies the typical range of resource requirements per pod for services deployed to the eyelevel-cpu-memory node group, such as OpenSearch, MySQL, and MinIO. These values are described in more detail in operator/variables.tf. ```text 20 - 75 GB disk drive space 0.5 - 2 CPU cores 0.5 - 4 GB RAM ``` -------------------------------- ### Configuring Summary Service Locals - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines local variables to determine if a new summary service needs to be created and to configure its credentials. Creation is needed if existing API key or base URL is missing. Credentials prefer existing values but fall back to internal defaults using `coalesce`. ```HCL locals { create_summary = var.summary_existing.api_key == null || var.summary_existing.base_url == null summary_credentials = { api_key = coalesce(var.summary_existing.api_key, var.admin.api_key) base_url = coalesce(var.summary_existing.base_url, "http://${var.summary_internal.service}-api.${var.app_internal.namespace}.svc.cluster.local") } } ``` -------------------------------- ### Configure Database Endpoints (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines local variables `create_database` to check if a new database is needed based on existing parameters, and `db_endpoints` to configure the database port, read-only, and read-write endpoints, prioritizing existing values using `coalesce`. ```HCL locals { create_database = var.db_existing.port == null || var.db_existing.ro == null || var.db_existing.rw == null db_endpoints = { port = coalesce(var.db_existing.port, var.db_internal.port) ro = coalesce(var.db_existing.ro, "${var.db_internal.service}-cluster-pxc-db-haproxy.${var.app_internal.namespace}.svc.cluster.local") rw = coalesce(var.db_existing.rw, "${var.db_internal.service}-cluster-pxc-db-haproxy.${var.app_internal.namespace}.svc.cluster.local") } } ``` -------------------------------- ### Determining Search Service Creation - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `create_search` to determine if a new search service should be set up. Creation occurs if any of the parameters for connecting to an existing search service (base domain, base URL, or port) are not provided. ```HCL locals { create_search = var.search_existing.base_domain == null || var.search_existing.base_url == null || var.search_existing.port == null } ``` -------------------------------- ### Tearing Down AWS EKS/VPC Environment Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md If you used the provided Terraform scripts to set up your AWS EKS cluster and VPC, these bash commands will tear down that infrastructure. They must be run in the correct sequence. ```bash bin/environment eks -c bin/environment aws-vpc -c ``` -------------------------------- ### Configuring Kubernetes Node Selectors and Tolerations (YAML) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md This YAML snippet illustrates how Kubernetes pod configurations utilize node selectors and tolerations to ensure pods are scheduled onto nodes with specific labels. This mechanism is used by GroundX On-Prem pods to target appropriate node groups based on their resource requirements and purpose. ```yaml nodeSelector: node: "{{ .Values.nodeSelector.node }}" tolerations: - key: "node" value: "{{ .Values.nodeSelector.node }}" effect: "NoSchedule" ``` -------------------------------- ### Resource Requirements for eyelevel-gpu-ranker Node Group Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Specifies the maximum resource requirements per pod for services deployed to the eyelevel-gpu-ranker node group. These pods require specific amounts of GPU memory, disk space, CPU cores, and RAM. ```text 1.1 GB GPU memory 3.5 GB disk drive space 0.25 CPU core 0.75 GB RAM ``` -------------------------------- ### Determining Database Creation - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `create_database` to control the creation of a new database instance. A new database is created if any of the required existing database connection details (port, read-only endpoint, or read-write endpoint) are not supplied. ```HCL locals { create_database = var.db_existing.port == null || var.db_existing.ro == null || var.db_existing.rw == null } ``` -------------------------------- ### Configure Cache Service Defaults (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines local variables `create_cache` to check if a new cache service is needed based on existing parameters, and `cache_settings` to configure the cache address, instance type, and port, prioritizing existing values using `coalesce`. ```HCL locals { create_cache = var.cache_existing.addr == null || var.cache_existing.is_instance == null || var.cache_existing.port == null cache_settings = { addr = coalesce(var.cache_existing.addr, "${var.cache_internal.service}.${var.app_internal.namespace}.svc.cluster.local") is_instance = coalesce(var.cache_existing.is_instance, var.cache_internal.is_instance) port = coalesce(var.cache_existing.port, var.cache_internal.port) } } ``` -------------------------------- ### Resource Requirements for eyelevel-gpu-layout Node Group Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Defines the maximum resource requirements per pod for services deployed to the eyelevel-gpu-layout node group. These pods have specific needs for GPU, CPU, RAM, and disk space. ```text 4 GB GPU memory 8 GB disk drive space 1 CPU core 3 GB RAM ``` -------------------------------- ### Determining Streaming Service Creation - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `create_stream` to decide if a new streaming service should be provisioned. A new service is created if any of the connection details for an existing streaming service (base domain, base URL, or port) are not supplied. ```HCL locals { create_stream = var.stream_existing.base_domain == null || var.stream_existing.base_url == null || var.stream_existing.port == null } ``` -------------------------------- ### Determining File Storage Creation - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `create_file` to decide whether to provision new file storage. New file storage is created if any of the parameters for connecting to existing file storage (base domain, bucket, password, port, or SSL setting) are not provided. ```HCL locals { create_file = var.file_existing.base_domain == null || var.file_existing.bucket == null || var.file_existing.password == null || var.file_existing.port == null || var.file_existing.ssl == null } ``` -------------------------------- ### Default Node Labels Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/README.md Lists the default string values used for node labels defined in shared/variables.tf. These labels must be applied to appropriate nodes within the cluster to designate their role. ```text eyelevel-cpu-memory eyelevel-cpu-only eyelevel-gpu-layout eyelevel-gpu-ranker eyelevel-gpu-summary ``` -------------------------------- ### Determining Cache Service Creation - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `create_cache` to determine if a new cache service should be provisioned. Creation is triggered if any of the existing cache service parameters (address, instance type, or port) are not provided via input variables. ```HCL locals { create_cache = var.cache_existing.addr == null || var.cache_existing.is_instance == null || var.cache_existing.port == null } ``` -------------------------------- ### Conditionally Create Kubernetes ConfigMap for Layout OCR Credentials (HCL) Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md This Terraform resource block defines a Kubernetes ConfigMap that is conditionally created. The creation depends on whether the `var.layout.ocr.credentials` variable is not empty AND the `var.layout.ocr.type` variable is set to "google". If both conditions are met, the ConfigMap is created to store OCR credentials, primarily for Google OCR. ```HCL resource "kubernetes_config_map" "layout_ocr_credentials" { count = var.layout.ocr.credentials == "" || var.layout.ocr.type != "google" ? 0 : 1 # ... resource configuration ... } ``` -------------------------------- ### Conditionally Creating Kubernetes Storage Class - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a Kubernetes Storage Class resource that is conditionally created using the `count` meta-argument. The resource is created only if the variable `var.app_internal.pv_class` is not equal to "empty", allowing users to opt-out of creating a new storage class if they have an existing one. ```HCL resource "kubernetes_storage_class_v1" "local_storage" { count = var.app_internal.pv_class != "empty" ? 1 : 0 # ... resource configuration ... } ``` -------------------------------- ### Conditionally Create Kubernetes Storage Class in Terraform Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md This HCL snippet demonstrates conditional resource creation for a Kubernetes StorageClass. The `count` argument uses a conditional expression to create the resource only if the variable `var.app_internal.pv_class` is not equal to "empty". This allows skipping creation when a storage class is not needed or pre-exists. ```HCL resource "kubernetes_storage_class_v1" "local_storage" { count = var.app_internal.pv_class != "empty" ? 1 : 0 # ... resource configuration ... } ``` -------------------------------- ### Define Root Module Path in Terraform Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md This HCL snippet defines a local variable `module_path` in the root `locals.tf` file. It sets the base path for modules used throughout the init directory, relative to the current module's path. ```HCL locals { module_path = "${path.module}/../../../modules" } ``` -------------------------------- ### Checking OpenShift Cluster Type - Terraform HCL Source: https://github.com/eyelevelai/groundx-on-prem/blob/main/operator/init/README.md Defines a local boolean variable `is_openshift` that evaluates to true if the cluster type variable `var.cluster.type` is set to "openshift". This variable is used to conditionally apply configurations or resources specific to OpenShift environments. ```HCL locals { is_openshift = var.cluster.type == "openshift" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.