0Pricing
DevOps Bootcamp · Lesson

Deploying a Simple App

Use kubectl to deploy a basic containerized application to your Minikube cluster.

Deploying a Simple App is a free DevOps Bootcamp lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Your First App on Kubernetes

Welcome! In this lesson, you'll take a big step: deploying your very first application to your Minikube cluster.

We'll use a powerful command-line tool called kubectl to manage your app's journey from code to a running service.

Deploying a Simple App — illustration 1

Introducing Deployments

In Kubernetes, a Deployment is how you tell the cluster to run your application.

  • It manages a set of identical application copies (Pods).
  • It ensures a specified number of these copies are always running.
  • Think of it as the blueprint and manager for your app's instances.

Deploying with `kubectl`

The easiest way to get an app running is with the kubectl create deployment command.

You just need to give your deployment a name and specify the container image you want to run. Kubernetes handles the rest!

Creating Your First Deployment

Let's deploy a simple Nginx web server. This command tells Kubernetes to create a Deployment named nginx-deployment using the nginx Docker image.

kubectl create deployment nginx-deployment --image=nginx

Run this command in your terminal where Minikube is running.

Verify Your Deployment

After running the command, Kubernetes starts creating the necessary resources. You can check their status:

  • To see your Deployment: kubectl get deployments
  • To see the Pods created by the Deployment: kubectl get pods

Look for your nginx-deployment and its corresponding Pods!

Why Services Are Key

Your Nginx Pod is running, but how do users access it?

  • Pods have temporary IP addresses.
  • Pods can die and be replaced, getting new IPs.
  • A Service provides a stable network endpoint, acting as a gateway to your Pods.

It ensures traffic always reaches a healthy Pod, even if Pods come and go.

Exposing Your Application

To make your Nginx accessible, we'll create a Service using kubectl expose. We'll specify the deployment name and the port.

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

This creates a Service that routes external traffic to port 80 of your Nginx Pods.

Accessing Your App Locally

Now that your Nginx Deployment is exposed by a Service, Minikube can help you access it.

Run the following command, and Minikube will open a browser window to your Nginx web server!

minikube service nginx-deployment

You should see the "Welcome to nginx!" page.

Cleaning Up Your Cluster

It's good practice to clean up resources you no longer need. This frees up resources in your Minikube cluster.

  • To delete the Service: kubectl delete service nginx-deployment
  • To delete the Deployment (which also removes its Pods): kubectl delete deployment nginx-deployment

Always delete the Service first, then the Deployment.

Quick Check

You've successfully deployed and exposed an application! Which sequence of kubectl commands would you use to first deploy an app named my-app using the busybox image, and then expose it as a NodePort service on port 8080?

Recap: Your App is Live!

Congratulations! You've successfully deployed, exposed, and accessed your first application on Kubernetes using Minikube.

  • We used kubectl create deployment to run our container.
  • We used kubectl expose deployment to make it accessible via a Service.
  • We accessed it with minikube service and cleaned up with kubectl delete.

You're now one step closer to mastering Kubernetes!

Frequently asked questions

Is the “Deploying a Simple App” lesson free?

Yes — the full text of “Deploying a Simple App” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.

What will I learn in “Deploying a Simple App”?

Use kubectl to deploy a basic containerized application to your Minikube cluster. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Deploying a Simple App” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Minikube Installation & Setup
  2. Kubeconfig and Contexts
  3. Deploying a Simple App
  4. Inspecting and Troubleshooting Your Cluster
← Back to DevOps Bootcamp