A lightweight, local Kubernetes development playground using k3d, kind or talos.
Kubegarden is a developer-friendly environment designed for quick and easy setup of local Kubernetes clusters. It integrates popular tools like ArgoCD, Ingress-NGINX, and more to provide a seamless platform for testing Kubernetes configurations and deploying cloud-native applications.
This section gives a small introduction into the exact directory structure of this project, as it is of importance.
All applications are deployed by ArgoCD.
This GitHub project is configured as a Git generator in ArgoCD's ApplicationSet.
Here, we use directory path segments as values for the application deployment, namely:
<application name>/<environment>/<cluster to deploy to>/<Kubernetes namespace>/
This project includes a Dev Container with the following features:
- Local cluster orchestration via k3d, kind or talos
- GitOps-ready with ArgoCD
- Ingress support using NGINX Ingress Controller
- Easily customizable with Taskfile automation
- Plug-and-play environment for Kubernetes experimentation
For the DevContainer to run, there are a few requisites:
- Docker must be installed
- VSCode must be installed -- VSCode will not install extensions by Microsoft
- Install the Dev Containers VSCode extension
- Open this project in VSCode and when asked whether to start the dev container, acknowledge
- To follow the progress, you can click the notification 'Starting Dev Container (show log)'
- Now copy the
.env.examplefile and configure the.envfile in this project, and put in there:## GLOBAL CLUSTER_TYPE=k3d # There are 3 options. k3d, kind or talos SKIP_DEPLOY=false # Set to `true` if you only want to deploy the minimal components the run Kubernetes ## GITHUB/GITLAB CREDENTIALS USERNAME= PERSONAL_ACCESS_TOKEN= ## CILIUM CILIUM_VERSION=1.17.4 ## TALOS TALOS_HA=false # Set to `true` of you want to deploy 3 Talos nodes K8S_VERSION=1.30.4 # Which version of Kubernetes you want to install ### ARGOCD ARGOCD_REPO_URL=https://github.com/ktijssen/kubegarden.git ARGOCD_BOOTSTRAP_DIR=argocd/dev/$CLUSTER_TYPE/argocd ARGOCD_APPSET_NAME=infra-apps
These steps are only needed when you are about to run the infrastructure development environment:
-
Open a new terminal inside the DevContainer, using the VSCode 'terminal' panel and type:
task up
This task will create a Kubernetes cluster. ArgoCD will be bootstrapped on this cluster.
-
From your host system's browser, you can now visit:
| Task Name | Description |
|---|---|
up |
Deploys the entire local development environment. |
destroy |
Destroys the entire local development environment. |
switch |
Switches the branch that the management ApplicationSet tracks in Git. |
sync-local |
Watches local changes and applies them to the cluster. |
sync |
Triggers a sync for one or more services. |
sync-all |
Triggers a sync for all services. |
sync-profiles |
Syncs a predefined selection of applications. |
apply-local |
Applies local changes once to the local cluster. |
To view all available tasks:
task --list