OpenLegacy Hub Enterprise Helm Installer Script

This repository includes the installer-helm.sh script which automates and standardizes the deployment of OpenLegacy Hub Enterprise using Helm on Kubernetes or OpenShift clusters.


Table of Contents


Overview

The installer-helm.sh script interactively and securely collects all parameters required for deployment (images, registry, URLs, database info, monitoring, cluster type, namespace), validates your environment, generates configuration files, certificates, and secrets, and finally performs the Helm-based installation.


Prerequisites

  • Kubernetes or OpenShift cluster access
  • CLI tools: kubectl (or oc), helm, openssl
  • Required privileges for creating namespaces and managing secrets

Installation Steps

  • Run the Installer
    sudo ./installer-helm.sh

Using installer-helm.sh: Interactive and Config File Modes

The installer-helm.sh script supports two modes of operation:

  • Interactive mode: Prompts you for input step-by-step.
  • Config file mode: Uses an existing installer-helm.conf file to prefill all settings for unattended or repeatable installations.

How Modes Work

  • Interactive mode (default):

    • If no config file exists (or you want to update config), the script will prompt you for all required information.
    • It saves your inputs in a new or updated installer-helm.conf for future use.
  • Config file mode:

    • If a valid installer-helm.conf is present in the script directory, the script will automatically load all variables from it.
    • You can review and edit this file directly for non-interactive, automated installs.
    • The script validates variables from the config file before proceeding. Missing or invalid entries will trigger prompts for correction.

installer-helm.conf Variables Explained

Below is each variable used in the installer-helm.conf file, with its meaning:

VariableDescriptionExample Value
REGISTRYURLDocker registry URL (for pulling images)openlegacy
REGISTRYUSERNAMEDocker registry username (if authentication is needed)dockeruser
REGISTRYPASSWORDDocker registry password (if authentication is needed)s3cret
K8SDISTRIBUTIONCluster type: k8s for Kubernetes, openshift for OpenShiftk8s
k8snamespaceNamespace for deploymenthub-enterprise
SECRETNAMETLS secret name (for SSL certs)ol-hub-tls
OLDBHOSTDatabase host (should be accessible by cluster pods)hub-enterprise-postgres
OLDBNAMEDatabase namepostgres
OLDBPORTDatabase port5432
OLDBUSERDatabase usernamepostgres
OLDBPASSWORDDatabase password(hidden)
KEYCLOAKIMAGEKeycloak image name with tagopenlegacy/openlegacy-keycloak:26.3.1
HUBENTDBMIGRIMAGEHub Enterprise DB migration image name with tagopenlegacy/hub-enterprise-db-migration:3.0.7
HUBENTIMAGEHub Enterprise image name with tagopenlegacy/hub-enterprise:3.0.7
OLHUBURLURL for OpenLegacy Hub Web UIhttps://hub-enterprise
OLKEYCLOAKURLURL for Keycloak Web UIhttps://hub-enterprise-keycloak
MONITORINGEnable monitoring stack (true/false)false
LOKIIMAGELoki image (for monitoring, if enabled)grafana/loki:2.7.1
GRAFANAIMAGEGrafana image (for monitoring, if enabled)grafana/grafana:9.3.1
PROMETHEUSIMAGEPrometheus image (for monitoring, if enabled)prom/prometheus:v2.40.6
PUSHGATEWAYIMAGEPushgateway image (for monitoring, if enabled)prom/pushgateway:v1.5.1
LOKIURLURL to access the Loki Web UI (monitoring)none
GRAFANAURLURL to access the Grafana Web UI (monitoring)none
PUSHGATEWAYURLURL to access PushGateway Web UI (monitoring)none
OLSCREENPORTPort for hub emulator screen (default 1512)1512

Workflow Example

  • First Run:
    Script collects input interactively and writes installer-helm.conf.
  • Subsequent Run:
    Script sources the conf file and proceeds non-interactively (unless validation fails).

Best Practices

  • Use interactive mode for the initial setup to ensure correctness.
  • Use config file mode for CI/CD pipelines or automated deployments by pre-editing installer-helm.conf.
  • Always review your config file before unattended execution, especially credentials and namespace.

Script Inputs & Configuration

Required Inputs

  • Registry: Optional authentication and base URL
  • Images: Names and tags for Hub, Keycloak, DB Migration, monitoring stack
  • URLs: Hub and Keycloak UI addresses
  • Database: Host, port, name, user, password
  • Namespace: Target namespace for deployment
  • Cluster type: Kubernetes or OpenShift
  • Monitoring stack: Enable/disable and configure images

Configuration Files Generated

  • installer-helm.conf: Summary of inputs and settings (chmod 600)
  • values.yaml: Main Helm values template
  • keycloak-realm.yaml: Keycloak configuration for chart
  • SSL certificate file (PEM)
  • Encryption secrets

Artifacts Generated

  • Configuration: All inputs persisted for audit and repeat runs
  • Helm values: Fully templated values for atomic installation
  • Key supporting files: PEM certificate, Keycloak realm configuration, secrets

Monitoring & Advanced Options

  • Optional deployment of monitoring stack if enabled
    • Loki, Grafana, Prometheus, Pushgateway images
  • Handles OpenShift environment specifics
  • Optionally includes custom TLS secret integration

Error Handling

  • Colored output for log, warning, and error states
  • Validates every required binary, value, and file
  • Graceful exit and actionable messages on failure

Troubleshooting

  • Missing tools: Install with your system package manager (e.g., apt install helm kubectl openssl)
  • Namespace missing: Create before running the script
  • Incorrect image or URL values: Edit installer-helm.conf or rerun installer
  • Database connection issues: Check credentials and network reachability
  • Permissions errors: Ensure you run the script with sufficient privileges

Support

Contact OpenLegacy technical support or refer to official documentation for further customization or advanced Helm deployment scenarios.