Spring Boot demo application generated using the Spring Initializr
Install Docker
Using Arkade install additional dependencies
ark get kubectl helm buildx devspace k3d crane jq yq
k3d cluster create demo1
devspace use namespace dev-01
devspace deploy
devspace purge
k3d cluster delete demo1
This repository pushes both a docker image and an associoated helm chart to Github packages. This enables the software to be installed as follows:
helm upgrade demo1 oci://ghcr.io/myspotontheweb/argocd-workloads-demo/prod/charts/demo1 --version 1.0.14 --install --namespace demo1 --create-namespace
flowchart
ci(CI engine) --> | CI build |reg1[(Pre-prod Registry)]
ci --> |Tagged image+chart build| reg1
reg1 --> |Release promotion| reg2[(Prod Registry)]
reg1 --> |Pull latest chart| k8spprod(Kubernetes Pre-Prod)
reg2 --> |Pull latest chart| k8sprod(Kubernetes Prod)
The CI logic is captured here
A successfull build will trigger sync workflow in the GitOps workloads repo, controller ArgoCD
When code is merged to "main" branch a Docker image is built and pushed to the Pre-prod Docker registry. This image is tagged using the SHA checksum of the latest Github commit.
A new version is generated by pushing a tag on the main branch as follows:
git tag vX.Y.Z -a -m "New release"
git push --tags
This results in a new Docker image and chart being pushed into the pre-prod docker registry
When is release is ready to be deployed to production a workflow copies the Docker image and Helm chart from the pre-prod docker registry into the prod docker registry
We run two docker registries. One holds the releases for pre-production and the other holds the approved production releases. A tool like ArgoCD allows us to run the latest helm chart on the matching Kubernetes cluster.
For further reference, please consider the following sections: