Introduction to Kubernetes: Deploying a Simple Application
This article was AI-drafted and has not been reviewed yet. Spotted a mistake? Tell us.
Learn the basics of Kubernetes and how to deploy a simple application using pods, services, and deployments.
Introduction to Kubernetes
Kubernetes is a popular container orchestration platform that helps you deploy and manage containerized applications. In this tutorial, we will learn how to deploy a simple application using Kubernetes.
Step 1: Install Kubernetes
To get started with Kubernetes, you need to install it on your machine. You can download the Kubernetes installer from the official Kubernetes website.
# Install Kubernetes on Ubuntu-based systems
sudo apt update
sudo apt install kubeadm -y
Step 2: Create a Deployment
Once Kubernetes is installed, we can create a deployment. A deployment is a YAML file that defines the application to be deployed.
# deployment.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
spec:
replicas: 3
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: gcr.io/codelab-184332/monolith:1.0.0
ports:
- containerPort: 80
Step 3: Apply the Deployment
Now that we have the deployment YAML file, we can apply it using the kubectl command.
# Apply the deployment
kubectl apply -f deployment.yml
In this tutorial, we learned how to install Kubernetes, create a deployment, and apply it using the kubectl command. With this knowledge, you can deploy your applications using Kubernetes and manage them using pods, services, and deployments.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based kubernetes courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for kubernetes books — check the publication year so the examples match current versions.
Search Amazon →