## Deploy the CHT
npm install @medic/cht-deployThis guide walks you through the process of deploying the Community Health Toolkit (CHT) Core application on a Kubernetes cluster. The deployment process utilizes a set of scripts and Helm charts for a simplified deployment experience.
The helm charts can be seen in the medic/helm-charts repository.
The primary script, cht-deploy, automatically installs the required Python packages and initiates the deployment of CHT Core on your Kubernetes cluster.
This script is set to install all the necessary prerequisites.
Note: The first run of the script may take longer due to downloading and installing necessary packages.
Before running the cht-deploy script, you need to provide values in the values.yaml file. Here is an explanation of the values you need to replace:
- project_name: Replace with your preferred project name.
- namespace: Replace "cht-dev-namespace" with the desired namespace for the deployment.
- chtversion: The version number of the CHT Core.
- couchdb.password: Replace with your preferred password for CouchDB.
- couchdb.secret: Replace with your preferred secret for CouchDB.
- couchdb.user: Replace with your preferred user name for CouchDB.
- couchdb.uuid: Replace with the UUID of your CouchDB.
- clusteredCouch.noOfCouchDBNodes: The number of CouchDB nodes in your cluster.
- toleration: This is for the CouchDB pods. It's best not to change this unless you know what you're doing.
- ingress: Configuration for ingress including annotations, group name, tags, certificate and host.
- environment: Environment for the deployment. Can be "local" for local deployments using k3d/k3s or "remote" for remote deployments - remote kubernetes cluster (e.g. EKS)
- local.diskPath: If the environment is set to "local", replace "/var/lib/couchdb" with your desired disk path for local storage.
To initiate the deployment process, you need to run the cht-deploy script with the -f flag followed by the path to your values.yaml file, like so:
``bash``
./cht-deploy -f
The script will then install the necessary Python packages, read your values.yaml file, and initiate the deployment process.
If the deployments are not created as expected, check the logs for any errors. If the issue is related to missing deployments, confirm that the correct number of CouchDB nodes is specified in the values.yaml file for example.
During the course of using or managing your CHT installation, you may encounter situations where things are not working as expected. These scripts provide a means to inspect the status of your installation and gather information about its configuration and behavior. Here's when to use which:
Example usage:
./view-logs cht-dev-namespace cht-couchdb-1
Example usage:
./list-deployments cht-dev-namespace
Example usage:
./list-all-resources cht-dev-namespace
Example usage:
./describe-deployment cht-dev-namespace cht-couchdb-1
Keep in mind that you will need to replace cht-dev-namespace and cht-couchdb-1 with your specific namespace and deployment names.