Skip to content

markof88/local-platform-engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Platform Engineering with vind, Sveltos and ArgoCD

A fully local Kubernetes platform engineering demo running entirely in Docker. No cloud account needed. No cost. Runs on your laptop.

What this demo shows

  • Multiple Kubernetes clusters running locally using vind (vCluster in Docker)
  • Sveltos managing progressive rollouts across clusters using ClusterPromotion
  • ArgoCD for GitOps sync. Installed as platform infrastructure, not managed by Sveltos
  • Full GitOps loop: push to Git → ArgoCD syncs → Sveltos deploys progressively

Prerequisites

  • Docker Desktop
  • vCluster CLI v0.34.0+
  • kubectl
  • helm
  • sveltosctl v1.10.0+

Architecture

Architecture

Repository Structure

bootstrap/
├── install-argocd.sh          # Run once to install ArgoCD
└── argocd-app-sveltos.yaml    # Run once to connect ArgoCD to this repo
sveltos/
└── progressive/
└── clusterpromotion-podinfo.yaml  # Progressive rollout definition

Installation

1. Install vCluster CLI

vcluster upgrade --version v0.34.0
vcluster use driver docker
vcluster platform start

2. Create clusters

sudo vcluster create mgmt
sudo vcluster create dev
sudo vcluster create staging

Note: sudo is required on Mac for LoadBalancer support.

3. Save kubeconfigs

vcluster connect mgmt --print > /tmp/mgmt.yaml
vcluster connect dev --print > /tmp/dev.yaml
vcluster connect staging --print > /tmp/staging.yaml

4. Fix Docker networking

Each vCluster runs in an isolated Docker network. Connect them to a shared network so Sveltos on mgmt can reach dev and staging:

docker network create vcluster-shared
docker network connect vcluster-shared vcluster.cp.mgmt
docker network connect vcluster-shared vcluster.cp.dev
docker network connect vcluster-shared vcluster.cp.staging

Get the shared network IPs:

docker inspect vcluster.cp.dev | grep -A 15 vcluster-shared
docker inspect vcluster.cp.staging | grep -A 15 vcluster-shared

Fix kubeconfigs with shared network IPs and correct port (8443):

# Replace with your actual IPs from above
sed 's/localhost:PORT/172.18.0.3:8443/' /tmp/dev.yaml > /tmp/dev-fixed.yaml
sed 's/localhost:PORT/172.18.0.4:8443/' /tmp/staging.yaml > /tmp/staging-fixed.yaml

5. Install Sveltos

export KUBECONFIG=/tmp/mgmt.yaml

helm repo add projectsveltos https://projectsveltos.github.io/helm-charts
helm repo update
helm install projectsveltos projectsveltos/projectsveltos \
  -n projectsveltos \
  --create-namespace \
  --version=1.10.0

kubectl get pods -n projectsveltos

6. Label mgmt cluster

kubectl label sveltoscluster mgmt -n mgmt type=mgmt

7. Register dev and staging clusters

kubectl create namespace dev
kubectl create namespace staging

sveltosctl register cluster \
  --namespace=dev \
  --cluster=dev \
  --kubeconfig=/tmp/dev-fixed.yaml \
  --labels=env=dev

sveltosctl register cluster \
  --namespace=staging \
  --cluster=staging \
  --kubeconfig=/tmp/staging-fixed.yaml \
  --labels=env=staging

kubectl get sveltoscluster -A --show-labels

8. Bootstrap ArgoCD

bash bootstrap/install-argocd.sh
kubectl apply -f bootstrap/argocd-app-sveltos.yaml

ArgoCD syncs Sveltos resources from this repo. Sveltos handles progressive rollouts to dev and staging automatically.

Verify

# Check all clusters are ready
kubectl get sveltoscluster -A

# Check progressive rollout status
kubectl get clusterpromotion podinfo-rollout -o yaml | grep -A 20 status

# Access podinfo on dev
export KUBECONFIG=/tmp/dev.yaml
kubectl port-forward svc/podinfo 9898:9898 -n podinfo
open http://localhost:9898

# Access podinfo on staging
export KUBECONFIG=/tmp/staging.yaml
kubectl port-forward svc/podinfo 9898:9898 -n podinfo
open http://localhost:9898

GitOps in action

Edit sveltos/progressive/clusterpromotion-podinfo.yaml and push to main. ArgoCD syncs the change to mgmt. Sveltos deploys to dev first, waits 2 minutes, then promotes to staging automatically.

Key gotchas

  1. Use sudo vcluster create on Mac for LoadBalancer support
  2. Each vCluster gets its own isolated Docker network. Shared network is required
  3. vCluster API server listens on port 8443 not 6443
  4. Use localhost kubeconfigs for local kubectl access, container IPs for Sveltos registration
  5. Sveltos values field requires pipe | , nested YAML map will not work

Tools used

  • vind | vCluster in Docker
  • Sveltos | Kubernetes add-on controller
  • ArgoCD | GitOps continuous delivery
  • Podinfo | Demo microservice

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages