☸️Kubernetes

Automate deployment, scaling, and management of Harmony

Harmony can be deployed on a Kubernetes cluster with just a single command. What Kubernetes (k8s) allows you to do is to seamlessly automate deploying, scaling, auto-healing your services and much more.

The files existing in the source code are tested for a local Kubernetes cluster, ideally being created using the Docker Desktop app. You can test scaling deployment replicas or auto healing features by runing kubectl commands on your machine.

For production deployment, feel free to make any modifications to match your environment.

Here's the prerequisites to deploy Harmony in a local Kubernetes cluster:

Create a config map for the development certificate

When you configured a development certificate, a harmony.pfx file has been created at $env:USERPROFILE\.aspnet\https\ folder on your machine. Run the following command to create a k8s config map.

kubectl create configmap cert-config-map --from-file <your-path-here>\harmony.pfx

Replace the <your-path-here> with your own path coming from $env:USERPROFILE\.aspnet\https\. For example:

kubectl create configmap cert-config-map --from-file C:\Users\chsakell\.aspnet\https\harmony.pfx

The config map will make harmony.pfx file available on your cluster.

Create Harmony images

Open a terminal and navigate at the root of Harmony's solution where the docker-compose.yml file exists and run the following command to create the docker images:

docker compose build

Deploy pods on Kubernetes cluster

Open a terminal and navigate at the root of Harmony's solution where a .k8s folder exists. Run the following command to deploy harmony on your local Kubernetes:

k create -f .\.k8s\

The command creates all Kubernetes deployments and services existing inside the .k8s folder

Harmony should be up and running at http://localhost:7096/

Last updated