You finally get your Microk8s cluster running, pods are happy, kubelet behaves, and then MySQL strolls in like it owns the place. Suddenly, secrets need storing, volumes need persistence, and your cluster starts acting like it forgot who owns what.
Microk8s makes Kubernetes feel local and contained, fast enough for edge or dev environments. MySQL brings data gravity to that setup, the reliable, no-nonsense database every stack ends up using. Together, they can be an elegant pair, but only if identity, storage, and automation play nicely.
At first glance, connecting Microk8s to MySQL feels easy. Apply a Deployment, add a Service, and call it a day. But then you hit real-world constraints. You need proper user management. You need persistent volumes that survive restarts. You need secure credentials that are easy to rotate. That’s where understanding the logic, not just the YAML, pays off.
Microk8s isolates workloads in lightweight containers that speak Kubernetes natively. MySQL runs inside those pods, but the trick is making sure the data outlives the containers. Use hostPath or PVCs backed by storage plugins like OpenEBS or Ceph. Keep credentials in Kubernetes Secrets, not in environment variables. Map MySQL’s network access to internal Services so your application never exposes the port to the wider world.
When those layers line up, your Microk8s MySQL setup feels predictable. Backups become part of automation rather than manual panic buttons. Integrations with tools like Okta or OIDC-backed IAM systems can control which service accounts connect to the database, giving you predictable, audit-friendly identity patterns. Platforms like hoop.dev take that a step further, turning access logic into guardrails. Instead of hoping engineers rotate credentials, the platform enforces policies automatically, no exceptions and no excuses.