You have Kubernetes humming along on your laptop or edge cluster, containers spinning, pods scaling. Then someone says, “Let’s wire up TeamCity for continuous builds.” You sigh because that usually means permission puzzles and YAML spelunking. With Microk8s and TeamCity together, the setup can actually be boring—in a good way.
Microk8s is a lightweight, production-grade Kubernetes that runs anywhere: servers, desktops, even Raspberry Pi. It gives you isolation without heavy orchestration overhead. TeamCity handles build automation with quiet precision: pipelines, test reports, deployment triggers. When these two work as one, your CI/CD loop becomes quick, local, and secure. That’s what most teams are chasing.
Here’s how they connect in practice. Microk8s provides the Kubernetes API surface, RBAC rules, and service accounts. TeamCity uses its Kubernetes Cloud integration to schedule build agents as ephemeral pods. Each agent appears, runs the job, and vanishes—leaving no residue or privileged context behind. Secrets pass through Kubernetes-managed mounts or external stores, typically using OIDC or Vault so IAM and access policies stay centralized. The result is repeatable, identity-aware builds that map cleanly onto your cluster structure.
Quick answer: To integrate Microk8s TeamCity, enable the Kubernetes Cloud plugin inside TeamCity, point it to your Microk8s API server using a valid token or RBAC user, then define agent templates. TeamCity will start pods directly in Microk8s for each build and remove them automatically afterward.
Security rules can trip you up. Always align ServiceAccount scopes with your TeamCity build types. Do not grant cluster-admin rights just to make pipelines work. Rotate tokens regularly or tie them to an OIDC provider like Okta or AWS IAM to maintain audit trails. If jobs need access to internal registries, use Kubernetes secrets referenced in TeamCity parameters instead of writing keys in plaintext.