Skip to main content

Getting Started

The following instructions will let you spin up a local Kind cluster, install FluxCD and deploy all components of the Haven+ stack.

Clone the repository

git clone https://gitlab.com/commonground/haven/havenplus/gitops-flux.git

Ensure you are in the root of the directory:

cd gitops-flux

Install dependencies / required tools

Use asdf to ensure the correct versions of dependencies/tools.

awk '{ system("asdf plugin add " $1) }' < .tool-versions
asdf install

Kind uses Docker under the hood; we've validated running Haven+ on a local environment with Docker Desktop.

Run Locally

info

The startup time for the full Haven+ stack in your local environment, until all services are fully operational, can take some time. For ways to streamline this process, refer to the Technical Details section below.

Spin up a local Kind cluster, install FluxCD and deploy all Haven+ components:

task run-local

Once this command has completed successfully, you can check the status of the deployed workloads as follows.

flux get all

Verify pods in e.g. the cert-manager namespace

kubectl -n cert-manager get pods

Clean-up

To delete your local cluster, run:

task uninstall

Technical Details

To bootstrap the Haven+ stack on a local Kubernetes cluster, we use Task for orchestration. The full Taskfile configuration is available here.

Given the number of applications involved, we’ve implemented several optimizations to streamline the startup process. When you execute the task run-local command, the following steps occur:

  1. Pull container images: All required container images are downloaded upfront to your local environment. This step is performed before cluster creation to avoid errors that may arise if images are pulled directly on the local Kind cluster. Ensure you have enough allocated diskspace in Docker Desktop. The total size of all images pulled will be between 15 - 20GB.

  2. Create a local Kind cluster: A local Kubernetes cluster is provisioned using Kind.

  3. Load container images into Kind: Kind allows preloading container images from your host system into the cluster. By doing this, pods can start immediately without needing to download images on-demand, reducing errors related to inter-service dependencies.

  4. Bootstrap FluxCD: FluxCD is installed and configured in the Kind cluster using the values specified in your .env file.

  5. Boost reconciliation and monitor completion: The reconciliation process is accelerated, and the system monitors all services until they are successfully deployed and running.

Optimizing Haven+ Startup on Your Local Environment

With the following system configuration, the full Haven+ stack starts in under 10 minutes (excluding the initial image pulls):

System: Mac-mini M4
Allocated CPU's in Docker Desktop: 4
Allocated Memory in Docker Desktop: 8GB

Increasing CPU and memory allocation will further reduce startup time. Additionally, you can speed up the process by deploying only the services you need. To do this, fork the repository, edit your .env file accordingly and comment out unnecessary services in the local Kustomization file.