Deploy Application with Helm Charts

Prerequisites

Before installing MOCM, ensure the following infrastructure components are already provisioned and accessible:

  • Helm >= 3.0.0 installed
  • kubectl configured and connected to EKS cluster
  • MongoDB cluster deployed and accessible
  • ALB configured and ready

MOCM Helm Chart

A comprehensive Helm chart for deploying MOCM (My OPSWAT Central Management) services in on-premise Kubernetes environments.

Required Infrastructure

ComponentVersionDescription
Kubernetesv1.34+Cluster with sufficient resources
MongoDB8.0+Database (standalone or replica set)
RabbitMQLatestMessage broker (AmazonMQ or compatible)
RedisLatestCache service (Amazon ElastiCache)
S3 Storage-Object storage (AWS S3 or compatible)
Container Registry-Repositories (AWS ECR or other registry)

CLI Tools

ToolsVersionDescriptionInstall
Helmv3.x+Package manager for KubernetesInstalling Helm | Helm
Kubectlv1.34+The Kubernetes command-line toolInstall Tools | Kubernetes
Helmfilev1.4.xHelmfile is a declarative spec for deploying helm charts.Releases · helmfile/helmfile
AWS CLIv2.x+Required for ECR authenticationhttps://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
OpenSSL3.6.1+Required for generating the product agent RSA key pairDownloads | OpenSSL Library
Dockerv20.x+Required for loading and pushing images to ECRhttps://docs.docker.com/engine/install/

S3 Bucket Requirements

The following S3 buckets must be created (replace {name_prefix} with your environment prefix):

YAML
Copy

Example with name_prefix mocm:

YAML
Copy

Repository Requirements

The ECR must be created before running this step (replace <id> with your id account aws and <region> for your region)

YAML
Copy

If using another registry, repository must create

YAML
Copy

ALB Requirements

Note — ALB required: Single ALB with path-based routing: REST via Traefik, gRPC direct to connector service:

  • ALB 1: Domain = "host", Protocol = HTTPS (443), Purpose = Main web traffic — UI, REST APIs, all HTTP-based services.

Prepare

Download MOCM Kubernetes from My OPSWAT Portal and extract the MOCM on-premise package and verify the directory structure:

YAML
Copy

Tag and Push Images to Registry

YAML
Copy

Inside folder images:

YAML
Copy

Prerequisites: AWS CLI installed and configured with valid credentials. Docker must also be running.

Run the script:

YAML
Copy

The script will:

  1. Authenticate Docker to ECR automatically (aws ecr get-login-password)
  2. Load every image tar file in the images/ directory into Docker
  3. For each image listed in images.txt, create the ECR repository if it does not exist, then tag and push the image

Generate RSA Key Pair for Product Agent

fusion-auth and fusion-connector require an RSA key pair exposed as PRODUCT_AGENT_RSA_PRIVATE_KEY / PRODUCT_AGENT_RSA_PUBLIC_KEY.

Bash
Copy

Contents of scripts/:

└── gen-cert.sh

Prerequisites: OpenSSL installed.

Run the script:

Bash
Copy

The script will:

  1. Create ./certs/ if it does not exist
  2. Generate an OpenSSL config (ssl.cnf) and a self-signed certificate + RSA private key (tls.crt, tls.key, default 10 years)
  3. Extract the public key into public.key

Output files in ./certs/:

FilePurpose
tls.keyRSA private key → global.productKey.rsaPrivateKey
public.keyRSA public key → global.productKey.rsaPublicKey

Keep these files safe — they are used to populate global.productKey in values.yaml

Quick Start

Back to MOCM package folder

Configure Values

Edit values.yaml with your environment details.

1. Configuration

Update image, host, ingressclass and replicas in values.yaml

YAML
Copy

Host: domain name for MOCM

If you need update replicas of one service, you can get svc and update replicas:

Example:

YAML
Copy

NOTE If you use Terraform (in the terraform folder) to install infrastructure, you can access AWS Secrets Manager in the AWS Console to retrieve the username and password for RabbitMQ and MongoDB.

For Redis OSS cache configuration:

  • REDIS_PRIMARY_HOST is the primary endpoint.
  • REDIS_REPLICA_HOSTS is the reader endpoint.

