Skip to content

This tool provides a single command interface to bring up, pause, inspect, and destroy a complete Kubernetes-based DevOps environment on a laptop.

Notifications You must be signed in to change notification settings

avinash7r/Devops-Local-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Lab - Local DevOps Platform Manager

A fully automated local Internal Developer Platform built using:

  • Docker
  • kind (Kubernetes in Docker)
  • Local container registry
  • Argo CD (GitOps)
  • Bash-based lifecycle automation

This tool provides a single command interface to bring up, pause, inspect, and destroy a complete Kubernetes-based DevOps environment on a laptop.


Why I Built This

Modern cloud-native workflows require:

  • A container registry
  • A Kubernetes cluster
  • GitOps deployment tooling
  • Image pull configuration
  • Repeatable environment setup

Most tutorials rely on manual steps (kind load, ad-hoc port-forwarding, repeated installations). This project eliminates that.

I built this tool to:

  • Understand containerd registry mirrors
  • Automate Kubernetes infrastructure lifecycle
  • Implement GitOps locally with Argo CD
  • Learn real-world DevOps patterns (mirrors, networking, idempotency)
  • Create a reproducible platform similar to ECR + EKS + Argo CD

The result is a production-like cloud-native platform running entirely on a laptop.


Architecture Overview

Docker
  ├── Local Registry (port 5000)
  ├── Registry UI (port 8080)
  └── kind Kubernetes cluster
         └── containerd mirror → lab-registry:5000

Kubernetes
  └── Argo CD (port-forwarded to 8888)

Key design decisions:

  • Registry is persistent across cluster recreations
  • Kind cluster is disposable
  • Argo CD password is automatically enforced
  • Registry is connected to the kind Docker network with a DNS alias
  • No kind load required ever

Ports Used

Component Port Purpose
Docker Registry 5000 Push/Pull container images
Registry UI 8080 View images in local registry
Argo CD Server 8888 GitOps UI (port-forwarded)
Kubernetes API dynamic Managed internally by kind

Access URLs:

  • Registry: http://localhost:5000
  • Registry UI: http://localhost:8080
  • Argo CD: https://localhost:8888

Commands

The platform is controlled through a single CLI entrypoint:

lab <command>

lab info

Displays Available commands

lab up

Brings the entire platform online.

Ensures:

  • Docker is running
  • kind cluster exists (creates if missing)
  • Local registry is running
  • Registry is connected to kind network
  • Argo CD is installed (if absent)
  • Argo CD password is set
  • Port-forward is active

Idempotent - safe to run multiple times.


lab down

Pauses platform services without deleting data.

Stops:

  • Argo CD controllers (scaled to zero)
  • Local registry containers

Preserves:

  • Kubernetes cluster
  • Registry data
  • Argo CD configuration

lab status

Displays structured system state:

  • Docker status
  • Kubernetes cluster state
  • Registry container state
  • Data persistence
  • Argo CD readiness

Designed to be deterministic and automation-friendly.


lab destroy

Completely wipes the platform.

Deletes:

  • Argo CD namespace
  • Local registry containers
  • Registry data directory
  • kind Kubernetes cluster

After destroy, running lab up recreates everything cleanly.


Development Workflow

Build and push images:

docker build -t localhost:5000/app:1 .
docker push localhost:5000/app:1

Deploy to Kubernetes:

kubectl apply -f .

No kind load required. The registry mirror is automatically configured via containerd.


Registry Integration with kind

The kind cluster is configured with:

containerdConfigPatches:
  mirror localhost:5000 → lab-registry:5000

The registry container is attached to the kind Docker network with an alias:

lab-registry

This enables containerd inside Kubernetes to resolve and pull images correctly.


Argo CD Integration

Argo CD is:

  • Installed automatically if absent
  • Made accessible via port-forward
  • Given a fixed admin password (bcrypt hash)
  • Preserved across normal lab up runs

Admin login:

Username: admin
Password: <configured password>

Password is automatically enforced during lab up.


Project Structure

lab/
├── lab                # CLI entrypoint
├── lib/
│   ├── core.sh
│   ├── docker.sh
│   ├── kind.sh
│   ├── registry.sh
│   └── argocd.sh
├── registry/
│   └── docker-compose.yml
├── kind/
│   └── kind.yaml
└── config/
    └── argocd.env

What This Project Demonstrates

  • Bash-based infrastructure automation
  • Idempotent lifecycle management
  • containerd registry mirrors
  • Docker network alias handling
  • GitOps automation with Argo CD
  • Persistent secret management
  • Real-world DevOps troubleshooting

About

This tool provides a single command interface to bring up, pause, inspect, and destroy a complete Kubernetes-based DevOps environment on a laptop.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages