Skip to main content
Version: v2.4.4

Setup Yeedu Control Plane

1. Credentials Setup

Create two files for to store below mentioned credentials:

  1. Cloud Credentials:

    • Create cloud_credentials.json.
    • Paste JSON credentials (GCP, AWS, or Azure) in the specified format.
  2. Registry Credentials:

    • Create docker_registry_credentials.json.
    • Paste JSON credentials for your container registry.

Credential Formats for Each Cloud Provider

{
"type": "service_account",
"project_id": "<project_id>",
"private_key_id": "<private_key_id>",
"private_key": "<private_key>",
"client_email": "<client_email>",
"client_id": "<client_id>",
"auth_uri": "<auth_uri>",
"token_uri": "<token_uri>",
"auth_provider_x509_cert_url": "<auth_provider_x509_cert_url>",
"client_x509_cert_url": "<client_x509_cert_url>"
}
note

Replace all placeholder values (e.g., <project_id>, <access_key>) with your actual credentials. Keep these files safe and secure, as they contain sensitive information.

2. Download Yeedu Control Plane Files

To initiate your Yeedu Control Plane Setup, download the essential code from the Core-Services-Formation repository.

  1. Open a terminal or command prompt.

  2. Run the following command to clone the repository:

    git clone link-to-git-repo
  3. Change the working directory to Core-Services-Formation:

    cd Core-Services-Formation

3. Configure Yeedu Control Plane Properties

After downloading the essential files, customize your Yeedu environment by adjusting key configuration settings. Update the following property files to reflect your specific infrastructure and cloud provider details.

3.1. Configuration Files

  1. yeedu-connection.properties:

    • This file connects Yeedu to essential services like Postgres, RabbitMQ, and Redis. Update connection parameters based on your service configurations, including database hostnames, usernames, and passwords.
  2. yeedu-system-config.properties:

    • This file manages cloud-based services such as Object Storage and Container Registry. Align settings with your chosen cloud provider (AWS, GCP, Azure) and configurations for seamless integration.
note

Uncomment and provide input values for the properties specified in the files. Detailed explanations for each parameter are available in the respective property files.

3.2. Variables Reference

3.2.1. yeedu-connection.properties

Metadata DB

VariableDescriptionDefault ValueRequired
YEEDU_DEPLOY_LOCAL_POSTGRESEnable local Postgres deploymenttrueYes
YEEDU_PG_DBName of the Postgres databaseyeeduYes
YEEDU_PG_USERUsername for Postgres connectionpostgresYes
YEEDU_PG_PASSWORDPassword for Postgres userpostgresYes
YEEDU_PG_HOSTNAMEHostname or IP address of the Postgres serverEndpoint Url of the serviceYes
YEEDU_PG_PORTPort number for the Postgres server5432No
YEEDU_PG_SSL_ENABLEDEnable SSL encryption for Postgres connectionfalseNo

Messaging Service

VariableDescriptionDefault ValueRequired
YEEDU_DEPLOY_LOCAL_RABBITMQEnable local RabbitMQ deploymenttrueYes
YEEDU_MQ_USERUsername for RabbitMQ connectionguestYes
YEEDU_MQ_PASSWORDPassword for RabbitMQ userguestYes
YEEDU_MQ_PORTPort number for RabbitMQ5672No
YEEDU_MQ_UI_PORTPort number for RabbitMQ management UI15672No
YEEDU_MQ_UI_HOSTNAMEHostname for RabbitMQ management UIEndpoint Url of the serviceYes
YEEDU_MQ_HOSTNAMEHostname or IP address of the RabbitMQ serverEndpoint Url of the serviceYes
YEEDU_MQ_VHVirtual host for RabbitMQ"/"No
YEEDU_MQ_SSL_ENABLEDEnable SSL encryption for RabbitMQ connectionfalseNo

Redis Cache

VariableDescriptionDefault ValueRequired
YEEDU_DEPLOY_LOCAL_REDISEnable local Redis deploymenttrueYes
YEEDU_REDIS_PASSWORDPassword for RedisadminNo
YEEDU_REDIS_PORTPort number for Redis6379No
YEEDU_REDIS_HOSTNAMEHostname or IP address of the Redis serverEndpoint Url of the serviceYes
YEEDU_REDIS_SSL_ENABLEDEnable SSL encryption for Redis connectionfalseNo

LDAP Service

