Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local GitOps Monorepo (KinD + Flux CD + Kustomize + MongoDB)

This repository is a fully self-contained Monorepo demonstrating end-to-end GitOps delivery for a Node.js + MongoDB application across dev and prod local KinD clusters.

Architecture

  • Monorepo Structure: App source code, Docker configs, KinD cluster manifests, and Flux GitOps declarations reside in the same repository.
  • Clusters:
    • dev-cluster: 1 Control Plane + 3 Workers | 1 App Replica | Exposed at http://localhost:8081
    • prod-cluster: 1 Control Plane + 3 Workers | 3 App Replicas | Exposed at http://localhost:8082
  • Data Persistence: MongoDB StatefulSet retains state on host machine ($HOME/kind-storage/...), persisting data across cluster teardowns.

Prerequisites

Quick Start Guide

1. Create Persistent Host Mount Directories

mkdir -p $HOME/kind-storage/dev-mongo$HOME/kind-storage/prod-mongo
chmod 777 $HOME/kind-storage/dev-mongo$HOME/kind-storage/prod-mongo

Create clusters

kind create cluster --config kind/dev-cluster.yaml
kind create cluster --config kind/prod-cluster.yaml

Sideload image into KinD nodes

kind load docker-image node-app:latest --name dev-cluster
kind load docker-image node-app:latest --name prod-cluster
export GITLAB_TOKEN="glpat_yourPersonalAccessToken"

flux bootstrap github --owner=berkayalan --repository=gitops --branch=main --path=k8s/clusters/dev --personal
flux bootstrap github --owner=berkayalan --repository=gitops --branch=main --path=k8s/clusters/prod --personal

delete all existing KinD clusters at once

kind delete clusters --all

About

Local GitOps Monorepo (KinD + Flux CD + Kustomize + MongoDB)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages