Prepare the environment
Validate your configuration
Before you proceed, please ensure you have a valid values.yaml file configured. Refer to the configuration introduction and TLS configuration guides for more details.
Preparing your environment
To make the installation process more straightforward, let's define some environment variables that are required by the installation script and will be used in subsequent commands.
Matching the configured Kubernetes namespace
OpsChain will be deployed in the Kubernetes namespace given to Helm's install command. To ensure our installation matches the Kubernetes' namespace it is in, we need to use the same value that has been configured in the OPSCHAIN_KUBERNETES_NAMESPACE inside the values.yaml file.
Using the default namespace of opschain, you can set the following environment variable:
export KUBERNETES_NAMESPACE=opschain
OpsChain chart version
OpsChain should always be installed with a version defined explicitly. The available OpsChain versions are listed in the changelog page.
The Helm chart version is a semver formatted version of the release name/date, with no leading zeros.
For example, if you want to install the release named 2025-01-01, the chart version will be 2025.1.1. You can export an environment variable for the version you want to install, like so:
export OPSCHAIN_CHART_VERSION=2025.1.1
To make life easier, you can add these two settings to your shell profile. This will allow you to use the same environment variables in subsequent sessions. For example:
vi ~/.bash_profile
export KUBERNETES_NAMESPACE=opschain
export OPSCHAIN_CHART_VERSION=2025.1.1
And then source it for the changes to take effect:
source ~/.bash_profile
Log in to DockerHub
With the credentials you received as part of your licence, connect Helm to DockerHub's registry. You'll need to run this command from the same shell where you're running the other commands in this guide:
helm registry login docker.io
The command will prompt you for your DockerHub credentials.
Install the CNPG operator
OpsChain uses CloudNative PostgreSQL (CNPG) to provide production-ready database high availability and disaster recovery. CNPG is a Kubernetes-native operator that manages PostgreSQL clusters with automatic failover, multi-cluster replication, and declarative configuration. To install the operator in a Kubernetes cluster, run the following commands:
First, create the operator namespace:
kubectl create namespace cnpg-system
The CNPG operator is installed at the Kubernetes cluster level, with CRDs, controllers and service accounts deployed in the cnpg-system namespace.
Set the DOCKER_USERNAME and DOCKER_PASSWORD environment variables to the Docker Hub credentials that were provided to you as part of your licence in your shell profile:
vi ~/.bash_profile
export DOCKER_USERNAME=<username>
export DOCKER_PASSWORD=<password>
And source it for the changes to take effect:
source ~/.bash_profile
Then create the secret used by the operator to pull images:
kubectl create secret docker-registry opschain-operator-secret --docker-server=docker.io --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD -n cnpg-system
Finally, apply the operator's YAML file:
kubectl apply -f \
https://docs.opschain.io/files/downloads/cnpg-operator.yaml \
--server-side
Verify the operator is running:
kubectl get pods -n cnpg-system
This step is required even if you are not planning to use the high availability features.
What to do next
- Proceed to installing OpsChain.