VariableDescriptionDefault ValueRequired
YEEDU_DEPLOY_LOCAL_LDAPEnable local LDAP deploymenttrueYes
YEEDU_AUTH_LDAP_ORGANISATIONLDAP organization nameyeeduYes
YEEDU_AUTH_LDAP_DOMAINLDAP domainyeedu.comYes
YEEDU_AUTH_LDAP_ADMIN_PASSWORDPassword for LDAP administratorNdbk5LgbYes
YEEDU_AUTH_LDAP_HOSTNAMEHostname or IP address of the LDAP serverEndpoint Url of the serviceYes
YEEDU_AUTH_LDAP_PORTPort number for LDAP server389No
YEEDU_AUTH_LDAP_BASE_DNBase DN for LDAPdc=yeedu,dc=comYes
YEEDU_AUTH_LDAP_BIND_DNBind DN for LDAPcn=admin,dc=yeedu,dc=comYes
YEEDU_AUTH_LDAP_BIND_PASSWORDPassword for LDAP bind userNdbk5LgbYes
YEEDU_AUTH_LDAP_SSL_ENABLEDEnable SSL encryption for LDAP connectionfalseNo

REST-API

VariableDescriptionDefault ValueRequired
YEEDU_RESTAPI_PORTPort number for REST API server8080No
YEEDU_RESTAPI_HOSTNAMEHostname or IP address of REST API serverEndpoint Url of the serviceYes
YEEDU_SECRET_KEYSecret key for authentication and encryptionyeeduNo
YEEDU_RESTAPI_LOG_LEVELLog level for REST API server (e.g., INFO, DEBUG)INFONo
YEEDU_RESTAPI_SSL_ENABLEDEnable SSL encryption for REST API connectionfalseNo
YEEDU_RESTAPI_RELICA_COUNTNumber of replicas/instances for REST API server1No

History Server

VariableDescriptionDefault ValueRequired
YEEDU_HISTORY_SERVER_WEB_PORTPort number for History Server web interface10000No
YEEDU_HISTORY_SERVER_WEB_HOSTNAMEHostname for History Server web interfacehistoryserver.yeeduNo

Monitor

VariableDescriptionDefault ValueRequired
YEEDU_GRAFANA_HOSTNAMEHostname or IP address of Grafana serverEndpoint Url of the serviceYes
YEEDU_GRAFANA_PORTPort number for Grafana3000No
YEEDU_GRAFANA_USERNAMEUsername for Grafana loginYSU0000No
YEEDU_GRAFANA_PASSWORDPassword for Grafana loginYSU0000No
YEEDU_GRAFANA_LDAP_USER_GROUP_CNLDAP user group Common Name (CN) for Grafanacn=yeedu-user,ou=groups,dc=yeedu,dc=comNo
YEEDU_GRAFANA_LDAP_USER_BASE_DNLDAP user base DN for Grafanaou=users,dc=yeedu,dc=comNo
YEEDU_GRAFANA_LDAP_GROUP_SEARCH_BASE_DNLDAP group search base for Grafanaou=groups,dc=yeedu,dc=comNo

InfluxDB

VariableDescriptionDefault ValueRequired
YEEDU_INFLUXDB_HOSTNAMEHostname or IP address of InfluxDB serverEndpoint Url of the serviceYes
YEEDU_INFLUXDB_PORTPort number for InfluxDB8086No
YEEDU_INFLUXDB_DBName of the InfluxDB databaseinfluxNo
YEEDU_INFLUXDB_USERNAMEUsername for InfluxDB loginadminNo
YEEDU_INFLUXDB_PASSWORDPassword for InfluxDB loginadminNo

3.2.2. yeedu-system-config.properties

Deployment Parameters

VariableDescriptionDefault ValueRequired
YEEDU_DEPLOYMENT_MODEDeployment modedockerYes

System Object Storage Configuration

VariableDescriptionDefault ValueRequired
YEEDU_SYSTEM_CLOUD_PROVIDERCloud provider for object storage-Yes
YEEDU_SYSTEM_PROJECT_IDProject ID for object storage-Yes
YEEDU_SYSTEM_OBJECT_STORAGEObject storage bucket or container name-Yes
YEEDU_SYSTEM_CLOUD_CREDENTIALS_FILE_PATHFile path to cloud provider credentials (JSON)-Yes
YEEDU_SYSTEM_OBJECT_STORAGE_ENCRYPTION_ENABLEDEnable object storage encryption-Yes
YEEDU_SYSTEM_SPARK_EVENTS_RETENTION_DAYSRetention period for spark events90Yes

System Container Registry Configuration

VariableDescriptionDefault ValueRequired
YEEDU_SYSTEM_DOCKER_REGISTRY_PROVIDERDocker registry provider-Yes
YEEDU_SYSTEM_DOCKER_REGISTRY_URLDocker registry URL-Yes
YEEDU_SYSTEM_DOCKER_REGISTRY_CREDENTIALS_FILE_PATHFile path to Docker registry credentials (JSON)-Yes