For the admin-user secret, these values are used to initialize the admin account login to the web console for managing MOCM.

2. Configure credentials via values.yaml

Edit the values.yaml file to provide connection details and credentials. The file contains placeholders that need to be replaced with your actual values:

YAML
Copy

Note: Replace all placeholder values with your actual configuration values before deployment.

Example:

YAML
Copy

We are generating passwords for MongoDB and RabbitMQ using AWS Secrets Manager.

For Redis:

  • REDIS_PRIMARY_HOST = the primary endpoint
  • REDIS_REPLICA_HOSTS = the reader endpoint

For admin-user : these values initialize the admin account for managing MOCM.

Option: Create secrets manually with kubectl (Optional)

Instead of putting credentials in values.yaml, you can create secrets directly with kubectl before deploying.

Important: If you create secrets manually, you must remove global.secrets from values.yaml. If global.secrets is present, the Helm pre-install/pre-upgrade hook will overwrite your manually created secrets on every deploy.

YAML
Copy
YAML
Copy
YAML
Copy
YAML
Copy

3. Product RSA Key Pair

Paste the contents of tls.key and public.key into global.productKey. Use a | block scalar to preserve line breaks.

Note: Do not include the -----BEGIN ...----- and -----END ...----- markers — paste only the body of the key

YAML
Copy

4. S3 Storage

YAML
Copy

5. Component Replicas (Optional)

Override the default replicaCount for specific services:

YAML
Copy

Install

1. Deploy

From the mocm/ directory. Choose one of the two options below.

Helmfile reads helmfile.yaml and deploys all 3 releases in the correct order automatically, with wait, waitForJobs, and needs handling the sequencing.

YAML
Copy

Option B — Helm (manual, release by release)

If you do not have Helmfile installed, deploy each release manually in this exact order:

YAML
Copy

Important: The order bootstrap-1 → bootstrap-2 → mocm-service is mandatory. Do not run Release 2 until Release 1 is fully ready, and do not run Release 3 until Release 2 is fully ready.

The process takes 15–30 minutes depending on your environment.

2. Verify Deployment

YAML
Copy

All releases should show status deployed.

YAML
Copy

All pods should reach Running state. If a pod is stuck in Pending:

YAML
Copy

Upgrade & Uninstall

Before upgrading, always back up your current values.yaml file. The new chart version may ship with an updated values.yaml containing new keys or changed defaults. You should compare the new values.yaml with your existing one and merge your custom values (credentials, host, image registry, replicas, etc.) into the new file. Losing your previous values.yaml may result in missing configurations or service disruption after upgrade

Upgrade

Check changes before upgrading (optional):

Bash
Copy

Option A — Helmfile:

YAML
Copy

Helmfile sync is idempotent — it applies only the diff.

Option B — Helm (same order as install):

YAML
Copy

Uninstall

YAML
Copy

Or uninstall individual releases with Helm (in reverse order):

YAML
Copy

Testing (Static / Pre-deploy)

Validate charts before deploying to a cluster.

Phase 1: Lint

YAML
Copy

Phase 2: Template Render

YAML
Copy

To inspect rendered output:

YAML
Copy

Phase 3: Helmfile Validation

YAML
Copy

Troubleshooting

Pod stuck in Pending

YAML
Copy

Common causes: insufficient CPU/memory, missing PVC, node not ready.

Secrets not created

Secrets are managed as Helm hooks (pre-install, pre-upgrade) in mocm-bootstrap-1. If secrets are missing, check:

YAML
Copy

Release failed

YAML
Copy

View logs

YAML
Copy

Point Domain to Ingress

After deploying MOCM and obtaining the external address of your Kubernetes ingress controller, you need to configure your DNS so that your chosen domain name points to the ingress.

  • host(e.g. mocm.example.com) → ALB address — Main web traffic (HTTPS)

Access MOCM Console

After completing the deployment and DNS configuration, you can access the My OPSWAT Central Management console:

  1. Open your browser and navigate to https://<your-domain> (the host value configured in values.yaml)
  2. Enter the administrator credentials configured in values.yaml (admin-user secret):
  • Email: the value of ADMIN_EMAIL
  • Password: the value of ADMIN_PASSWORD

You should now have access to the My OPSWAT Central Management console.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard