Local Development
Overview
For the purposes of local development, provisioning Kubernetes clusters in the cloud can be expensive and time consuming. And while not all the features can be fully tested locally, i.e. those relying on cloud resources, pod identity and applications (load balancers for example) and so forth, much of the development of the platform team can be done locally on their machine.
Prerequisites
The following tools need to be installed on your local machine:
Tool | Description | Installation Link |
---|---|---|
kubectl | The Kubernetes command-line tool | Install Guide |
helm | The package manager for Kubernetes | Install Guide |
kind | Tool for running local Kubernetes clusters using Docker containers | Install Guide |
We also require the ArgoCD Helm repository setup via
Provisioning a Local Cluster (Standalone)
Within the platform repository we have a release
folder, which can be used to stimulate a tenant repository, keeping all the development within the same repository.
$ tree release -L2
release
├── README.md
├── hub
│ └── clusters
└── standalone
├── clusters
├── config
└── workloads
Expected Development Workflow
As a platform engineer you need to validate a new feature on a standalone deployment model.
- Create a branch for the feature
git checkout -b feat/my-feature
- Note, you dont need to change the branch in the
release/standalone/clusters/dev.yaml
, as for local development, this revision is bypassed and uses your current git branch. - Commit the changes and run
make standalone
- The makefile will build a Kubernetes cluster in kind, using the
release/standalone
and the base tenant repository. - Any changes made to the branch will be reflected within the cluster, and changes are polled from the branch.
- Once the changes have been tested, we can merge to main.
Note, if want validate changes between multiple clusters you can provision another cluster via scripts/make-dev -c prod
.
Additional clusters can be added, simply by adding a new cluster to the release/standalone/clusters
directory, and calling
Cleanup the Cluster
To cleanup the cluster, run make clean