<?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: MOHAMMED AMANKHAN</title>
    <description>The latest articles on DEV Community by MOHAMMED AMANKHAN (@amankhan).</description>
    <link>https://dev.to/amankhan</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4076797%2Fcb15cf9e-d451-4ca8-9595-4bc2f0c28ca0.png</url>
      <title>DEV Community: MOHAMMED AMANKHAN</title>
      <link>https://dev.to/amankhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amankhan"/>
    <language>en</language>
    <item>
      <title>End-to-End Containerised Deployment: AWS EC2 Docker Docker Hub Kubernetes</title>
      <dc:creator>MOHAMMED AMANKHAN</dc:creator>
      <pubDate>Thu, 13 Aug 2026 21:26:58 +0000</pubDate>
      <link>https://dev.to/amankhan/end-to-end-containerised-deployment-aws-ec2-docker-docker-hub-kubernetes-j90</link>
      <guid>https://dev.to/amankhan/end-to-end-containerised-deployment-aws-ec2-docker-docker-hub-kubernetes-j90</guid>
      <description>&lt;p&gt;🚀 My First End-to-End Containerised Deployment: AWS EC2 → Docker → Docker Hub → Kubernetes&lt;/p&gt;

&lt;p&gt;I recently completed a hands-on DevOps project where I8 deployed a simple web application through the complete container workflow — from writing the application to running it inside a Kubernetes Pod.&lt;/p&gt;

&lt;p&gt;This project helped me understand how Docker and Kubernetes fit together in a real deployment workflow.&lt;/p&gt;

&lt;p&gt;🛠️ What I Built&lt;/p&gt;

&lt;p&gt;The deployment flow looked like this:&lt;/p&gt;

&lt;p&gt;HTML Application → Dockerfile → Docker Image → Docker Hub → Kubernetes Pod → NodePort Service → Web Browser&lt;/p&gt;

&lt;p&gt;🔹 Technologies Used&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;☁️ AWS EC2&lt;/li&gt;
&lt;li&gt;🐳 Docker&lt;/li&gt;
&lt;li&gt;📦 Docker Hub&lt;/li&gt;
&lt;li&gt;☸️ Kubernetes&lt;/li&gt;
&lt;li&gt;🌐 Kubernetes NodePort&lt;/li&gt;
&lt;li&gt;💻 HTML&lt;/li&gt;
&lt;li&gt;🐧 Linux&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;1️⃣ Created a Simple Web Application&lt;/p&gt;

&lt;p&gt;I started with a basic "index.html" file containing the web application's content.&lt;/p&gt;

&lt;p&gt;The goal wasn't to build a complex application.&lt;/p&gt;

&lt;p&gt;Instead, I wanted to focus on understanding the deployment and containerisation process.&lt;/p&gt;




&lt;p&gt;2️⃣ Provisioned an AWS EC2 Instance&lt;/p&gt;

&lt;p&gt;I created an Amazon EC2 instance to provide the Linux environment for the project.&lt;/p&gt;

&lt;p&gt;After connecting to the instance through SSH, I prepared the environment required for Docker and Kubernetes.&lt;/p&gt;




&lt;p&gt;3️⃣ Created a Dockerfile&lt;/p&gt;

&lt;p&gt;Next, I created a "Dockerfile" to package the web application into a Docker image.&lt;/p&gt;

&lt;p&gt;A simple example:&lt;/p&gt;

&lt;p&gt;FROM nginx:latest&lt;/p&gt;

&lt;p&gt;COPY index.html /usr/share/nginx/html/index.html&lt;/p&gt;

&lt;p&gt;EXPOSE 80&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"FROM" specifies the base image.&lt;/li&gt;
&lt;li&gt;"COPY" places my HTML file inside the Nginx web server directory.&lt;/li&gt;
&lt;li&gt;"EXPOSE" documents the port used by the application.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;4️⃣ Built the Docker Image&lt;/p&gt;

&lt;p&gt;Once the Dockerfile was ready, I built the image using:&lt;/p&gt;

&lt;p&gt;docker build -t my-web-app .&lt;/p&gt;

&lt;p&gt;This converted the application and its required environment into a reusable Docker image.&lt;/p&gt;

&lt;p&gt;I could then verify the image using:&lt;/p&gt;

&lt;p&gt;docker images&lt;/p&gt;




&lt;p&gt;5️⃣ Tested the Container Locally&lt;/p&gt;

&lt;p&gt;Before moving to Kubernetes, I tested the Docker container:&lt;/p&gt;

&lt;p&gt;docker run -d -p 8080:80 my-web-app&lt;/p&gt;

&lt;p&gt;This mapped:&lt;/p&gt;

&lt;p&gt;EC2 Port 8080 → Container Port 80&lt;/p&gt;

&lt;p&gt;I then accessed the application through the EC2 instance's public IP and port.&lt;/p&gt;




&lt;p&gt;6️⃣ Pushed the Image to Docker Hub&lt;/p&gt;

&lt;p&gt;After confirming that the container worked correctly, I pushed the image to Docker Hub.&lt;/p&gt;

&lt;p&gt;First, I tagged the image:&lt;/p&gt;

&lt;p&gt;docker tag my-web-app /my-web-app:latest&lt;/p&gt;

&lt;p&gt;Then logged in:&lt;/p&gt;

&lt;p&gt;docker login&lt;/p&gt;

&lt;p&gt;And pushed the image:&lt;/p&gt;

&lt;p&gt;docker push /my-web-app:latest&lt;/p&gt;

&lt;p&gt;This gave me a central container image that Kubernetes could pull and deploy.&lt;/p&gt;




&lt;p&gt;7️⃣ Deployed the Application on Kubernetes&lt;/p&gt;

