← Back to Blog

๐Ÿš€ Deploying 'Hello World' in Minikube with Nginx

๐Ÿš€ Deploying "Hello World" in Minikube with Nginx Setting up "Hello World" in Minikube using Nginx is a great starting point for anyone learning Kubernetes. This post walks you through the steps to achieve this, even if you're new to the world of containers and Kubernetes.

๐Ÿš€ Deploying "Hello World" in Minikube with Nginx

Setting up "Hello World" in Minikube using Nginx is a great starting point for anyone learning Kubernetes. This post walks you through the steps to achieve this, even if you're new to the world of containers and Kubernetes.


๐Ÿ’ก What You'll Learn:

  • Install Minikube and start a cluster

  • Deploy Nginx and expose a "Hello World" page

  • Verify the setup with a browser and a simple Kubernetes service


๐Ÿ› ๏ธ Step 1: Install Minikube

Before starting, make sure you have Minikube installed. If not, follow these instructions:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& sudo install minikube-linux-amd64 /usr/local/bin/minikube

Once installed, start the cluster:

minikube start

โœ… Pause to verify: At this point, Minikube should be running. You can verify it with:

kubectl get nodes


๐Ÿ› ๏ธ Step 2: Deploy Nginx with a Hello World page

Now, we will deploy a simple Nginx container with a custom "Hello World" page.

  • Create a deployment:

kubectl create deployment helloworld --image=nginx

  • Expose the deployment as a service:

kubectl expose deployment helloworld --type=NodePort --port=80

This creates a service that exposes port 80 of the Nginx container.


๐Ÿ› ๏ธ Step 3: Accessing the Service

Now that your Nginx deployment is up and running, access it using the following command to get the URL:

minikube service helloworld --url

Copy the provided URL and open it in your browser. You should see the "Welcome to Nginx!" default page.


๐Ÿ’ก Customizing the "Hello World" Page

If you'd like to customize the message, you can create a ConfigMap and update the default Nginx index.html file. Here's how:

  • Create a ConfigMap:

kubectl create configmap helloworld-config --from-literal=index.html="

Hello World from Nginx on Minikube!

"

  • Apply the ConfigMap to your Nginx deployment:

kubectl set volume deployment/helloworld --add --name=helloworld-config --mount-path=/usr/share/nginx/html --sub-path=index.html --configmap-name=helloworld-config


๐Ÿ–ผ๏ธ Adding a Screenshot

After deploying Nginx, grab a screenshot of the running service from your browser and include it here to show the Hello World page in action!


๐ŸŽฏ Summary

Youโ€™ve now successfully:

  • Installed Minikube and started a Kubernetes cluster.

  • Deployed an Nginx web server with a simple "Hello World" message.

  • Exposed the service for browser access.

With this foundation, you're ready to dive deeper into Kubernetes and explore more complex deployments!


๐Ÿ”— Connect with me:


Imported from rifaterdemsahin.com ยท 2025