TC

Tom Chien: Kubernetes lab portal

The Lab

A Self-Hosted CI/CD and Kubernetes lab on a Mac mini

Kubernetes comes from Docker Desktop on my Mac mini in my home lab. A host-level Nginx accepts traffic on port 80 and hands it to the cluster's ingress controller, which routes each application hostname to the right service. Harbor and Gitea run in the same cluster, but each is exposed by its own LoadBalancer service on a host port, so they skip the ingress. Everything below is hosted on that one machine, including this site.

How a request reaches a pod

DNS is managed at GoDaddy. Application traffic passes through the host Nginx and the cluster ingress before landing on a pod. Harbor and Gitea are pods in the cluster too, but each is exposed by its own LoadBalancer service on :8080 and :3001, so they are not behind the ingress.

Internet
1

Visitor

Opens a hostname in the browser.

*.tomchien.com

2

GoDaddy DNS

Records for tomchien.com point every hostname at the lab.

host.tomchien.com → Mac mini

Mac mini · macOS host
3

Nginx on the host

Edge reverse proxy: takes port 80 and forwards it to the cluster ingress.

listen :80 → 127.0.0.1:8081

Docker Desktop · Kubernetes
4

ingress-nginx

LoadBalancer on 127.0.0.1. Routes each application hostname by its Host header.

127.0.0.1 : 8081

5Service → Pod

  • it-cost-devdev environment
  • it-cost-prodit-cost-prod.tomchien.com
  • portaltomchien.com · this site

LoadBalancer Service → Pod · own ports, not behind ingress-nginx

  • harborharbor.tomchien.com:8080
  • giteagitea.tomchien.com:3001

From git push to running pod

Gitea Actions builds the image on the Docker Desktop daemon, stores it in Harbor and deploys it with Helm. A branch push goes to dev, a tag goes to prod.

1

git push

A branch or tag push starts the pipeline.

dev | v1.2.3

2

Gitea Actions

act_runner picks up the workflow from the repo.

cicd.yaml

3

docker build

Runner pod uses the Docker Desktop daemon socket.

multi-stage Dockerfile

4

Harbor

Image is pushed to the private registry.

registry :8080

5

helm upgrade

Chart is rolled out to the namespace.

--atomic

6

Kubernetes

Pods pull from Harbor with a pull secret.

Deployment · Service · Ingress

Lab services

Live endpoints you can open yourself.

Beyond the terminal

Get to know me through my travel album

Outside of work I like to explore. Pin by pin, the travel map is a visual diary of the places I have been.

Travel map

Sign in with the credentials below to browse the album.

tomchien.com/travelmap
User
TBD
Password
TBD