You just wanted a quick private Git server that worked cleanly inside your Kubernetes lab. Instead, you’re four YAML files deep, wondering why your pods can’t reach your repo. Welcome to the puzzle called Gogs Microk8s integration.
Gogs is a lightweight self-hosted Git service, perfect for small teams or edge clusters. Microk8s is Canonical’s low-footprint Kubernetes, meant for local development or compact production footprints. Put them together and you get private source control that travels anywhere your kubelet runs. The trick is wiring them correctly so authentication, persistence, and internal networking behave as expected.
When you run Gogs inside Microk8s, think of it as another microservice in your cluster. The Gogs container talks to a PostgreSQL or SQLite backend, exposes a web interface through a Kubernetes Service, and persists data via a hostPath or PVC. Microk8s makes it trivial to enable required add-ons like DNS, ingress, or storage with a single command. The magic lies in using Microk8s namespaces to isolate builds and protecting Gogs traffic behind cluster-level RBAC.
Configuring Gogs authentication through OIDC or an external provider like Okta is straightforward once your ingress routes are in place. Use the cluster’s internal DNS names to keep traffic local, then forward the necessary ports for external users. Gogs running in Microk8s happily supports internal automation pipelines if you connect it through SSH keys stored as Kubernetes secrets.
If you hit user-mapping or permission errors, check your ServiceAccount scopes and ensure Gogs’s persistent volume uses the right storage-class. Microk8s occasionally introduces subtle permission issues when switching from localhost to a multi-node setup, but a quick reset of your KubeConfig context usually cures it.