2026-09-30 — What the Kubernetes and GitOps lab taught me¶
Goal¶
I wanted practical Kubernetes experience that I could explain clearly in an interview. The target was deliberately small: three Rocky Linux VMs, one static web application, GitHub Actions for CI, and Argo CD for deployment.
The value of the lab was not the website. It was seeing how the controllers, networking, image registry, and Git workflow fit together.
Kubernetes is a set of reconciliation loops¶
The biggest idea that clicked was desired state. I do not tell Kubernetes to "start these two containers" as a one-off command. I declare that a Deployment should have two replicas. Controllers keep comparing that declaration with the current cluster and work to close the gap.
Argo CD adds another loop above Kubernetes. It compares the live Kubernetes objects with the manifests in Git. Kubernetes then handles the lower-level work of creating and replacing Pods.
That distinction made self-healing much less mysterious:
- Argo CD repairs drift in Kubernetes configuration.
- A Deployment controller maintains the requested number of Pods.
- A kubelet looks after containers on its own node.
- None of those components repairs a failed Proxmox VM.
A Pod is not a node¶
A node is one of the Rocky Linux VMs. A Pod is a disposable workload scheduled onto a node. When a Pod is replaced, it can receive a different IP address and may land on another worker.
That is why clients should not connect to Pod IP addresses. The Service gives a stable name and virtual address in the cluster, while the Ingress provides the HTTP entry point for users outside it.
Readiness is different from merely running¶
A container process can be running before the application is ready to receive traffic. The readiness probe controls whether a Pod becomes a Service endpoint. The liveness probe answers a different question: whether the container has become unhealthy and should be restarted.
For this app, both probes call /healthz. That is enough for a simple static
site, but a real application might use different checks and avoid declaring
itself healthy when an essential dependency is unavailable.
Synced does not mean healthy¶
This became clear during the first automated update. Argo CD showed Synced
because it had successfully applied the version recorded in Git. The
application was still Degraded because Kubernetes could not schedule the new
surge Pod.
The most useful information came from the Pod events. The control-plane node was tainted, and the strict topology-spread rule left no acceptable worker for the temporary extra Pod. Adding a worker-node selector made the set of eligible nodes match the intent of the Deployment.
The practical lesson is to read status in layers. Argo answers whether Git and the cluster agree. The Deployment, Pod conditions, and scheduler events explain whether the workload can actually run.
GitOps reduces credential sharing¶
GitHub Actions never needed direct administrator access to the cluster. It ran tests, built an image, pushed that image to GHCR, and committed the new image tag to Git. Argo CD, already inside the cluster, pulled the desired state from the repository.
This pull model gives a clear audit trail and keeps a powerful Kubernetes credential out of the hosted CI system. It does not remove the need to protect the repository: a manifest change can still affect the cluster, so reviews and branch protection would matter in production.
Immutable image tags make releases easier to trace¶
The Deployment uses the full Git commit SHA as its image tag. I can connect the
running container image to the exact source revision and workflow run that
created it. A moving tag such as latest or main is useful for humans, but it
is a poor record of what was actually deployed.
The ingress path is a chain¶
Reaching the site involved several separate pieces:
browser or curl
-> internal DNS
-> selected cluster node
-> Traefik Ingress
-> Kubernetes Service
-> ready application Pod
Checking the chain one hop at a time was more useful than repeatedly refreshing the browser. The temporary curl Pod proved the Service path before DNS and Ingress were involved.
OPNsense was part of that chain, but not every Kubernetes packet crossed it. Traffic from WireGuard or the management VLAN entered OPNsense and needed an explicit rule to reach TCP 80 on an ingress node. The Kubernetes nodes were all on VLAN 20, so their API, VXLAN, and kubelet traffic stayed on the same Layer 2 network and bypassed the OPNsense interface firewall. Those ports therefore had to be handled by firewalld on the Rocky Linux guests.
The first k8s-demo.home override selected one node. That made the application
easy to reach but did not load-balance the ingress. Using curl with --resolve
and the same Host header let me test the second node without changing DNS. A
virtual IP or external load balancer would be the next step if the ingress
endpoint itself needed redundancy.
Mistakes worth remembering¶
The first control-plane installation registered as localhost.localdomain.
Changing the hostname after installation was not enough; reinstalling K3s with
the correct hostname produced a clean node identity.
The k3s binary also worked by absolute path but not through one sudo command
path. /usr/local/bin/k3s removed the ambiguity and made it obvious which
binary was being called.
The scheduling failure was the best problem in the lab. The configuration
looked sensible until rolling-update surge capacity, node taints, and topology
spread interacted. kubectl describe pod and namespace events turned a vague
Degraded status into a specific constraint problem.
Where this differs from production¶
This is a useful learning environment, but it is not a production design:
- all three VMs share one physical Proxmox host
- there is one control-plane node and no highly available datastore
- the ingress DNS record points to one node instead of a virtual IP or external load balancer
- the demo image is public, so no registry secret is required
- traffic uses internal HTTP rather than managed TLS
- the workflow writes directly to the main branch without an approval gate
- there is no monitoring, backup test, policy engine, or secrets manager yet
Two application replicas protect against a Pod or worker problem only when the remaining infrastructure is available. They do not protect against failure of the single physical host.
Result¶
The final test moved a visible v1.1.0 change from a Git push through tests,
GHCR, a manifest update, Argo CD, and a Kubernetes rolling deployment. The site
was reachable from the Debian management VM and through WireGuard.
The full build and troubleshooting record is in the Kubernetes and Argo CD lab.