Kubernetes Parameters

VariableDescriptionDefault ValueRequired
YEEDU_SYSTEM_KUBERNETES_NAMESPACENamespace for KubernetesyeeduNo
YEEDU_SYSTEM_KUBERNETES_STATIC_IPStatic IP address for NGINX in Kubernetes10.128.15.238No
note

"Required" indicates whether the variable is required for Yeedu setup

4. Deploy Yeedu Services on Kubernetes

4.1. Provide execute permissions

After updating properties, go to the Yeedu Control Plane folder. Find yeedu-core-services.sh script. Grant execute permissions:

chmod +x yeedu-core-services.sh

4.2. Authenticate to Kubernetes Cluster

Authenticate to the Kubernetes Cluster using the respective Cloud CLI and kubectl commands provided below.

gcloud auth activate-service-account --key-file=PATH_TO_YOUR_SERVICE_ACCOUNT_JSON
gcloud config set project YOUR_PROJECT_ID
gcloud container clusters get-credentials CLUSTER_NAME --region=CLUSTER_REGION

Validate successful cluster authentication by running the command below:

kubectl config get-contexts

4.3. Update SSL Certificates

In the Core-Services-Formation directory, find the ssl folder. Update yeedu.crt and yeedu.key with the correct SSL certificate and SSL key. These files are used by the Yeedu Ingress Controller in Kubernetes.

4.4. Setup Ingress in Provided Namespace

Run the following commands to setup Nginx Ingress Controller:

export YEEDU_SYSTEM_KUBERNETES_NAMESPACE=yeedu-test
export YEEDU_SYSTEM_KUBERNETES_STATIC_IP=10.4.6.202
export YEEDU_SYSTEM_DOCKER_REGISTRY_URL=yeedu.azurecr.io

export YEEDU_MQ_UI_PORT=15672
export YEEDU_MQ_PORT=5672
export YEEDU_REDIS_PORT=6379
export YEEDU_AUTH_LDAP_PORT=389

export YEEDU_MQ_UI_HOSTNAME=rabbitmq3-qa-aks.yeedu.io
export YEEDU_MQ_HOSTNAME=rabbitmq3-ui-qa-aks.yeedu.io
export YEEDU_REDIS_HOSTNAME=redis-qa-aks.yeedu.io
export YEEDU_AUTH_LDAP_HOSTNAME=ldap-qa-aks.yeedu.io

export YEEDU_RESTAPI_PORT=8080
export YEEDU_HISTORY_SERVER_WEB_PORT=10000
export YEEDU_GRAFANA_PORT=3000
export YEEDU_INFLUXDB_PORT=8086

export YEEDU_RESTAPI_HOSTNAME=restapi-qa-aks.yeedu.io
export YEEDU_HISTORY_SERVER_WEB_HOSTNAME=history-server-qa-aks.yeedu.io
export YEEDU_GRAFANA_HOSTNAME=grafana-qa-aks.yeedu.io
export YEEDU_INFLUXDB_HOSTNAME=influxdb-qa-aks.yeedu.io

kubectl create secret tls yeedu-certs \
--cert=yeedu.crt \
--key=yeedu.key \
--namespace $YEEDU_SYSTEM_KUBERNETES_NAMESPACE

helmfile --log-level=info -f ./kubernetes/helmfile-ingress.yml sync

After the ingress is created, obtain the IP address:

kubectl get ingress -n $YEEDU_SYSTEM_KUBERNETES_NAMESPACE

4.5. Create DNS Entries

Create DNS entries for the Ingress record in the respective cloud environment. Ensure entries are created for all configured hostnames in the Ingress. Execute the following command:

gcloud dns record-sets transaction start --zone=YOUR_DNS_ZONE_NAME
gcloud dns record-sets transaction add <ip> --name=<dns> --ttl=300 --type=A --zone=YOUR_DNS_ZONE_NAME
gcloud dns record-sets transaction execute --zone=YOUR_DNS_ZONE_NAME

4.6. Deploy Yeedu Control Plane on Kubernetes

Execute the Yeedu Control Plane setup script yeedu-core-services.sh. Run ./yeedu-core-services.sh --help for more information. This script installs kubectl, Helm, Helmfile CLI, psql, rabbitmqadmin, and Redis CLI's on the machine, adapting to the machine's architecture and OS and setup up Yeedu Control Plane on Kubernetes.

Run the following command to start the Yeedu Control Plane on Kubernetes:

  • Start the services
./yeedu-core-services.sh start
  • Stop the services
./yeedu-core-services.sh stop
  • Restart the services
./yeedu-core-services.sh restart
  • Clean the services and delete data
./yeedu-core-services.sh clean

After executing these commands, the script generates necessary secrets, configmaps, deployments, pods, and services to run Yeedu Services on Kubernetes. Access the Yeedu RestAPI at the configured YEEDU_RESTAPI_HOSTNAME URL with HTTPS TLS termination provided by the ingress.

Below is the output when we run the Yeedu Control Plane setup script

📝 Log file is available at: /home/sc2302/.yeedu/deployment/logs/deploy_2024-01-21-15-12-24.log



██╗░░░██╗███████╗███████╗██████╗░██╗░░░██╗░░░██╗░█████╗░
╚██╗░██╔╝██╔════╝██╔════╝██╔══██╗██║░░░██║░░░██║██╔══██╗
░╚████╔╝░█████╗░░█████╗░░██║░░██║██║░░░██║░░░██║██║░░██║
░░╚██╔╝░░██╔══╝░░██╔══╝░░██║░░██║██║░░░██║░░░██║██║░░██║
░░░██║░░░███████╗███████╗██████╔╝╚██████╔╝██╗██║╚█████╔╝
░░░╚═╝░░░╚══════╝╚══════╝╚═════╝░░╚═════╝░╚═╝╚═╝░╚════╝░

🚀 This script is used to setup Yeedu core services. With this, we will be deploying the following Yeedu services:
* yeedu-init - Initializes confs and Cloud-Formation-Engine
* yeedu-metadata-db - PostgreSQL container which stores metadata of Yeedu
* yeedu-restful-api - RestAPI which will act as an interface
* yeedu-rabbitmq3 - RabbitMQ to stream messages in queues
* yeedu-reactors-cosi - Reactors to start and stop workflow jobs
* yeedu-reactors-monitor - Monitor workflows
* yeedu-spark-history-server - Spark History Server
* yeedu-spark-history-server-web - Nginx on history server
* yeedu-redis - Redis Cache for Auth service
* yeedu-ldap - LDAP used for authorization
* yeedu-reactors-logs-collector - Container to sync reactor logs with bucket
* yeedu-telegraf - Container to export machine metrics
* yeedu-influxdb - InfluxDB to store all machine metrics
* yeedu-grafana - Dashboards created for every machine on metrics

🚀 Setting up prerequisites...
🐳 Docker version:
Docker version 20.10.17, build 100c701
🐳 docker-compose version:
docker-compose version 1.29.2, build 5becea4c
⌨️ Kubectl Version:
Client Version: v1.27.3
⎈ Helm Version:
v3.9.3+g414ff28
🌀 Helmfile Version:
v0.142.0
✨ envsubst version:
envsubst (GNU gettext-runtime) 0.21
🌈 jq version:
jq-1.6
🐘 psql version:
psql (PostgreSQL) 16.1 (Ubuntu 16.1-1.pgdg22.04+1)
💾 redis cli version:
redis-cli 6.0.16
🐇 rabbitmq server version:
3.9.13-1ubuntu0.22.04.2
✔️ Prerequisites setup completed.

🚀 Setting up Yeedu Variables
🔧 Creating .env file...
✔️ Successfully created .env file.
🌐 Sourcing .env file and yeedu-env.sh script...
✔️ Successfully sourced .env file and yeedu-env.sh script.
📝 Saving Yeedu environment variables in .env file...
✔️ Successfully saved Yeedu environment variables in .env file.
⚙️ Configuring deployment mode-specific settings...
🐳 Copying .env file to ./docker/...
✔️ Successfully configured Docker deployment mode.
✔️ Successfully set the docker-compose path.
🔍 Checking for config file "./.env"...
✔️ Config file ".env" exists.

🚀 Running on deployment mode: aks
✅ YEEDU_ENABLE_GRAFANA_MONTORING is set to true.
✅ YEEDU_RUN_INIT_SERVICE is set to true.
✅ YEEDU_DEPLOY_LOCAL_RABBITMQ is set to true.
✅ YEEDU_DEPLOY_LOCAL_REDIS is set to true.
✅ YEEDU_DEPLOY_LOCAL_LDAP is set to true.

🔧 Performing operation ./yeedu-core-services.sh in environment dev
🚀 Performing operation start on services yeedu-rabbitmq3 yeedu-metadata-db yeedu-redis yeedu-ldap and yeedu-restful-api yeedu-api-gateway yeedu-reactors-cosi yeedu-reactors-monitor yeedu-spark-history-server yeedu-spark-history-server-web yeedu-reactors-logs-collector yeedu-vault yeedu-ui yeedu-telegraf yeedu-influxdb yeedu-grafana yeedu-init