Tutorials  /  Kubernetes

Local Kubernetes Development: A Guide to Using Minikube

Ccentron Redaktion · November 2024 ·4 min read ·Kubernetes, Tutorial

Contents

  1. Prerequisites
  2. Conclusion

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. Terms like cluster, pod, and namespace are explained in the glossary entry Kubernetes.

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 from Germany – control plane included, nodes from €19.02 per month. 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

Claim €200 credit

Test your setup on ccloud³

Sign up for ccloud³ and receive €200 starting credit for your project.

centron Redaktion Technical editorial team

The centron editorial team writes guides from day-to-day operations: tested on our own platform, run in our data centre in Hallstadt near Bamberg.

Category Kubernetes
Share
Still have questions?

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

Was this tutorial helpful?

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

Comments

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.

Get started for free

Sign up and receive €200 credit at centron within your first 60 days.

This promotional offer applies to new accounts only. Available exclusively to businesses.