&lt;p&gt;Next, I created a Kubernetes Pod configuration.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;apiVersion: v1&lt;br&gt;
kind: Pod&lt;/p&gt;

&lt;p&gt;metadata:&lt;br&gt;
  name: my-web-app&lt;/p&gt;

&lt;p&gt;spec:&lt;br&gt;
  containers:&lt;br&gt;
    - name: my-web-app&lt;br&gt;
      image: /my-web-app:latest&lt;br&gt;
      ports:&lt;br&gt;
        - containerPort: 80&lt;/p&gt;

&lt;p&gt;I applied it using:&lt;/p&gt;

&lt;p&gt;kubectl apply -f pod.yaml&lt;/p&gt;

&lt;p&gt;Then checked the Pod:&lt;/p&gt;

&lt;p&gt;kubectl get pods&lt;/p&gt;




&lt;p&gt;8️⃣ Exposed the Pod Using a NodePort Service&lt;/p&gt;

&lt;p&gt;A Pod alone isn't the most convenient way to expose an application externally.&lt;/p&gt;

&lt;p&gt;So I created a Kubernetes Service using NodePort.&lt;/p&gt;

&lt;p&gt;apiVersion: v1&lt;br&gt;
kind: Service&lt;/p&gt;

&lt;p&gt;metadata:&lt;br&gt;
  name: my-web-app-service&lt;/p&gt;

&lt;p&gt;spec:&lt;br&gt;
  type: NodePort&lt;/p&gt;

&lt;p&gt;selector:&lt;br&gt;
    app: my-web-app&lt;/p&gt;

&lt;p&gt;ports:&lt;br&gt;
    - port: 80&lt;br&gt;
      targetPort: 80&lt;br&gt;
      nodePort: 30080&lt;/p&gt;

&lt;p&gt;I then applied it:&lt;/p&gt;

&lt;p&gt;kubectl apply -f service.yaml&lt;/p&gt;

&lt;p&gt;And verified it with:&lt;/p&gt;

&lt;p&gt;kubectl get services&lt;/p&gt;




&lt;p&gt;9️⃣ Accessed the Application&lt;/p&gt;

&lt;p&gt;Once the NodePort Service was running, I accessed the application through the EC2 instance's public IP and NodePort.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;http://:30080&lt;/p&gt;

&lt;p&gt;This allowed me to access the web application from my browser.&lt;/p&gt;




&lt;p&gt;🔄 Complete Deployment Flow&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Web Application
          │
          ▼
      index.html
          │
          ▼
      Dockerfile
          │
          ▼
   Docker Image
          │
          ▼
     Docker Hub
          │
          ▼
  Kubernetes Pod
          │
          ▼
 NodePort Service
          │
          ▼
      EC2 Network
          │
          ▼
     Web Browser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;🧠 What I Learned&lt;/p&gt;

&lt;p&gt;This project helped me understand several important DevOps concepts practically:&lt;/p&gt;

&lt;p&gt;🐳 Containerisation&lt;/p&gt;

&lt;p&gt;Instead of running the application directly on the server, Docker packages the application into a portable container image.&lt;/p&gt;

&lt;p&gt;📦 Container Registries&lt;/p&gt;

&lt;p&gt;Docker Hub provides a place to store and distribute container images.&lt;/p&gt;

&lt;p&gt;☸️ Kubernetes Pods&lt;/p&gt;

&lt;p&gt;A Pod provides the basic execution environment for containers in Kubernetes.&lt;/p&gt;

&lt;p&gt;🌐 Kubernetes Services&lt;/p&gt;

&lt;p&gt;Services provide a stable way to expose applications running inside Kubernetes.&lt;/p&gt;

&lt;p&gt;🔌 NodePort&lt;/p&gt;

&lt;p&gt;NodePort allows a service to be accessed through a port on the Kubernetes node.&lt;/p&gt;

&lt;p&gt;🔄 Container Lifecycle&lt;/p&gt;

&lt;p&gt;I also got a better understanding of the flow:&lt;/p&gt;

&lt;p&gt;Build → Package → Push → Pull → Deploy → Expose → Access&lt;/p&gt;




&lt;p&gt;🚧 What's Next?&lt;/p&gt;

&lt;p&gt;This is only the beginning of my Kubernetes learning journey.&lt;/p&gt;

&lt;p&gt;My next steps are to move from manually managing a Pod to using Kubernetes resources designed for real deployments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployments&lt;/li&gt;
&lt;li&gt;ReplicaSets&lt;/li&gt;
&lt;li&gt;Rolling Updates&lt;/li&gt;
&lt;li&gt;ConfigMaps&lt;/li&gt;
&lt;li&gt;Secrets&lt;/li&gt;
&lt;li&gt;Ingress&lt;/li&gt;
&lt;li&gt;Persistent Volumes&lt;/li&gt;
&lt;li&gt;Kubernetes Networking&lt;/li&gt;
&lt;li&gt;Horizontal Pod Autoscaling&lt;/li&gt;
&lt;li&gt;CI/CD with GitHub Actions&lt;/li&gt;
&lt;li&gt;AWS EKS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to gradually move from a simple single-container deployment towards a more production-oriented architecture.&lt;/p&gt;




&lt;p&gt;💡 Final Takeaway&lt;/p&gt;

&lt;p&gt;This may be a small project, but it gave me something more valuable than just theory — hands-on understanding of how an application moves from source code to a running container and finally into Kubernetes.&lt;/p&gt;

&lt;p&gt;I'm continuing to learn by building, breaking, troubleshooting, and rebuilding.&lt;/p&gt;

&lt;p&gt;One project at a time. 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  devops #docker #kubernetes #aws
&lt;/h1&gt;

</description>
      <category>docker</category>
      <category>aws</category>
      <category>devops</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
