Skip to content

Latest commit

Β 

History

History

local-kubernetes-setup

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

README.md

Local Kubernetes + ArgoCD GitOps Setup

A fully local GitOps environment β€” no cloud, no GitHub account, no external services required. One command boots a complete cluster with ArgoCD, a local git server, and a local Docker registry. Deployments are triggered by a single make deploy.

Screenshots

App ArgoCD Gitea
App ArgoCD Gitea
http://localhost:8888 https://localhost:8080 β€” admin / argocd-local http://localhost:3000 β€” gitops / gitops

What's included

Component Purpose
kind Local Kubernetes cluster
ArgoCD Watches the git repo and syncs changes automatically
Gitea Git server running inside the cluster
Registry Local Docker registry on localhost:5001

The deploy loop

make deploy
  └─ builds Docker image β†’ localhost:5001
  └─ patches deploy-id annotation in apps/deployment.yaml
  └─ git commit + push β†’ Gitea (in-cluster)
  └─ triggers ArgoCD hard refresh

ArgoCD detects the new commit
  └─ applies apps/deployment.yaml
  └─ rolling update with readiness probe (zero downtime)

http://localhost:8888 β€” updated within seconds

Clone only this subfolder

git clone --filter=blob:none --sparse https://github.com/messeb/docker-playground.git \
  && cd docker-playground \
  && git sparse-checkout set local-kubernetes-setup \
  && cd local-kubernetes-setup/

Prerequisites

Container engine

Docker is used by default if its daemon is running. Podman is used automatically when Docker is not available. You can also force a specific engine:

# Force podman for the full lifecycle
export CONTAINER_ENGINE=podman
make start
make deploy
make teardown

Or per-command:

CONTAINER_ENGINE=podman make start

Usage

Start everything

make start
Starting local registry on port 5001...
Creating kind cluster 'local'...
Installing ArgoCD v3.0.0...
Waiting for ArgoCD pods to be ready (this takes ~1-2 min)...
Deploying Gitea...
Waiting for Gitea to be accessible...
App pushed to Gitea.
Applying ArgoCD Application...

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃           βœ…  Cluster ready!                        ┃
┃              Running initial deploy...              ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃  🌐 App:      http://localhost:8888                 ┃
┃  πŸ” ArgoCD:   https://localhost:8080                ┃
┃     User: admin / <password>                        ┃
┃  πŸ™ Gitea:    http://localhost:3000                 ┃
┃     User: gitops / Pass: gitops                     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

πŸš€ Starting release...
   πŸ“¦ Build:  a1b2c3d4
   πŸ• Date:   2026-03-29 17:00:00

   βœ… Docker image built
   βœ… Image pushed β†’ localhost:5001/myapp:latest
   βœ… deployment.yaml patched
   βœ… Committed
   βœ… Pushed to Gitea
   βœ… ArgoCD sync triggered

✨ Release a1b2c3d4 live in seconds

   🌐 http://localhost:8888

Deploy a new version

make deploy
πŸš€ Starting release...
   πŸ“¦ Build:  7e6ca446
   πŸ• Date:   2026-03-29 17:27:35

   βœ… Docker image built
   βœ… Image pushed β†’ localhost:5001/myapp:latest
   βœ… deployment.yaml patched
   βœ… Committed
   βœ… Pushed to Gitea
   βœ… ArgoCD sync triggered

✨ Release 7e6ca446 live in seconds

   🌐 http://localhost:8888

Check status

make status
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                    Status                           ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃  πŸ” ArgoCD sync:   Synced                           ┃
┃  πŸ’š ArgoCD health: Healthy                          ┃
┃  πŸ“¦ Deploy ID:     7e6ca446                         ┃
┃  πŸš€ Pods ready:    1 / 1                            ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃  🌐 App:           http://localhost:8888            ┃
┃  πŸ” ArgoCD UI:     https://localhost:8080           ┃
┃     User: admin / <password>                        ┃
┃  πŸ™ Gitea:         http://localhost:3000            ┃
┃     User: gitops / gitops                           ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Tear everything down

make teardown

File structure

β”œβ”€β”€ app/                        # App repo β€” initialized and pushed to Gitea on start
β”‚   β”œβ”€β”€ apps/
β”‚   β”‚   β”œβ”€β”€ deployment.yaml     # Rolling update, readiness probe, revision cleanup
β”‚   β”‚   └── service.yaml        # NodePort β†’ host port 8888
β”‚   β”œβ”€β”€ Dockerfile              # nginx + build-arg substitution
β”‚   β”œβ”€β”€ nginx.conf              # Cache-control headers, etag disabled
β”‚   β”œβ”€β”€ index.html.template     # Page template with {buildnumber} / {builddate}
β”‚   └── Makefile                # build / deploy
β”‚
β”œβ”€β”€ gitea/
β”‚   β”œβ”€β”€ deployment.yaml         # Gitea git server pod (rootless)
β”‚   └── service.yaml            # NodePort β†’ host port 3000
β”œβ”€β”€ argocd/
β”‚   └── application.yaml        # ArgoCD Application β€” watches Gitea in-cluster
β”œβ”€β”€ cluster/
β”‚   └── kind-config.yaml        # kind cluster config, NodePort mappings, registry mirror
β”œβ”€β”€ start.sh                    # Bootstrap script
β”œβ”€β”€ status.sh                   # Cluster and app status
β”œβ”€β”€ teardown.sh                 # Full cleanup script
└── Makefile                    # start / deploy / status / teardown