Cloud Native 5 min read

Master Kubernetes Basics: Deploy, Scale, and Update Apps with Simple Commands

This article introduces Kubernetes as an open‑source container orchestration platform, explains its core objects like Pods, Services, ReplicaSets, and Deployments, clarifies its relationship with Docker, and provides a step‑by‑step example covering deployment, exposure, scaling, rolling updates, and rollback using kubectl commands.

Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Master Kubernetes Basics: Deploy, Scale, and Update Apps with Simple Commands

Kubernetes (k8s) is an open‑source container orchestration platform that automates the deployment, scaling, and operation of containerized applications.

Core Kubernetes Objects

Pod: a group of one or more containers that share network and storage resources and are scheduled together on a node.

Service: an abstraction that provides a stable network address and DNS name for a set of Pods, enabling load balancing and discovery.

ReplicaSet: a controller that ensures a specified number of Pod replicas are running, creating or deleting Pods as needed.

Deployment: a higher‑level controller that manages ReplicaSets and offers rolling updates and rollbacks for seamless application version changes.

Kubernetes and Docker

Kubernetes itself does not include a container runtime; it manages containers provided by runtimes such as Docker. Docker supplies the runtime, as well as tools for building, packaging, and sharing containers. Because Docker’s native orchestration is limited to basic container management, Kubernetes is used for more complex scenarios like multi‑container coordination, load balancing, and automatic scaling.

Step‑by‑Step Deployment Example

Deploy the application:

kubectl create deployment myapp --image=myapp:1.0

Expose the application as a NodePort Service:

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

Scale the deployment to three replicas: kubectl scale deployment myapp --replicas=3 Perform a rolling update to version 2.0:

kubectl set image deployment/myapp myapp=myapp:2.0

Rollback the deployment if the update fails: kubectl rollout undo deployment/myapp This basic example demonstrates how to create, expose, scale, update, and roll back an application in Kubernetes; the platform also offers advanced features such as auto‑scaling, high availability, and multi‑tenant support. For more details, consult the official Kubernetes documentation.

deploymentKubernetesDevOpsServiceScalingContainer OrchestrationRolling Update
Full-Stack DevOps & Kubernetes
Written by

Full-Stack DevOps & Kubernetes

Focused on sharing DevOps, Kubernetes, Linux, Docker, Istio, microservices, Spring Cloud, Python, Go, databases, Nginx, Tomcat, cloud computing, and related technologies.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.