<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: UpCloud</title>
    <description>The latest articles on DEV Community by UpCloud (@upcloud).</description>
    <link>https://dev.to/upcloud</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F10365%2Fe28a31bc-84a2-4972-9626-8f3bf9d14e03.png</url>
      <title>DEV Community: UpCloud</title>
      <link>https://dev.to/upcloud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/upcloud"/>
    <language>en</language>
    <item>
      <title>How Kubernetes Automates and Manages Your Docker Containers</title>
      <dc:creator>Saravanan Gnanaguru</dc:creator>
      <pubDate>Mon, 21 Apr 2025 13:06:10 +0000</pubDate>
      <link>https://dev.to/upcloud/how-kubernetes-automates-and-manages-your-docker-containers-278n</link>
      <guid>https://dev.to/upcloud/how-kubernetes-automates-and-manages-your-docker-containers-278n</guid>
      <description>&lt;p&gt;Blog Description: Learn how we can use Kubernetes to automate the deployment, scaling, and management of Docker containers. Discover how it simplifies container orchestration and enhances application reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today’s microservices-driven world, Docker revolutionized how we build and package applications. But managing containers at scale? That’s where Kubernetes steps in. Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications — especially those created with Docker.&lt;/p&gt;

&lt;p&gt;As part creating the Demo I've used &lt;code&gt;UpCloud&lt;/code&gt; - A Leading European Cloud Provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why UpCloud Good for Containers and Kubernetes?
&lt;/h2&gt;

&lt;p&gt;UpCloud is a high-performance cloud provider known for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;⚡ Ultra-fast MaxIOPS storage&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🌍 Global data centers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🧩 Easy Kubernetes-ready infrastructure (via manual setup or Terraform)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💰 Cost-effective pricing for scalable clusters&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you're starting locally with Minikube or going full-scale with K8s on cloud VMs, UpCloud gives you the flexibility and performance edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Docker?
&lt;/h2&gt;

&lt;p&gt;Docker is a tool that packages your code, libraries, and dependencies into a container—an isolated, lightweight executable. Containers solve the “it works on my machine” problem, ensuring consistent environments across dev, test, and production.&lt;br&gt;
But what happens when you have hundreds or thousands of these containers?&lt;/p&gt;
&lt;h2&gt;
  
  
  What Is Kubernetes?
&lt;/h2&gt;

&lt;p&gt;Kubernetes (aka K8s) is an open-source container orchestration engine developed by Google. It manages clusters of Docker containers, offering automation, monitoring, and self-healing capabilities out of the box.&lt;/p&gt;
&lt;h2&gt;
  
  
  How Kubernetes helps to Orchestrate Docker Containers
&lt;/h2&gt;

&lt;p&gt;Let’s break down the Orchestration functionality of Kubernetes brings:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Automated Deployment and Rollbacks
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Define your desired container state in YAML files.&lt;/li&gt;
&lt;li&gt;Kubernetes ensures the cluster matches this state.&lt;/li&gt;
&lt;li&gt;Supports rolling updates and easy rollbacks if something goes wrong.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2. Self-Healing Mechanisms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Failed containers? Kubernetes replaces them automatically.&lt;/li&gt;
&lt;li&gt;Restarts containers if they crash.&lt;/li&gt;
&lt;li&gt;Removes non-responsive containers from the network.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3. Load Balancing and Service Discovery
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Automatically distributes network traffic across containers.&lt;/li&gt;
&lt;li&gt;Built-in DNS service allows containers to find each other by name.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4. Horizontal Scaling
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Scale container instances up/down based on CPU/memory usage.&lt;/li&gt;
&lt;li&gt;Manual or automatic scaling using the Horizontal Pod Autoscaler.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  5. Resource Optimization
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Efficient bin-packing ensures optimal use of compute resources.&lt;/li&gt;
&lt;li&gt;Limits and requests help avoid resource hogging.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Core Components of Kubernetes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkx263x1ox4cyt6fk12tj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkx263x1ox4cyt6fk12tj.png" alt="k8s component architecture" width="800" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Category&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Component&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Definition&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Control Plane&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;kube-apiserver&lt;/td&gt;
&lt;td&gt;Handles all REST requests and serves as the front-end of the Kubernetes control plane.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;etcd&lt;/td&gt;
&lt;td&gt;Stores all Kubernetes cluster data in a distributed, consistent key-value store.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;kube-scheduler&lt;/td&gt;
&lt;td&gt;Assigns pods to nodes based on defined scheduling rules and resource availability.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;kube-controller-manager&lt;/td&gt;
&lt;td&gt;Runs controllers to monitor and maintain the desired cluster state.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;cloud-controller-manager&lt;/td&gt;
&lt;td&gt;Manages cloud-specific control loops like load balancers, volumes, and node management.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Node Components&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;kubelet&lt;/td&gt;
&lt;td&gt;Ensures that containers in pods are running as defined in their PodSpecs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;kube-proxy&lt;/td&gt;
&lt;td&gt;Maintains network rules for pod-to-pod and pod-to-service communication.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Container Runtime&lt;/td&gt;
&lt;td&gt;Executes and manages containers on the node (e.g., containerd, CRI-O).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Workload Object&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pod&lt;/td&gt;
&lt;td&gt;The smallest deployable unit that can run a container or set of containers in Kubernetes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Networking Object&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Service&lt;/td&gt;
&lt;td&gt;Exposes a stable network endpoint for accessing a group of pods.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cluster Resource&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cluster&lt;/td&gt;
&lt;td&gt;A set of nodes and control plane components that together run containerized workloads.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Real-World Example of Kubernetes Implementation
&lt;/h2&gt;

&lt;p&gt;Imagine you have a web app built with Node.js in a Docker container:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You define a Deployment that runs 3 replicas.&lt;/li&gt;
&lt;li&gt;Kubernetes ensures 3 instances are always running.&lt;/li&gt;
&lt;li&gt;If one crashes, it spins up a new one instantly.&lt;/li&gt;
&lt;li&gt;A Service ensures traffic is routed to available instances.&lt;/li&gt;
&lt;li&gt;Want to scale to 10 instances? Just change the replica count.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Demo of Deploying a Docker image in Kubernetes
&lt;/h2&gt;

&lt;p&gt;We will see the step by step approach to deploy an application Docker image in kubernetes using &lt;code&gt;minikube&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Create a Server in UpCloud
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;System Requirement for Minikube is 2 Core CPU, so we have created an UpCloud server with 2 Core CPU and 4 GB RAM in Singapore Region.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkjb2w26515bm627hhn9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkjb2w26515bm627hhn9.png" alt="UpCloud server details" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉 &lt;a href="https://signup.upcloud.com/?promo=cloudenginelabs" rel="noopener noreferrer"&gt;Start with UpCloud&lt;/a&gt; and deploy your next app with confidence.&lt;/p&gt;

&lt;p&gt;You can also get started with UpCloud by following the documentation &lt;a href="https://upcloud.com/docs/getting-started/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Logged into UpCloud server and proceeded the further steps&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Steps to Deploy Application in Kubernetes
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Step 1: Install Minikube and Dependencies
&lt;/h4&gt;
&lt;h5&gt;
  
  
  1.1 Install Docker (Required for Minikube)
&lt;/h5&gt;

&lt;p&gt;Please Follow Docker Installation Steps in official documentation to install Docker.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Docker&lt;/code&gt; &lt;a href="https://docs.docker.com/engine/install/" rel="noopener noreferrer"&gt;Official Documentation&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  1.2 Install Kubectl (Kubernetes CLI)
&lt;/h5&gt;

&lt;p&gt;Please Follow Installation Steps to install &lt;code&gt;Kubectl&lt;/code&gt; here - &lt;a href="https://kubernetes.io/docs/tasks/tools/" rel="noopener noreferrer"&gt;Official Installation Docs&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  1.3 Install Minikube
&lt;/h5&gt;

&lt;p&gt;Please Follow Installation Steps to install &lt;code&gt;Minikube&lt;/code&gt; here - &lt;a href="https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Farm64%2Fstable%2Fbinary+download" rel="noopener noreferrer"&gt;Installation Docs&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List of commands to install &lt;code&gt;Minikube&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/
minikube version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  Step 2: Start Minikube Cluster
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;minikube start --driver=docker 
# or
minikube start --driver=docker --force
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  Step 3: Deploy a Simple Application
&lt;/h4&gt;

&lt;h5&gt;
  
  
  3.1 Create a Deployment
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create deployment my-app --image=nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  3.2 Expose the Deployment
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose deployment my-app --type=NodePort --port=80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  3.3 Get Service Details
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc my-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  3.4 Access the Application
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;minikube service my-app --url
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  Step 4: Scale the Application
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl scale deployment my-app --replicas=3
kubectl get pods -o wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  Step 5: Clean Up Resources
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl delete svc my-app
kubectl delete deployment my-app
minikube stop
minikube delete
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  (Alternative Method) Using &lt;code&gt;deployment.yaml&lt;/code&gt; File
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;deployment.yaml&lt;/code&gt; file, which deploys a &lt;code&gt;nginx&lt;/code&gt; server and creates a service for access it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s a simple Kubernetes &lt;code&gt;deployment.yaml&lt;/code&gt; file that deploys an &lt;strong&gt;nginx&lt;/strong&gt; container and exposes it using a &lt;strong&gt;NodePort&lt;/strong&gt; service. &lt;/p&gt;

&lt;p&gt;We are deploying the yaml in &lt;code&gt;minikube&lt;/code&gt; cluster, to access the service via your browser using &lt;code&gt;minikube&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  📄 &lt;code&gt;nginx-deployment.yaml&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx-deployment&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
          &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:latest&lt;/span&gt;
          &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Service&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx-service&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NodePort&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
      &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
      &lt;span class="na"&gt;nodePort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🧪 Steps to Deploy and Access NGINX
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Apply the YAML file&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; nginx-deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check pod and service status&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods
kubectl get svc nginx-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Access NGINX in browser&lt;/strong&gt; (if using Minikube):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;minikube service nginx-service &lt;span class="nt"&gt;--url&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This will return a URL like: &lt;code&gt;http://192.168.49.2:30080&lt;/code&gt; — open this in your browser.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As part of this blog, you have learnt the following aspects,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is Docker and Kubernetes&lt;/li&gt;
&lt;li&gt;Basics understanding of various components of Kubernetes and it's advantages&lt;/li&gt;
&lt;li&gt;how to deploy Docker image using Kubernetes using &lt;code&gt;kubectl&lt;/code&gt; in-line command and Kubernetes yaml deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next blog - we will see how to scale the application and we will get into internals of application scaling in Kubernetes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Call to Action
&lt;/h2&gt;

&lt;p&gt;Ready to scale your Docker containers with ease? Dive deeper into Kubernetes, or start building your own K8s-powered apps today!&lt;/p&gt;

&lt;p&gt;Shout out to &lt;strong&gt;&lt;a href="https://upcloud.com" rel="noopener noreferrer"&gt;UpCloud&lt;/a&gt;&lt;/strong&gt; for their developer-friendly cloud platform.  &lt;/p&gt;

&lt;p&gt;If you're trying out Kubernetes or deploying applications for testing or learning — check out &lt;strong&gt;UpCloud Developer Plans&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Use the personalized promo code &lt;strong&gt;&lt;code&gt;cloudenginelabs&lt;/code&gt;&lt;/strong&gt; to get &lt;strong&gt;$50 in free credits&lt;/strong&gt; with an &lt;strong&gt;extended 30-day trial period&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://signup.upcloud.com/?promo=cloudenginelabs" rel="noopener noreferrer"&gt;Start with UpCloud&lt;/a&gt; and deploy your next app with confidence.&lt;/p&gt;

&lt;p&gt;You can also get started with UpCloud by following the documentation &lt;a href="https://upcloud.com/docs/getting-started/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
