Tutorials  /  Container & Cloud

Local Kubernetes Development: A Guide to Using Minikube

Ccentron Redaktion · November 2024 ·4 min read ·Container & Cloud, Tutorial

Learn how to develop and test your Kubernetes applications locally with Minikube. Our comprehensive guide walks you through installation, setting up the dashboard, and deploying sample applications.

Kubernetes has emerged as a leading open-source platform for container orchestration, designed for automating software deployment, scaling, and management. In enterprises, it’s often used for horizontally scaling server resources. Before deploying Kubernetes in production, it’s advisable to test the configuration. Minikube comes into play here—a tool created by Kubernetes developers to simulate a local Kubernetes cluster environment on a single machine.

Prerequisites

Before you begin, you should be familiar with Kubernetes basics. You’ll also need Docker, Homebrew (if you’re using macOS or Linux), and sufficient resources on your computer.

brew install minikube

Step 1: Installing and Running Minikube

You can install Minikube via Homebrew (on macOS or Linux) or through the official documentation for Windows. Once Minikube is installed, start it with the command `minikube start` to create a local Kubernetes cluster environment.

minikube start

Part 2: Accessing the Kubernetes Dashboard

Minikube offers a Kubernetes dashboard by default, allowing you to monitor your cluster and manually deploy applications. You can launch the dashboard with the command `minikube dashboard`.

minikube dashboard

Part 3: Deploying and Testing a Sample Application

You can deploy a test application on your Minikube cluster using the command `kubectl create deployment`. In this tutorial, we’ll use Google’s "hello-app" example. Once the app is deployed, you can access and test it via Minikube.

kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0

kubectl expose deployment web --type=NodePort --port=8080

minikube service web --url

Part 4: Managing Minikube Resources and Filesystem

Minikube offers various commands to manage your cluster. For instance, you can modify resource configuration with `minikube config` or mount local directories to the cluster with `minikube mount`.

minikube config set memory 4096

minikube delete

minikube start

minikube mount $HOME:/host

Part 5: (Optional) Working with Multiple Kubernetes Clusters

Minikube allows managing multiple profiles to work with different Kubernetes versions. You can create, switch, and configure profiles to navigate between clusters.

minikube start -p new-profile

minikube profile new-profile

minikube config get profile

K8

Matching infrastructure at centron

From container to cluster: managed Kubernetes with cStack starts at €29.99 per month – control plane, autoscaler and traffic included. Explore managed Kubernetes →

Conclusion

Using Minikube for local development and testing offers a convenient way to develop and test Kubernetes applications before going to production. By following the steps presented in this tutorial, you can expand your Kubernetes knowledge and ensure your applications run smoothly.

While this tutorial covers basic steps for using Minikube, there are many more advanced features and best practices to discover. We recommend exploring additional Kubernetes tutorials to further enhance your skills and unlock the full potential of Minikube. Local Kubernetes Development: A Guide to Using Minikube

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Container & Cloud
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren