Too good to be true? Here’s the details…
We all know the drill: devs need to be able to work their magic independently. And in the era of containerized microservices that flex between your local machine and the cloud (thanks, Kubernetes), we've got some high expectations. We're talking about environments that:
Sounds like quite a challenge. Well, let's talk options.
Guess what? Kubernetes might already be running on your machine via Docker Desktop. Yep, you read that right – Docker Desktop comes with Kubernetes ready to roll. With this built-in Kubernetes, we're about to set up a local dev environment that feels like the cloud but runs within in minutes.
On top of that we’re bringing in mogenius. It helps you to deploy and manage services on your cluster with a jaw-dropping PaaS experience.
Before we get into the details, make sure you have these tools installed and ready to use:
Let’s get started by deploying a Kubernetes cluster on your local machine.
Boom! You've got a Kubernetes cluster right on your machine now. Look at the bottom left of Docker Desktop – see that "Kubernetes is running"? That's what you're looking for.
Now, open up your command line and type in 'kubectx'. Your cluster should show up as 'docker-desktop'. Set it as the current context with 'kubectx docker-desktop'.
Start off by signing up on mogenius at app.mogenius.com. Put in your email, pick a password and complete the process through the confirmation email.
Organizations act like workspaces, with their own projects, users, and billing. Create one by entering a name and more details if you like.
Time for the fun part: connecting to your Kubernetes cluster. In your organization, open clusters and create a new one. Give it a name and choose "Docker Desktop" as the cluster type.
Here's a basic walkthrough of these steps:
Once you're in the "Connect page," it's time to handle the helm chart for the operator. For it to run with Docker Desktop, flip the switches for Traffic Collector, Cert Manager, Default Backend, and Ingress Controller.
Copy that helm chart and the command line where you’re connected with Docker Desktop (better double-check, ‘kubectx docker-desktop’). Paste it in, hit enter, and let the mogenius operator do its thing. Head over to mogenius and wait for the notification that says "Cluster connected."
To finish the setup go to "Settings" and fill in the load balancer form fields with the IP 127.0.0.1 as IP address and "localhost" for the hostname. And if you want to use the mogenius CI/CD pipeline, enter credentials to connect with your container registry in the respective section on the page. mogenius can build and deploy images right from Github or Gitlab and store them in this registry.
You're all set! Create projects in mogenius and start deploying services to your local cluster. Here's some ideas to begin with:
That’s it, we successfully tackled the challenge of creating a powerful local dev environment that actually behaves like production. With Docker Desktop and mogenius, we truly found the winning team with zero cloud costs and 🥹-like Developer Experience.
Stay tuned – next time, we're talking about taking this local magic to production. Got thoughts or questions? Reach out to us at community@mogenius.com.