<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rushi on Medium]]></title>
        <description><![CDATA[Stories by Rushi on Medium]]></description>
        <link>https://medium.com/@ruship7800?source=rss-8c8bbaf7458d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wOb5dxLvdpe4omAifLFAlg.jpeg</url>
            <title>Stories by Rushi on Medium</title>
            <link>https://medium.com/@ruship7800?source=rss-8c8bbaf7458d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:23:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ruship7800/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Podman Compose to Kubernetes: Building a Containerized ShopEase Order Management System]]></title>
            <link>https://medium.com/@ruship7800/from-podman-compose-to-kubernetes-building-a-containerized-shopease-order-management-system-fd0c747b2ecc?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd0c747b2ecc</guid>
            <category><![CDATA[podman]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[multi-container]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[podman-compose]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 08:35:52 GMT</pubDate>
            <atom:updated>2026-10-08T08:35:52.193Z</atom:updated>
            <content:encoded><![CDATA[<h3>A hands-on DevOps project using Podman, Flask, PostgreSQL, Nginx and Kubernetes-compatible workloads</h3><blockquote><strong><em>Build → Containerize → Orchestrate → Test → Migrate toward Kubernetes</em></strong></blockquote><h3>Introduction</h3><p>As I started going deeper into DevOps, I wanted to build something that went beyond simply running a Docker container.</p><p>I wanted to understand what actually happens when an application is divided into multiple services, containerized, connected through networking, exposed through a reverse proxy, tested, and then moved toward a Kubernetes-based deployment model.</p><p>For this project, I built <strong>ShopEase Orders</strong>, a small order-management application consisting of:</p><ul><li>🐍 Python / Flask REST API</li><li>🚀 Gunicorn</li><li>🐘 PostgreSQL</li><li>🌐 Nginx reverse proxy</li><li>📦 Podman</li><li>🔗 Podman Compose</li><li>☸️ Kubernetes-compatible YAML</li><li>🧩 Podman Kube</li></ul><p>The project allowed me to work through a complete hands-on workflow:</p><pre>Application<br>     ↓<br>Container Images<br>     ↓<br>Podman Compose<br>     ↓<br>Service Networking<br>     ↓<br>API Testing<br>     ↓<br>Troubleshooting<br>     ↓<br>Kubernetes-compatible Pod<br>     ↓<br>Generated Kubernetes YAML</pre><p>And most importantly, <strong>everything shown in this article was tested hands-on in my own environment.</strong></p><h3>1. Project Overview</h3><p>The application is structured into three main services:</p><pre>Client<br>                     │<br>                     ▼<br>             ┌───────────────┐<br>             │     Nginx     │<br>             │    Gateway    │<br>             │      :80      │<br>             └───────┬───────┘<br>                     │<br>                     ▼<br>             ┌───────────────┐<br>             │   Flask API   │<br>             │   Gunicorn    │<br>             │     :5000     │<br>             └───────┬───────┘<br>                     │<br>                     ▼<br>             ┌───────────────┐<br>             │  PostgreSQL   │<br>             │     :5432     │<br>             └───────────────┘</pre><p>The idea is simple:</p><p><strong>Nginx handles external requests → Flask handles application logic → PostgreSQL stores the data.</strong></p><p>This separation also makes the project a good example of a small multi-service architecture.</p><h3>2. Setting Up the Project</h3><p>I started by creating a dedicated project directory:</p><pre>shopease-orders/<br>├── app/<br>├── db/<br>├── nginx/<br>└── kube/</pre><p>Each directory has a specific responsibility.</p><pre>app/    → Flask REST API<br>db/     → PostgreSQL image and database initialization<br>nginx/  → Reverse proxy<br>kube/   → Kubernetes-compatible deployment</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oVJPoHMu34aotsYpvkslw.png" /><figcaption>Initial ShopEase Orders project structure created on the Linux environment.</figcaption></figure><h3>3. Building the PostgreSQL Database Image</h3><p>The first container I created was the PostgreSQL database.</p><p>The database image uses:</p><pre>FROM docker.io/library/postgres:16-alpine</pre><pre>LABEL app=&quot;shopease-order-db&quot; version=&quot;1.0&quot;</pre><pre>COPY init.sql /docker-entrypoint-initdb.d/01-init.sql</pre><pre>EXPOSE 5432</pre><p>The important part here is:</p><pre>/docker-entrypoint-initdb.d/</pre><p>PostgreSQL automatically executes SQL files placed in this directory when the database is initialized.</p><p>I used this to create the orders table and insert initial data.</p><h3>Database schema</h3><p>The table contains fields such as:</p><pre>id<br>customer<br>item<br>quantity<br>status<br>created_at</pre><p>I also seeded the database with sample orders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KKkMiHqfcJBKlaSrijaMEw.png" /><figcaption>PostgreSQL Containerfile and initialization SQL used to create the ShopEase orders database and seed initial data.</figcaption></figure><h3>4. Building the Flask REST API</h3><p>Next, I created the application layer using Flask.</p><p>The application connects to PostgreSQL using psycopg2.</p><p>Rather than hardcoding the database configuration, the application reads its configuration from environment variables:</p><pre>DB_CONFIG = {    &quot;host&quot;: os.getenv(&quot;DB_HOST&quot;, &quot;127.0.0.1&quot;),    &quot;port&quot;: int(os.getenv(&quot;DB_PORT&quot;, &quot;5432&quot;)),    &quot;dbname&quot;: os.getenv(&quot;DB_NAME&quot;, &quot;orders&quot;),    &quot;user&quot;: os.getenv(&quot;DB_USER&quot;, &quot;shopease&quot;),    &quot;password&quot;: os.getenv(&quot;DB_PASSWORD&quot;, &quot;shopease123&quot;),}</pre><p>This makes the application easier to configure across different environments.</p><h3>API Endpoints</h3><p>I implemented endpoints including:</p><pre>GET   /api/health<br>GET   /api/orders<br>GET   /api/orders/&lt;id&gt;<br>POST  /api/orders<br>PATCH /api/orders/&lt;id&gt;</pre><p>The health endpoint also verifies database connectivity.</p><pre>@app.get(&quot;/api/health&quot;)def health():    ...</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTYT8WdccXSOWDf1d0beRQ.png" /><figcaption>Flask application source showing PostgreSQL configuration and the health endpoint.</figcaption></figure><h3>5. Containerizing the Flask API</h3><p>The Flask API uses Python 3.12 Slim:</p><pre>FROM docker.io/library/python:3.12-slim</pre><p>I intentionally copied requirements.txt before the application code:</p><pre>COPY requirements.txt .</pre><pre>RUN pip install --no-cache-dir -r requirements.txt</pre><pre>COPY app.py .</pre><p>This allows the dependency layer to be reused when the application source changes.</p><p>The dependencies were:</p><pre>flask==3.0.3<br>gunicorn==22.0.0<br>psycopg2-binary==2.9.</pre><h3>6. Running the Application as a Non-Root User</h3><p>One of the security practices I included was running the application as a non-root user.</p><pre>RUN useradd --uid 1001 --no-create-home appuser</pre><pre>USER 1001</pre><p>The application also uses Gunicorn rather than Flask’s development server:</p><pre>CMD [&quot;gunicorn&quot;, &quot;--bind&quot;, &quot;0.0.0.0:5000&quot;, &quot;--workers&quot;, &quot;2&quot;, &quot;app:app&quot;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_TrRqyIqSIz8wSOCKN131g.png" /><figcaption>Flask API Containerfile showing dependency installation, non-root user configuration and Gunicorn as the production WSGI server.</figcaption></figure><h3>7. Building the API Image</h3><p>I built the API image using Podman:</p><pre>podman build --network=host \<br>  -t localhost/shopease-order-api:1.0 \<br>  ./app</pre><p>Podman pulled the Python base image and installed Flask, Gunicorn and psycopg2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02WG54izYIvrExeLdVDINw.png" /><figcaption>Building the ShopEase Flask API container image with Podman.</figcaption></figure><h3>8. Creating the Nginx Reverse Proxy</h3><p>The next component was Nginx.</p><p>I used Nginx as the external gateway for the application.</p><p>The Nginx configuration dynamically receives the API host:</p><pre>upstream order_api {<br>    server ${API_HOST}:5000;<br>}</pre><p>Requests to:</p><pre>/api/</pre><p>are forwarded to the Flask API.</p><p>The gateway also forwards useful headers:</p><pre>proxy_set_header Host $host;<br>proxy_set_header X-Real-IP $remote_addr;<br>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UjfT9gKrWASkJtRvUX76yg.png" /><figcaption><strong><em>Nginx reverse-proxy configuration used to route API requests to the Flask service.</em></strong></figcaption></figure><p>One thing I deliberately designed was the use of API_HOST.</p><p>In Compose:</p><pre>API_HOST=api</pre><p>While in the Pod-based deployment:</p><pre>API_HOST=127.0.0.1</pre><p>This becomes important later when moving from Compose networking to shared Pod networking.</p><h3>9. Building the Nginx Image</h3><p>I built the gateway image with:</p><pre>podman build \<br>  -t localhost/shopease-gateway:1.0 \<br>  ./nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjKVesgEjYQJAqTUU0eZng.png" /><figcaption><strong><em>Building the Nginx gateway image using the official Nginx Alpine image.</em></strong></figcaption></figure><h3>10. Verifying the Container Images</h3><p>After building the components, I checked the available ShopEase images:</p><pre>podman images | grep shopease</pre><p>The environment contained:</p><pre>localhost/shopease-gateway<br>localhost/shopease-order-api<br>localhost/shopease-order-db</pre><p>I also verified the configured user for the API image:</p><pre>podman image inspect \<br>localhost/shopease-order-api:1.0 \<br>--format &#39;{{.Config.User}}&#39;</pre><p>The result was:</p><pre>1001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCvYqUytLSO54SBJAgI68Q.png" /><figcaption><strong><em>Verifying the three ShopEase container images and confirming that the API image runs as UID 1001 instead of root.</em></strong></figcaption></figure><h3>11. Defining the Podman Compose Stack</h3><p>With the individual images ready, I created a Compose configuration.</p><p>The three services are:</p><pre>services:<br>  db:<br>  api:<br>  gateway</pre><p>The API connects to:</p><pre>DB_HOST=db</pre><p>and Nginx connects to:</p><pre>API_HOST=api</pre><p>This works because Podman Compose provides service-name-based networking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6i82khcquoR8b1KIO88Ycw.png" /><figcaption><strong><em>Podman Compose configuration defining the PostgreSQL database, Flask API and Nginx gateway services.</em></strong></figcaption></figure><p>The important networking relationship is:</p><pre>gateway → api → db</pre><h3>12. Starting the Complete Application</h3><p>I then built and started the complete stack:</p><pre>podman-compose up -d --build</pre><p>This built the services and started them together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-3CCrPEzRrhm09yB_PMfzQ.png" /><figcaption><strong><em>Building the ShopEase services through Podman Compose.</em></strong></figcaption></figure><p>The Compose deployment brings together the three independently built container images.</p><h3>13. Verifying Running Containers</h3><p>Once the deployment finished, I checked the services:</p><pre>podman-compose ps</pre><p>The output showed:</p><pre>shopease-db<br>shopease-api<br>shopease-gateway</pre><p>The gateway was exposed as:</p><pre>0.0.0.0:8080 → 80/tcp</pre><p>I also checked the API logs:</p><pre>podman-compose logs api</pre><p>Gunicorn reported:</p><pre>Starting gunicorn 22.0.0<br>Listening at: http://0.0.0.0:5000<br>Using worker: sync<br>Booting worker with pid: 2<br>Booting worker with pid: 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*008CtEiLSGPUqB-N1yulJA.png" /><figcaption><strong><em>Verifying all three ShopEase containers are running and checking Gunicorn API logs.</em></strong></figcaption></figure><h3>14. Testing the Application</h3><p>Getting containers into an Up state is not enough.</p><p>The next step was to test the actual application.</p><p>I started with the health endpoint:</p><pre>curl http://localhost:8080/api/health</pre><p>The response was:</p><pre>{<br>    &quot;database&quot;: &quot;connected&quot;,<br>    &quot;status&quot;: &quot;ok&quot;<br>}</pre><p>This was important because the endpoint doesn’t just check whether Flask is alive.</p><p>It also verifies that Flask can communicate with PostgreSQL.</p><h3>15. Retrieving Orders</h3><p>I then tested:</p><pre>curl http://localhost:8080/api/orders/</pre><p>The API returned:</p><pre>{<br>    &quot;customer&quot;: &quot;Asha Rao&quot;,<br>    &quot;id&quot;: 1,<br>    &quot;item&quot;: &quot;Wireless Mouse&quot;,<br>    &quot;quantity&quot;: 2,<br>    &quot;status&quot;: &quot;SHIPPED&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOQRUP925x8WAqcvzRIPOg.png" /><figcaption><strong><em>Testing the health endpoint and retrieving an existing order through the Nginx gateway.</em></strong></figcaption></figure><h3>16. Creating and Updating an Order</h3><p>Next, I tested creating a new order:</p><pre>curl -X POST http://localhost:8080/api/orders \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;customer&quot;:&quot;Rahul Mehta&quot;,&quot;item&quot;:&quot;Laptop Stand&quot;,&quot;quantity&quot;:1}&#39;</pre><p>The API returned:</p><pre>{<br>    &quot;customer&quot;: &quot;Rahul Mehta&quot;,<br>    &quot;id&quot;: 4,<br>    &quot;item&quot;: &quot;Laptop Stand&quot;,<br>    &quot;quantity&quot;: 1,<br>    &quot;status&quot;: &quot;PLACED&quot;<br>}</pre><p>I then updated the order:</p><pre>curl -X PATCH http://localhost:8080/api/orders/4 \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;status&quot;:&quot;SHIPPED&quot;}&#39;</pre><p>The status changed to:</p><pre>SHIPPED</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lElO2FVAHjj4fNXL7zXWNg.png" /><figcaption><strong><em>Creating an order, updating its status and verifying the Nginx host-port mapping.</em></strong></figcaption></figure><p>The same screenshot also shows:</p><pre>podman port shopease-gateway</pre><p>with:</p><pre>80/tcp → 0.0.0.0:8080</pre><p>This demonstrates that the external request entered through the Nginx gateway.</p><h3>17. Verifying the Database Directly</h3><p>I also verified the data directly inside PostgreSQL:</p><pre>podman exec -it shopease-orders-db \<br>psql -U shopease -d orders \<br>-c &quot;SELECT * FROM orders;</pre><p>The database showed the seeded orders and the newly created order.</p><p>This gave me two independent verification paths:</p><pre>API<br> │<br> ▼<br>Application behavior</pre><pre>and</pre><pre>PostgreSQL<br> │<br> ▼<br>Stored dat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sxqeLMvmyd5tKs-r2rFpJw.png" /><figcaption><strong><em>Verifying API responses, Gunicorn logs and the PostgreSQL records directly from inside the database container.</em></strong></figcaption></figure><h3>18. Cleaning Up the Compose Environment</h3><p>After completing the Compose testing, I removed the environment:</p><pre>podman-compose down</pre><p>The containers and Compose network were removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mu3mqZMy5zbBJpXAM9H9ZA.png" /><figcaption><strong><em>Tearing down the Podman Compose environment after completing the application tests.</em></strong></figcaption></figure><h3>19. Moving Toward Kubernetes</h3><p>After validating the application with Podman Compose, I wanted to take the next step and understand how the same workload could be represented using Kubernetes concepts.</p><p>I created:</p><pre>kube/order-pod.yaml</pre><p>The manifest defines a Pod named:</p><pre>shopease-orders</pre><p>with three application containers:</p><pre>┌──────────────────────────────┐<br>│       shopease-orders        │<br>│                              │<br>│  ┌──────────┐                │<br>│  │PostgreSQL│                │<br>│  └──────────┘                │<br>│                              │<br>│  ┌──────────┐                │<br>│  │ Flask API│                │<br>│  └──────────┘                │<br>│                              │<br>│  ┌──────────┐                │<br>│  │  Nginx   │                │<br>│  └──────────┘                │<br>│                              │<br>└──────────────────────────────┘</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCN_twFcH1-IaUDdCZXyyQ.png" /><figcaption><strong><em>Kubernetes-compatible Pod manifest defining PostgreSQL, Flask API and Nginx containers.</em></strong></figcaption></figure><h3>20. An Important Networking Difference</h3><p>This was one of the most interesting parts of the project.</p><p>With Podman Compose, the API connects to the database using the Compose service name:</p><pre>DB_HOST=db</pre><p>and Nginx connects to:</p><pre>API_HOST=api</pre><p>Inside a Kubernetes Pod, containers share the same network namespace.</p><p>Therefore, I configured the Pod-based deployment to use:</p><pre>127.0.0.1</pre><p>For example:</p><pre>- name: DB_HOST<br>  value: 127.0.0.1</pre><p>and:</p><pre>- name: API_HOST<br>  value: 127.0.0.1</pre><p>So the two models look like this:</p><h3>Compose</h3><pre>Nginx<br>  │<br>  │ api<br>  ▼<br>Flask<br>  │<br>  │ db<br>  ▼<br>PostgreSQL</pre><h3>Same Pod</h3><pre>Nginx<br>  │<br>  │ 127.0.0.1<br>  ▼<br>Flask<br>  │<br>  │ 127.0.0.1<br>  ▼<br>PostgreSQL</pre><p>This was a valuable practical lesson about the difference between <strong>service-based container networking</strong> and <strong>shared Pod networking</strong>.</p><h3>21. Deploying the Pod with Podman Kube</h3><p>I then deployed the Kubernetes-compatible manifest using:</p><pre>podman kube play kube/order-pod.yaml</pre><p>Podman created the Pod and its containers.</p><p>I checked the Pod:</p><pre>podman pod ps</pre><p>The output showed:</p><pre>NAME              STATUS<br>shopease-orders   Running</pre><p>I then inspected the containers belonging to the Pod:</p><pre>podman ps --pod --filter pod=shopease-orders</pre><p>The result showed:</p><pre>shopease-orders<br>├── shopease-orders-db<br>├── shopease-orders-api<br>└── shopease-orders-gateway</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLro7QTb2x7t9x0Fa6di9Q.png" /><figcaption><strong><em>Creating the ShopEase Orders Pod with </em></strong><strong><em>podman kube play and verifying PostgreSQL, Flask API and Nginx containers running inside the same Pod.</em></strong></figcaption></figure><h3>22. Generating Kubernetes YAML</h3><p>I also explored the reverse process: generating Kubernetes YAML from the running Pod.</p><p>I used:</p><pre>podman kube generate shopease-orders -s -f generated-pod.yaml</pre><p>The generated configuration included Kubernetes resources such as a Service and Pod.</p><p>The generated Service used:</p><pre>type: NodePort</pre><p>with:</p><pre>nodePort: 30872</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngkE7QeAuebyZQEAz9cORg.png" /><figcaption><strong><em>Generating Kubernetes-compatible YAML from the running ShopEase Pod using </em></strong><strong><em>podman kube generate</em></strong></figcaption></figure><h3>23. Comparing the Original and Generated Manifests</h3><p>I then compared my manually created manifest with the generated YAML:</p><pre>diff kube/order-pod.yaml generated-pod.yaml</pre><p>The differences showed that the generated configuration introduced additional Kubernetes resources and metadata, including a Service and NodePort configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrsM08qj5qxa1HrOsDjB1Q.png" /><figcaption><strong><em>Comparing the manually created Kubernetes Pod manifest with the YAML generated from the running Podman workload.</em></strong></figcaption></figure><h3>24. Persistent Storage and Pod Configuration</h3><p>The generated configuration also included a PostgreSQL volume and persistent volume claim configuration.</p><p>The Pod configuration contained:</p><pre>/var/lib/postgresql/data</pre><p>mounted into PostgreSQL storage.</p><p>It also retained:</p><pre>DB_HOST=127.0.0.1<br>DB_USER=shopease<br>DB_NAME=orders</pre><p>and the API container retained:</p><pre>runAsNonRoot: true</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qnKNhXFm-MTvInUWDOfXg.png" /><figcaption><strong><em>Inspecting the generated Pod configuration, shared localhost networking, non-root API security context and PostgreSQL persistent storage configuration.</em></strong></figcaption></figure><h3>25. Cleaning Up the Kubernetes-style Deployment</h3><p>After completing the Podman Kube experiment, I cleaned up the Pod using:</p><pre>podman kube down kube/order-pod.yaml</pre><p>The command stopped and removed the Pod along with the associated resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qnKNhXFm-MTvInUWDOfXg.png" /><figcaption><strong><em>Removing the Kubernetes-compatible ShopEase workload using </em></strong><strong><em>podman kube down.</em></strong></figcaption></figure><h3>26. What This Project Taught Me</h3><p>This project was valuable because I wasn’t just learning individual commands. I was connecting several DevOps concepts together.</p><h3>Containerization</h3><p>I learned how to create separate images for:</p><ul><li>PostgreSQL</li><li>Flask API</li><li>Nginx</li></ul><h3>Multi-container orchestration</h3><p>Podman Compose allowed me to run the three services as one application stack.</p><h3>Reverse proxying</h3><p>Nginx provided a single entry point while keeping the API and database internal.</p><h3>Container security</h3><p>The Flask API runs as UID 1001 instead of root.</p><h3>Application configuration</h3><p>Environment variables allowed the same application to work with different networking configurations.</p><h3>API testing</h3><p>I tested:</p><pre>Health<br>GET<br>POST<br>PATCH</pre><p>instead of only checking whether the container was running.</p><h3>Troubleshooting</h3><p>I practiced using:</p><pre>podman ps<br>podman-compose ps<br>podman-compose logs<br>podman logs<br>podman port<br>podman exec<br>podman pod ps</pre><h3>Kubernetes concepts</h3><p>The Podman Kube workflow helped me understand:</p><ul><li>Pods</li><li>Containers inside Pods</li><li>Shared networking</li><li>Services</li><li>NodePorts</li><li>Persistent storage</li><li>Kubernetes YAML</li></ul><h3>27. What I Would Improve Next</h3><p>This project currently demonstrates a strong local DevOps workflow, but there is still a lot I want to add.</p><p>My next iteration would introduce:</p><h3>Kubernetes</h3><ul><li>Deployments</li><li>StatefulSets</li><li>Services</li><li>ConfigMaps</li><li>Secrets</li><li>PersistentVolumes</li><li>PersistentVolumeClaims</li><li>Readiness probes</li><li>Liveness probes</li><li>Resource requests and limits</li><li>Horizontal Pod Autoscaler</li><li>Ingress</li></ul><h3>CI/CD</h3><p>I would integrate:</p><pre>GitHub<br>   ↓<br>CI Pipeline<br>   ↓<br>Build Image<br>   ↓<br>Test<br>   ↓<br>Security Scan<br>   ↓<br>Container Registry<br>   ↓<br>Kubernetes Deployment</pre><h3>Monitoring</h3><p>I also want to add:</p><pre>Prometheus<br>     ↓<br>Metrics<br>     ↓<br>Grafana<br>     ↓<br>Dashboards</pre><h3>Cloud Deployment</h3><p>Eventually, I would like to deploy the application to AWS using services such as:</p><pre>AWS<br>├── VPC<br>├── ECR<br>├── EKS / EC2<br>├── Load Balancer<br>└── RDS PostgreSQL</pre><h3>28. Final Thoughts</h3><p>The biggest lesson from this project was that <strong>DevOps is not about learning tools individually — it’s about understanding how those tools work together.</strong></p><p>With ShopEase Orders, I went through the complete process:</p><pre>Flask Application<br>                    │<br>                    ▼<br>             Container Images<br>                    │<br>                    ▼<br>              Podman Compose<br>                    │<br>                    ▼<br>        ┌───────────┴───────────┐<br>        │                       │<br>      Nginx                   API<br>                                │<br>                                ▼<br>                           PostgreSQL<br>                                │<br>                                ▼<br>                         API Verification<br>                                │<br>                                ▼<br>                      Kubernetes Manifest<br>                                │<br>                                ▼<br>                         Podman Kube<br>                                │<br>                                ▼<br>                       Kubernetes YAML</pre><p>What started as a simple order-management application became a practical exercise in <strong>containerization, networking, security, reverse proxies, API testing, troubleshooting and Kubernetes concepts</strong>.</p><p>This project gave me a much better understanding of what happens behind a containerized application and how a local multi-container environment can evolve toward a Kubernetes-based deployment.</p><p>And this is only the beginning.</p><p><strong>The next step is to take ShopEase Orders from a local containerized application to a fully automated Kubernetes deployment with CI/CD, monitoring, secrets management, persistent storage and cloud infrastructure.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd0c747b2ecc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Kubernetes Boutique Shop from Scratch: Init Containers, Redis, Persistent Storage &…]]></title>
            <link>https://medium.com/@ruship7800/building-a-kubernetes-boutique-shop-from-scratch-init-containers-redis-persistent-storage-d057b57a3e9d?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d057b57a3e9d</guid>
            <category><![CDATA[persistent-volume]]></category>
            <category><![CDATA[probe]]></category>
            <category><![CDATA[configmap]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[pvc]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 13:00:18 GMT</pubDate>
            <atom:updated>2026-09-24T13:00:18.147Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Kubernetes Boutique Shop from Scratch: Init Containers, Redis, Persistent Storage &amp; Health Probes</h3><p>A hands-on Kubernetes lab covering application dependencies, persistent storage, failure testing, and Pod health</p><p>Kubernetes becomes much easier to understand when you stop treating it as a collection of YAML files and start using it to solve real application problems.</p><p>Recently, I built a small <strong>Kubernetes-based boutique shopping application from scratch</strong> using Minikube. The goal wasn’t simply to deploy an application — it was to understand how Kubernetes handles:</p><ul><li>Application dependencies</li><li>Init containers</li><li>Redis</li><li>Persistent Volumes and Persistent Volume Claims</li><li>ConfigMaps</li><li>Liveness and readiness probes</li><li>Node-level persistent storage</li><li>Application failure scenarios</li><li>Kubernetes Services</li><li>Multi-node Minikube</li></ul><p>The project was built as part of a hands-on Kubernetes lab with specific validation checkpoints.</p><h3>Project Architecture</h3><p>The application consists of two main workloads:</p><pre>Kubernetes Cluster<br>                    ┌─────────────────┐<br>                    │    kucl-shop    │<br>                    │    Namespace    │<br>                    └────────┬────────┘<br>                             │<br>              ┌──────────────┴──────────────┐<br>              │                             │<br>              ▼                             ▼<br>       ┌──────────────┐             ┌──────────────┐<br>       │ Boutique App │             │    Redis     │<br>       │   PHP/HTTP   │────────────►│    :6379     │<br>       └──────┬───────┘             └──────────────┘<br>              │<br>              │<br>      ┌───────┴────────┐<br>      │                │<br>      ▼                ▼<br>  ConfigMap          PVC<br>      │                │<br>      │                ▼<br>      │          PersistentVolume<br>      │                │<br>      │                ▼<br>      │        Node hostPath<br>      │<br>      ▼<br>  Application<br>    code</pre><p>The application Pod uses <strong>two init containers</strong> before the main PHP application starts:</p><pre>Pod<br>│<br>├── init: wait-for-redis<br>│       └── Waits until Redis is reachable<br>│<br>├── init: seed-product-data<br>│       └── Creates products.json on shared storage<br>│<br>└── server<br>        └── Runs the PHP application</pre><p>This was one of the most important concepts in the project.</p><h3>1. Creating the Kubernetes Namespace</h3><p>I started by creating a dedicated namespace:</p><pre>apiVersion: v1<br>kind: Namespace<br>metadata:<br>  name: kucl-shop<br>  labels:<br>    kucl-lab: &quot;boutique-shop-from-scratch&quot;</pre><p>This keeps all application resources isolated from the default namespace.</p><p>I then configured kubectl to use the namespace by default:</p><pre>kubectl config set-context --current --namespace=kucl-shop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0E66jS3U2sODIyrD26Xwg.png" /><figcaption>Namespace and initial resources</figcaption></figure><p>This screenshot shows the namespace creation, storage resources, and initial Redis deployment.</p><h3>2. Persistent Storage with PV and PVC</h3><p>The next step was creating persistent storage.</p><p>I created a <strong>PersistentVolume</strong> using hostPath:</p><pre>apiVersion: v1<br>kind: PersistentVolume<br>metadata:<br>  name: kucl-shop-pv<br>spec:<br>  capacity:<br>    storage: 200Mi</pre><pre>  accessModes:<br>    - ReadWriteOnce</pre><pre>  persistentVolumeReclaimPolicy: Retain</pre><pre>  storageClassName: kucl-hostpath</pre><pre>  hostPath:<br>    path: /mnt/data/kucl-shop-data<br>    type: DirectoryOrCreate</pre><p>Then I created a PersistentVolumeClaim:</p><pre>apiVersion: v1<br>kind: PersistentVolumeClaim<br>metadata:<br>  name: kucl-shop-pvc<br>  namespace: kucl-shop<br>spec:<br>  accessModes:<br>    - ReadWriteOnce</pre><pre>  storageClassName: kucl-hostpath</pre><pre>  resources:<br>    requests:<br>      storage: 200Mi</pre><pre>  volumeName: kucl-shop-pv</pre><p>After applying the configuration:</p><pre>kubectl get pv,pvc</pre><p>the PVC successfully became:</p><pre>Bound</pre><p>This confirmed that Kubernetes successfully connected the PVC to the PV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0E66jS3U2sODIyrD26Xwg.png" /><figcaption>PV/PVC successfully bound</figcaption></figure><p>The important part to highlight is:</p><pre>kucl-shop-pv    Bound<br>kucl-shop-pvc   Bound</pre><h3>3. Deploying Redis</h3><p>The boutique application needs Redis for cart/session information.</p><p>I deployed Redis using a Kubernetes Deployment and exposed it through a ClusterIP Service.</p><p>The Redis container listens on:</p><pre>6379</pre><p>The Deployment also includes health checks.</p><h3>Redis readiness probe</h3><pre>readinessProbe:<br>  tcpSocket:<br>    port: 6379<br>  initialDelaySeconds: 2<br>  periodSeconds: 5</pre><h3>Redis liveness probe</h3><pre>livenessProbe:<br>  tcpSocket:<br>    port: 6379<br>  initialDelaySeconds: 5<br>  periodSeconds: 10</pre><p>The important difference is that Kubernetes uses these probes to determine whether Redis is ready to receive traffic and whether the Redis process is still alive.</p><p>After deployment:</p><pre>kubectl get pods</pre><p>showed:</p><pre>redis-596b4d9cd4-9zm48   1/1   Running</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0E66jS3U2sODIyrD26Xwg.png" /><figcaption>Redis running</figcaption></figure><h3>4. Using ConfigMaps for Application Code and Seed Data</h3><p>Instead of building a custom PHP image for this lab, I used Kubernetes ConfigMaps to provide the application files and seed data.</p><p>I created two ConfigMaps:</p><pre>boutique-app-code<br>boutique-seed-data</pre><p>Checking them:</p><pre>kubectl get configmap</pre><p>produced:</p><pre>NAME                  DATA<br>boutique-app-code     6<br>boutique-seed-data    1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aj3RwwXe45oldaoB5x0OUg.png" /><figcaption>ConfigMaps</figcaption></figure><p>This demonstrates how Kubernetes can inject configuration/application data into containers.</p><h3>5. The Boutique Application Pod</h3><p>The main application is deployed using:</p><pre>kind: Deployment<br>metadata:<br>  name: boutique-app</pre><p>The Pod contains:</p><pre>wait-for-redis<br>seed-product-data<br>server</pre><p>The first two are <strong>init containers</strong>.</p><p>This distinction was an important part of the lab.</p><h3>6. Init Container #1 — Waiting for Redis</h3><p>The first init container is:</p><pre>- name: wait-for-redis<br>  image: busybox:1.36</pre><p>Its purpose is to wait until Redis becomes reachable.</p><p>The command essentially performs:</p><pre>until nc -z redis 6379; do<br>    sleep 3<br>done</pre><p>This implements the <strong>wait-for-dependency pattern</strong>.</p><p>In simple terms:</p><blockquote><em>Don’t start the application until its required dependency is available.</em></blockquote><p>The logs confirmed this:</p><pre>Checking redis:6379...<br>redis is reachable.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*whn9Hl4MUirCQnvqcaKidQ.png" /><figcaption>Redis dependency check</figcaption></figure><h3>7. Init Container #2 — Seeding Product Data</h3><p>The second init container is:</p><pre>- name: seed-product-data<br>  image: busybox:1.36</pre><p>Its purpose is completely different.</p><p>Instead of waiting for another service, it initializes application data.</p><p>It checks whether:</p><pre>/shared-data/products.json</pre><p>already exists.</p><p>If it doesn’t, it creates the product catalog.</p><p>The logs showed:</p><pre>Seeding product catalog into shared (NFS-style) storage...<br>Seed complete: 698 bytes written.</pre><p>This is the <strong>seed-data pattern</strong>.</p><p>So the two init containers have clearly different responsibilities:</p><p>Init ContainerPatternResponsibilitywait-for-redisWait-for-dependencyWait until Redis is reachableseed-product-dataData initializationCreate products.json</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*whn9Hl4MUirCQnvqcaKidQ.png" /><figcaption>Seed container logs and product data</figcaption></figure><h3>8. Verifying the Seeded Product Catalog</h3><p>After the init containers completed, I checked the actual file from inside the application container:</p><pre>kubectl exec deploy/boutique-app -- \<br>cat /var/www/html/data/products.json</pre><p>The application contained products such as:</p><pre>Classic Denim Jacket<br>Canvas Tote Bag<br>Leather Sneakers<br>Wool Scarf<br>Aviator Sunglasses<br>Chrono Wristwatch</pre><p>The JSON also contained prices, emojis, and descriptions.</p><p>This verified that the seed container successfully populated the shared storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*whn9Hl4MUirCQnvqcaKidQ.png" /><figcaption>products.json inside the Pod</figcaption></figure><h3>9. Liveness vs Readiness Probes</h3><p>One of the most important Kubernetes concepts demonstrated in this project was the difference between <strong>liveness</strong> and <strong>readiness</strong>.</p><p>The application exposes two separate endpoints:</p><pre>/health-live.php<br>/health-ready.php</pre><p>The Deployment configuration uses:</p><h3>Liveness</h3><pre>livenessProbe:<br>  httpGet:<br>    path: /health-live.php<br>    port: 80</pre><h3>Readiness</h3><pre>readinessProbe:<br>  httpGet:<br>    path: /health-ready.php<br>    port: 80</pre><p>But why use two different endpoints?</p><p>Because <strong>being alive isn’t the same as being ready to serve traffic.</strong></p><h3>Liveness endpoint</h3><p>The liveness endpoint answers:</p><blockquote><em>Is the application process alive?</em></blockquote><p>It doesn’t need to depend on every external dependency.</p><p>If Redis temporarily becomes unavailable, the PHP process itself may still be perfectly healthy.</p><p>Therefore, the application can remain <strong>alive</strong> even while Redis is unavailable.</p><h3>Readiness endpoint</h3><p>The readiness endpoint answers:</p><blockquote><em>Can this application currently serve requests correctly?</em></blockquote><p>For this application, readiness checks:</p><pre>Redis → OK<br>Product data → OK</pre><p>The successful response was:</p><pre>{<br>  &quot;status&quot;: &quot;ready&quot;,<br>  &quot;checks&quot;: {<br>    &quot;redis&quot;: &quot;ok&quot;,<br>    &quot;product_data&quot;: &quot;ok&quot;<br>  }<br>}</pre><p>This is exactly why the two endpoints should not perform the same checks.</p><p>If the liveness probe depended on Redis, a temporary Redis outage could cause Kubernetes to restart a perfectly healthy application container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gc9-bs3_IMGRRO0IgBdOqA.png" /><figcaption>Probe configuration</figcaption></figure><h3>10. Testing the Health Endpoints</h3><p>I tested the readiness endpoint directly:</p><pre>curl -s http://192.168.49.2:30080/health-ready.php</pre><p>The application returned:</p><pre>{<br>  &quot;status&quot;: &quot;ready&quot;,<br>  &quot;checks&quot;: {<br>    &quot;redis&quot;: &quot;ok&quot;,<br>    &quot;product_data&quot;: &quot;ok&quot;<br>  }<br>}</pre><p>I also tested the liveness endpoint:</p><pre>curl -s http://192.168.49.2:30080/health-live.php</pre><p>which returned:</p><pre>{<br>  &quot;status&quot;: &quot;alive&quot;<br>}</pre><p>The response also included the Pod name and timestamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tO2YYJ2cY4K4XipijrmQA.png" /><figcaption>Successful health checks</figcaption></figure><p>This confirmed that the application was reachable through the NodePort service and that both health endpoints behaved as expected.</p><h3>11. Kubernetes Multi-Node Setup</h3><p>Another interesting part of the project was running Minikube with more than one node.</p><p>I verified the cluster using:</p><pre>kubectl get nodes -o wide</pre><p>The cluster contained:</p><pre>minikube<br>minikube-m02</pre><p>Both nodes were:</p><pre>Ready</pre><p>The nodes were running Kubernetes v1.37.0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tO2YYJ2cY4K4XipijrmQA.png" /><figcaption>Multi-node Kubernetes cluster</figcaption></figure><p>This was useful for understanding that Kubernetes doesn’t have to run workloads on a single node.</p><h3>12. Redis Outage Test — What Happens When Redis Goes Down?</h3><p>One of the lab requirements was to test what happens when Redis becomes unavailable.</p><p>I scaled Redis down:</p><pre>kubectl scale deployment/redis --replicas=0</pre><p>Redis was no longer running.</p><p>I then tested the application endpoints.</p><p>Requests to the application failed because the NodePort no longer had a healthy backend.</p><p>This demonstrated an important Kubernetes concept:</p><blockquote><em>Readiness affects whether a Pod receives traffic; liveness determines whether Kubernetes should restart the container.</em></blockquote><h3>13. Why the Pod Restart Count Stays at 0</h3><p>The assessment specifically required predicting the restart count during the Redis outage.</p><p>The application Pod remained:</p><pre>Running</pre><p>but:</p><pre>READY 0/1</pre><p>and the restart count remained:</p><pre>0</pre><p>This behavior is intentional.</p><p>The Redis failure affects <strong>readiness</strong>, not the application’s liveness.</p><p>Therefore:</p><pre>Redis unavailable<br>       ↓<br>Readiness fails<br>       ↓<br>Pod removed from Service endpoints<br>       ↓<br>Application container is NOT restarted<br>       ↓<br>RESTARTS remains 0</pre><p>This is one of the most useful lessons from the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWmg3AyUYgRR7U7QjoNvkg.png" /><figcaption>Redis outage test</figcaption></figure><h3>14. Understanding Service Endpoints</h3><p>After Redis was scaled down, I checked the application’s endpoints:</p><pre>kubectl get endpoints boutique-app-external</pre><p>The result showed no active endpoints.</p><p>Kubernetes also displayed the warning:</p><pre>v1 Endpoints is deprecated in v1.33+</pre><p>The important observation was that the Service had no healthy backend available.</p><p>This is because the application’s readiness condition was no longer satisfied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SogkMtnVbhP2KSJ9J7Lmew.png" /><figcaption>Empty Service endpoints</figcaption></figure><h3>15. Persistent Storage: Why products.json Survives</h3><p>Another important requirement of this project was understanding persistence.</p><p>The application stores the product catalog on a PersistentVolume.</p><p>The storage path is:</p><pre>/mnt/data/kucl-shop-data</pre><p>on the Kubernetes node.</p><p>The PV uses:</p><pre>hostPath:<br>  path: /mnt/data/kucl-shop-data<br>  type: DirectoryOrCreate</pre><p>This means the data is stored outside the container’s writable filesystem.</p><p>Conceptually:</p><pre>Container filesystem<br>       │<br>       │ temporary<br>       ▼<br>   deleted with Pod</pre><pre>PersistentVolume<br>       │<br>       │ mounted storage<br>       ▼<br>/mnt/data/kucl-shop-data<br>       │<br>       ▼<br>   survives Pod recreation</pre><h3>16. Finding the Data on the Actual Node</h3><p>One of the lab requirements was to locate products.json on the <strong>actual node disk</strong>, rather than simply proving that it exists inside the container.</p><p>The expected location is:</p><pre>/mnt/data/kucl-shop-data/products.json</pre><p>However, when I initially checked the Minikube node directly:</p><pre>minikube ssh &#39;cat /mnt/data/kucl-shop-data/products.json&#39;</pre><p>I received:</p><pre>No such file or directory</pre><p>This was an important debugging discovery.</p><p>The Kubernetes PV was bound successfully, and the application could read the file from its mounted path, but the direct node-level path I checked did not contain the file.</p><p>This highlights a subtle but important point:</p><blockquote><em>A successful PV/PVC binding does not automatically mean that the data is located where you expect it on every Minikube node.</em></blockquote><p>With a multi-node cluster, the workload’s actual node matters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w4rhMJipJiCdz8GjPb1OFA.png" /><figcaption>Node-level storage check</figcaption></figure><h3>17. Looking at the Kubernetes Manifests</h3><p>The project was organized into separate manifests:</p><pre>manifests/<br>├── 00-namespace.yaml<br>├── 01-storage.yaml<br>├── 02-redis.yaml<br>├── 03-configmap-php-app.yaml<br>└── 04-boutique-app.yaml</pre><p>This structure keeps the Kubernetes configuration modular and makes the deployment sequence easy to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyI4-JCTd5MCYJeqMU1RQw.png" /><figcaption>Project files</figcaption></figure><h3>18. The Storage Manifest</h3><p>The storage manifest defines both the PV and PVC.</p><p>The important configuration is:</p><pre>storageClassName: kucl-hostpath</pre><p>and:</p><pre>hostPath:<br>  path: /mnt/data/kucl-shop-data<br>  type: DirectoryOrCreate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cm2qXV1ASVvqZITH1DnFhQ.png" /><figcaption>PersistentVolume configuration</figcaption></figure><h3>19. Redis Manifest</h3><p>The Redis manifest defines:</p><ul><li>Redis Deployment</li><li>Redis container</li><li>Port 6379</li><li>Readiness probe</li><li>Liveness probe</li><li>CPU and memory requests</li><li>CPU and memory limits</li><li>Redis Service</li></ul><p>For example:</p><pre>resources:<br>  requests:<br>    cpu: 50m<br>    memory: 64Mi<br>  limits:<br>    cpu: 150m<br>    memory: 128Mi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nctif47Gi82xwlzLWgrsyA.png" /><figcaption>Redis YAML</figcaption></figure><h3>20. Application Manifest</h3><p>The main application manifest brings everything together.</p><p>It defines:</p><ul><li>Deployment</li><li>Init containers</li><li>Main application container</li><li>ConfigMap mounts</li><li>PVC mounts</li><li>Redis environment variables</li><li>Liveness probe</li><li>Readiness probe</li><li>Services</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFNOITnzFuQZ8M6kAO7Bdw.png" /><figcaption>Boutique application manifest</figcaption></figure><h3>21. Application Code and Shared Storage</h3><p>The application code reads:</p><pre>$dataFile = &#39;/var/www/html/data/products.json&#39;;</pre><p>The important architectural idea is that the application doesn’t create the product catalog itself.</p><p>Instead:</p><pre>seed-product-data<br>       │<br>       ▼<br>Persistent Volume<br>       │<br>       ▼<br>products.json<br>       │<br>       ▼<br>PHP application</pre><p>This separates <strong>initialization</strong> from <strong>application runtime</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G20gax3SAd-X50T4m4mW4Q.png" /><figcaption>PHP application code</figcaption></figure><h3>22. What I Learned from the Project</h3><p>This project helped me understand several Kubernetes concepts much better than simply reading documentation.</p><h3>1. Init containers have specific responsibilities</h3><p>I learned to distinguish between:</p><pre>wait-for-redis</pre><p>and:</p><pre>seed-product-data</pre><p>The first handles a dependency.</p><p>The second initializes data.</p><h3>2. Readiness and liveness are not interchangeable</h3><p>A Pod can be:</p><pre>Alive but not Ready</pre><p>For example:</p><pre>PHP application → alive<br>Redis → unavailable<br>       ↓<br>Readiness → failed<br>Liveness → successful</pre><p>This prevents unnecessary application restarts during temporary dependency failures.</p><h3>3. Services depend on readiness</h3><p>When the application’s readiness probe fails, Kubernetes can remove the Pod from the Service’s available endpoints.</p><p>This protects users from being routed to an unhealthy application instance.</p><h3>4. Persistent storage is different from container storage</h3><p>Anything written only to the container’s filesystem can disappear when the container/Pod is recreated.</p><p>A PersistentVolume provides storage independently of the container lifecycle.</p><h3>5. Multi-node clusters require thinking about where storage lives</h3><p>This was particularly useful during the node-level storage test.</p><p>With multiple nodes, you need to understand:</p><pre>Which node is running my Pod?<br>Where is my volume mounted?<br>Where is the actual data stored?</pre><h3>Final Architecture</h3><p>The final application can be summarized as:</p><pre>Kubernetes Cluster<br>                              │<br>                       ┌──────┴──────┐<br>                       │  kucl-shop   │<br>                       │  Namespace   │<br>                       └──────┬──────┘<br>                              │<br>             ┌────────────────┴────────────────┐<br>             │                                 │<br>             ▼                                 ▼<br>       Boutique App                         Redis<br>        Deployment                       Deployment<br>             │                                 │<br>             │                                 │<br>       ┌─────┴─────┐                       :6379<br>       │           │<br>       ▼           ▼<br> wait-for-redis  seed-product-data<br>       │           │<br>       │           ▼<br>       │       PersistentVolume<br>       │           │<br>       │           ▼<br>       │     products.json<br>       │<br>       ▼<br>     PHP Server<br>       │<br>       ├── /health-live.php<br>       │<br>       └── /health-ready.php<br>               │<br>               ├── Redis check<br>               └── Product data check</pre><h3>Kubernetes Concepts Demonstrated</h3><p>Kubernetes ConceptImplementationNamespacekucl-shopDeploymentRedis + Boutique AppServiceRedis + Boutique AppConfigMapApplication code + seed dataInit ContainerDependency wait + data seedingPersistentVolume200Mi hostPathPersistentVolumeClaimkucl-shop-pvcReadiness Probe/health-ready.phpLiveness Probe/health-live.phpNodePortExternal application accessResource RequestsCPU + MemoryResource LimitsCPU + MemoryMulti-node Clusterminikube + minikube-m02Failure TestingRedis outagePersistent Storage TestingNode-level data verification</p><h3>Conclusion</h3><p>Building this boutique application from scratch gave me a practical understanding of how Kubernetes manages applications beyond simply running containers.</p><p>The most valuable part wasn’t getting the application into a Running state. It was understanding <strong>why Kubernetes behaves the way it does when dependencies fail, Pods restart, readiness changes, and persistent storage is involved.</strong></p><p>The project especially helped me understand the relationship between:</p><pre>Init Containers<br>       ↓<br>Application Dependencies<br>       ↓<br>Health Probes<br>       ↓<br>Services<br>       ↓<br>Persistent Storage<br>       ↓<br>Failure Recovery</pre><p>This project strengthened my hands-on experience with <strong>Kubernetes, container orchestration, Redis, persistent storage, ConfigMaps, health probes, and troubleshooting</strong>.</p><p>I’m continuing to build more practical DevOps projects to deepen my understanding of Kubernetes and cloud-native infrastructure.</p><h3>Tools &amp; Technologies</h3><p><strong>Kubernetes | Minikube | Docker/Containerd | Redis | PHP | YAML | ConfigMaps | PersistentVolumes | PersistentVolumeClaims | NodePort | Linux</strong></p><h3>Project structure</h3><pre>kucl-boutique-shop/<br>│<br>├── php-app/<br>│   ├── index.php<br>│   ├── cart.php<br>│   ├── RedisClient.php<br>│   ├── health-live.php<br>│   ├── health-ready.php<br>│   ├── products-seed.json<br>│   └── style.css<br>│<br>├── manifests/<br>│   ├── 00-namespace.yaml<br>│   ├── 01-storage.yaml<br>│   ├── 02-redis.yaml<br>│   ├── 03-configmap-php-app.yaml<br>│   └── 04-boutique-app.yaml<br>│<br>└── README.md</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d057b57a3e9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Kubernetes Multi-Tier Application: Hands-On Resource Management and Quota Enforcement]]></title>
            <link>https://medium.com/@ruship7800/kubernetes-multi-tier-application-hands-on-resource-management-and-quota-enforcement-c9cd379be4ff?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9cd379be4ff</guid>
            <category><![CDATA[limitrange]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[resource-quota]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Tue, 15 Sep 2026 13:34:43 GMT</pubDate>
            <atom:updated>2026-09-15T13:34:43.558Z</atom:updated>
            <content:encoded><![CDATA[<h3>A practical Kubernetes project using Namespaces, ResourceQuota, LimitRange, MySQL, Backend APIs, Nginx, and Minikube</h3><p>Kubernetes makes it easy to run applications, but simply creating Pods isn’t enough.</p><p>In a real environment, we also need to answer questions like:</p><ul><li>How many Pods can a team create?</li><li>How much CPU and memory can a namespace consume?</li><li>What happens when an application tries to exceed its resource limits?</li><li>How can we prevent one workload from consuming all available cluster resources?</li><li>How do we structure a multi-tier application inside Kubernetes?</li></ul><p>To explore these concepts hands-on, I built a <strong>multi-tier application environment in Kubernetes</strong> and deliberately tested what happens when the configured resource quota is exceeded.</p><p>The project consisted of:</p><pre>Namespace<br>   │<br>   ├── ResourceQuota<br>   ├── LimitRange<br>   │<br>   ├── MySQL Database<br>   │<br>   ├── Backend API<br>   │<br>   └── Frontend Web</pre><p>The most interesting part of the project was intentionally scaling the frontend beyond the namespace’s Pod limit and observing Kubernetes reject the additional Pods.</p><h3>🛠️ Technology Stack</h3><ul><li>Kubernetes</li><li>kubectl</li><li>Minikube</li><li>Linux</li><li>MySQL 8.0</li><li>Nginx</li><li>Docker Hub</li><li>Kubernetes Namespace</li><li>ResourceQuota</li><li>LimitRange</li><li>Deployments</li><li>Services</li></ul><h3>1. Creating a Dedicated Kubernetes Namespace</h3><p>I started by creating a dedicated namespace called:</p><pre>multitier-app</pre><p>The purpose was to isolate all resources belonging to this application.</p><p>My namespace configuration also included a <strong>ResourceQuota</strong> and <strong>LimitRange</strong>.</p><h3>namespace.yaml</h3><pre>apiVersion: v1<br>kind: Namespace<br>metadata:<br>  name: multitier-app</pre><pre>---<br>apiVersion: v1<br>kind: ResourceQuota<br>metadata:<br>  name: multitier-quota<br>  namespace: multitier-app<br>spec:<br>  hard:<br>    pods: &quot;6&quot;<br>    requests.cpu: &quot;1500m&quot;<br>    requests.memory: 1.5Gi<br>    limits.cpu: &quot;3&quot;<br>    limits.memory: 3Gi<br>    persistentvolumeclaims: &quot;3&quot;</pre><pre>---<br>apiVersion: v1<br>kind: LimitRange<br>metadata:<br>  name: multitier-limitrange<br>  namespace: multitier-app<br>spec:<br>  limits:<br>    - default:<br>        cpu: 300m<br>        memory: 256Mi<br>      defaultRequest:<br>        cpu: 150m<br>        memory: 128Mi<br>      type: Container</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eN7vm9bBE9O_45l5bv7PAw.png" /><figcaption><em>Figure 1: Creating the Kubernetes Namespace, ResourceQuota, and LimitRange configuration.</em></figcaption></figure><h3>2. Understanding ResourceQuota</h3><p>One of the important concepts I wanted to test was <strong>namespace-level resource governance</strong>.</p><p>I configured the following quota:</p><p>ResourceMaximumPods6CPU Requests1500mMemory Requests1.5GiCPU Limits3Memory Limits3GiPVCs3</p><p>This means workloads inside multitier-app cannot collectively exceed these configured limits.</p><p>For example:</p><pre>pods: &quot;6&quot;</pre><p>means Kubernetes will not allow more than <strong>6 Pods</strong> in the namespace.</p><p>This became especially important later in the project.</p><h3>3. Configuring LimitRange</h3><p>Alongside the ResourceQuota, I configured a Kubernetes <strong>LimitRange</strong>.</p><p>The defaults were:</p><pre>defaultRequest:<br>  cpu: 150m<br>  memory: 128Mi</pre><pre>default:<br>  cpu: 300m<br>  memory: 256Mi</pre><p>This provides default resource requests and limits for containers that don’t explicitly define them.</p><p>In other words:</p><pre>Container<br>   │<br>   ├── No request specified?<br>   │       ↓<br>   │    150m CPU<br>   │    128Mi Memory<br>   │<br>   └── No limit specified?<br>           ↓<br>        300m CPU<br>        256Mi Memory</pre><p>This gives the namespace predictable resource behavior.</p><h3>4. Deploying MySQL</h3><p>The first application tier was the database.</p><p>I deployed:</p><pre>mysql:8.0</pre><p>with one replica.</p><h3>MySQL configuration</h3><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: mysql-db<br>  namespace: multitier-app<br>spec:<br>  replicas: 1</pre><p>The database used a Kubernetes Secret for the root password:</p><pre>env:<br>  - name: MYSQL_ROOT_PASSWORD<br>    valueFrom:<br>      secretKeyRef:<br>        name: db-secret<br>        key: root-password</pre><p>I also created the application database:</p><pre>- name: MYSQL_DATABASE<br>  value: appdb</pre><p>Resource requirements were explicitly defined:</p><pre>resources:<br>  requests:<br>    cpu: 200m<br>    memory: 256Mi<br>  limits:<br>    cpu: 500m<br>    memory: 512Mi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqiqgse6OC85c-5ssC45hQ.png" /><figcaption><em>Figure 2: MySQL Deployment configuration using Kubernetes resources and a Secret.</em></figcaption></figure><h3>5. Deploying the Backend API</h3><p>The second tier was the backend API.</p><p>I deployed two replicas:</p><pre>replicas: 2</pre><p>The backend image was hosted on Docker Hub:</p><pre>image: ruship7800/kucl-backend:v1</pre><p>The backend container listened on:</p><pre>8080</pre><p>Resource configuration:</p><pre>requests:<br>  cpu: 150m<br>  memory: 128Mi</pre><pre>limits:<br>  cpu: 300m<br>  memory: 256Mi</pre><p>I also created a ClusterIP Service:</p><pre>backend-svc:8080</pre><p>This allows other Kubernetes workloads to communicate with the backend without exposing it directly outside the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoxtazYOgsIqx-dNEC-k3w.png" /><figcaption><em>Figure 3: Backend API Deployment configured with two replicas and resource requests/limits.</em></figcaption></figure><h3>6. Deploying the Frontend</h3><p>For the frontend tier, I used:</p><pre>nginx:alpine</pre><p>with two initial replicas:</p><pre>replicas: 2</pre><p>The container exposed port:</p><pre>80</pre><p>Resource configuration:</p><pre>requests:<br>  cpu: 100m<br>  memory: 64Mi</pre><pre>limits:<br>  cpu: 200m<br>  memory: 128Mi</pre><p>The frontend Service was configured as a NodePort, allowing external access to the web tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45qp-lg6OZOWV9X3X52R_w.png" /><figcaption><em>Figure 4: Nginx frontend Deployment with two replicas.</em></figcaption></figure><h3>7. Applying the Kubernetes Configuration</h3><p>Once the manifests were ready, I applied the namespace and quota configuration:</p><pre>kubectl apply -f namespace-quota.yaml</pre><p>Kubernetes created:</p><pre>namespace/multitier-app created<br>resourcequota/multitier-quota created<br>limitrange/multitier-limitrange created</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejQgTM1uS_i-OzQO0yG8Qg.png" /><figcaption><em>Figure 5: Successfully creating the namespace, ResourceQuota, and LimitRange.</em></figcaption></figure><h3>8. Deploying All Three Tiers</h3><p>I then deployed MySQL, the backend API, and the frontend:</p><pre>kubectl apply \<br>  -f mysql.yaml \<br>  -f backend.yaml \<br>  -f frontend.yaml \<br>  -n multitier-app</pre><p>Kubernetes successfully created:</p><pre>deployment.apps/mysql-db created<br>service/mysql-svc created</pre><pre>deployment.apps/backend-api created<br>service/backend-svc created</pre><pre>deployment.apps/frontend-web created<br>service/frontend-svc created</pre><p>At this point, the application had all three major tiers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEO24GA9Q3wq0wwCuP7CjA.png" /><figcaption><em>Figure 6: Deploying the MySQL, backend, and frontend resources.</em></figcaption></figure><h3>9. Inspecting ResourceQuota Usage</h3><p>After deployment, I checked the current quota usage:</p><pre>kubectl describe resourcequota multitier-quota \<br>  -n multitier-app</pre><p>The output showed:</p><pre>Resource                    Used      Hard<br>limits.cpu                  1500m     3<br>limits.memory               1280Mi    3Gi<br>persistentvolumeclaims      0         3<br>pods                        5         6<br>requests.cpu                700m      1500m<br>requests.memory             640Mi     1536Mi</pre><p>This was an important checkpoint.</p><p>The namespace had:</p><pre>5 / 6 Pods</pre><p>So only <strong>one additional Pod</strong> could be created before reaching the configured Pod quota.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*by6Kufsa6HSJNPm1Swzjvw.png" /><figcaption><em>Figure 7: Inspecting ResourceQuota and LimitRange usage.</em></figcaption></figure><h3>10. Verifying the LimitRange</h3><p>I also inspected the LimitRange:</p><pre>kubectl describe limitrange multitier-limitrange \<br>  -n multitier-app</pre><p>The result confirmed:</p><pre>Resource    Default Request    Default Limit<br>CPU         150m               300m<br>Memory      128Mi              256Mi</pre><p>This verified that the namespace-level defaults were active.</p><p>This was useful because ResourceQuota and LimitRange serve <strong>different purposes</strong>:</p><h3>ResourceQuota</h3><p>Controls the <strong>total resources used by the namespace</strong>.</p><h3>LimitRange</h3><p>Controls <strong>default/minimum/maximum resource behavior for individual containers</strong>.</p><p>So:</p><pre>LimitRange<br>     ↓<br>Individual Containers</pre><pre>ResourceQuota<br>     ↓<br>Entire Namespace</pre><h3>11. The Interesting Part: Testing the Pod Quota</h3><p>Now I wanted to test whether Kubernetes would actually enforce the configured limit.</p><p>The frontend initially had:</p><pre>replicas: 2</pre><p>I intentionally scaled it to <strong>10 replicas</strong>:</p><pre>kubectl scale deployment frontend-web \<br>  --replicas=10 \<br>  -n multitier-app</pre><p>Kubernetes accepted the scaling request:</p><pre>deployment.apps/frontend-web scaled</pre><p>But the Pods themselves could not all be created.</p><p>Why?</p><p>Because the namespace already had:</p><pre>5 Pods</pre><p>and the ResourceQuota allowed:</p><pre>6 Pods maximum</pre><p>Therefore, only one additional Pod could be created.</p><h3>12. Kubernetes Enforces the Quota 🚫</h3><p>I checked the Kubernetes events:</p><pre>kubectl get events -n multitier-app | grep -i quota</pre><p>Kubernetes reported:</p><pre>exceeded quota: multitier-quota</pre><p>and:</p><pre>requested: pods=1<br>used: pods=6<br>limited: pods=6</pre><p>This is exactly what I wanted to demonstrate.</p><p>Even though the Deployment requested <strong>10 replicas</strong>, Kubernetes’ admission control prevented additional Pods from being created once the namespace reached its quota.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVu59XqW81eddbdm64valw.png" /><figcaption><em>Figure 8: Kubernetes rejecting additional frontend Pods after the namespace reached its six-Pod quota.</em></figcaption></figure><h3>13. Checking Deployment Conditions</h3><p>I then inspected the frontend Deployment:</p><pre>kubectl describe deployment frontend-web \<br>  -n multitier-app | grep -A5 Conditions</pre><p>The output showed:</p><pre>Conditions:</pre><pre>Type              Status   Reason<br>Progressing       True     NewReplicaSetAvailable<br>Available         False    MinimumReplicasUnavailable<br>ReplicaFailure    True     FailedCreate</pre><p>This was another useful demonstration.</p><p>The Deployment itself existed, but Kubernetes couldn’t satisfy the desired replica count because the namespace’s Pod quota prevented additional Pods from being created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvoHnZjB3LZ0b-d3_2FUlQ.png" /><figcaption><em>Figure 9: Deployment conditions showing ReplicaFailure caused by failed Pod creation.</em></figcaption></figure><h3>🧠 What Actually Happened?</h3><p>The sequence can be summarized like this:</p><pre>Frontend replicas = 2<br>         │<br>         ▼<br>Namespace Pods = 5<br>         │<br>         ▼<br>Scale frontend to 10<br>         │<br>         ▼<br>Kubernetes tries to create more Pods<br>         │<br>         ▼<br>Pod #6 → Allowed<br>         │<br>         ▼<br>Namespace reaches quota<br>         │<br>         ▼<br>Pod #7 → DENIED<br>Pod #8 → DENIED<br>Pod #9 → DENIED<br>Pod #10 → DENIED</pre><p>The important distinction is that:</p><p><strong>Scaling the Deployment to 10 does not mean 10 Pods were successfully created.</strong></p><p>The Deployment’s desired state became 10, but the ResourceQuota prevented the cluster from reaching that desired state.</p><h3>📊 Resource Management in This Project</h3><p>The resource consumption before the scaling test looked approximately like:</p><pre>Pod quota</pre><pre>Used: 5<br>Limit: 6</pre><pre>█████████████████░░░ 83%</pre><p>CPU requests:</p><pre>Used: 700m<br>Limit: 1500m</pre><p>Memory requests:</p><pre>Used: 640Mi<br>Limit: 1536Mi</pre><p>This shows an important Kubernetes concept:</p><p><strong>A workload can be constrained by different quota dimensions.</strong></p><p>In this particular test, the immediate blocking constraint was:</p><pre>pods: 6</pre><p>rather than CPU or memory.</p><h3>🔍 ResourceQuota vs LimitRange</h3><p>This project helped me understand the difference between these two Kubernetes features.</p><p>FeaturePurposeNamespaceIsolates resourcesResourceQuotaLimits total namespace consumptionLimitRangeDefines container-level defaults/constraintsDeploymentManages application replicasServiceProvides stable network accessSecretStores sensitive configurationPodRuns the actual container</p><p>A simple way to remember it:</p><pre>           Kubernetes Namespace<br>                     │<br>        ┌────────────┴────────────┐<br>        │                         │<br> ResourceQuota                LimitRange<br>        │                         │<br> Total namespace            Individual container<br>    resources                   defaults<br>        │                         │<br>        └────────────┬────────────┘<br>                     │<br>                Applications</pre><h3>💡 Key Lessons From the Project</h3><h3>1. Kubernetes doesn’t blindly follow replica counts</h3><p>A Deployment can request 10 replicas, but Kubernetes still has to satisfy namespace quotas and other constraints.</p><h3>2. ResourceQuota is an important governance mechanism</h3><p>It prevents a single namespace from consuming unlimited cluster resources.</p><h3>3. LimitRange and ResourceQuota solve different problems</h3><p>One manages container-level defaults and constraints, while the other manages aggregate namespace consumption.</p><h3>4. Kubernetes Events are extremely useful for troubleshooting</h3><p>This command was particularly valuable:</p><pre>kubectl get events -n multitier-app | grep -i quota</pre><p>It gave me the exact reason why Pod creation failed.</p><h3>5. Deployment conditions reveal application health</h3><p>The following:</p><pre>ReplicaFailure: True</pre><p>immediately indicated that the Deployment couldn’t create all requested replicas.</p><h3>🏗️ Final Architecture</h3><p>The resulting architecture looked like:</p><pre>                     ┌─────────────────────┐<br>                     │    multitier-app    │<br>                     │      Namespace      │<br>                     └──────────┬──────────┘<br>                                │<br>                ┌───────────────┼───────────────┐<br>                │               │               │<br>                ▼               ▼               ▼<br>          ┌──────────┐    ┌──────────┐    ┌──────────┐<br>          │  Nginx   │    │ Backend  │    │  MySQL   │<br>          │ Frontend │    │   API    │    │ Database │<br>          └────┬─────┘    └────┬─────┘    └──────────┘<br>               │               │<br>               │               │<br>        frontend-svc      backend-svc<br>          NodePort          ClusterIP<br>               │               │<br>               └───────┬───────┘<br>                       │<br>                  mysql-svc<br>                    :3306</pre><pre>        Namespace Controls<br>        ┌───────────────────────────┐<br>        │ ResourceQuota             │<br>        │ LimitRange                │<br>        └───────────────────────────┘</pre><h3>🎯 Conclusion</h3><p>This project gave me hands-on experience with more than just deploying Kubernetes workloads.</p><p>I was able to work with:</p><p><strong>Namespaces → ResourceQuota → LimitRange → Secrets → MySQL → Backend API → Frontend → Services → Deployments → Scaling → Kubernetes Events → Troubleshooting</strong></p><p>The most valuable part was intentionally pushing the system beyond its configured capacity and seeing Kubernetes enforce the ResourceQuota.</p><p>Instead of simply learning:</p><blockquote><em>“ResourceQuota limits resources.”</em></blockquote><p>I actually observed Kubernetes reject Pod creation with:</p><pre>exceeded quota: multitier-quota</pre><p>That practical experience made the concept much clearer.</p><h3>🚀 What I Would Improve Next</h3><p>For a more production-ready version of this project, I would extend it with:</p><ul><li>PersistentVolume + PersistentVolumeClaim for MySQL</li><li>Backend → MySQL environment configuration</li><li>Nginx reverse proxy to the backend</li><li>Kubernetes Secrets for application credentials</li><li>Readiness and liveness probes</li><li>ConfigMaps</li><li>Horizontal Pod Autoscaler</li><li>Ingress</li><li>Prometheus + Grafana monitoring</li><li>CI/CD pipeline for automated image builds and deployments</li></ul><p>That would take this project from a Kubernetes resource-management exercise toward a more complete <strong>production-style DevOps deployment</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9cd379be4ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ From Flask to Kubernetes: Containerizing and Deploying a Versioned Application]]></title>
            <link>https://medium.com/@ruship7800/from-flask-to-kubernetes-containerizing-and-deploying-a-versioned-application-0f5fcb3a86a6?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f5fcb3a86a6</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[flask]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Tue, 15 Sep 2026 12:24:17 GMT</pubDate>
            <atom:updated>2026-09-15T12:24:17.483Z</atom:updated>
            <content:encoded><![CDATA[<h3>A hands-on DevOps project using Flask, Docker, Docker Hub, Kubernetes and Minikube</h3><p>In this project, I built a small Flask application, containerized it using Docker, pushed the image to Docker Hub, deployed it on a Kubernetes cluster using Minikube, exposed it through a Kubernetes Service, and finally performed a rolling update from <strong>v1 to v2</strong>.</p><p>This project helped me understand how an application moves through a typical containerized deployment workflow:</p><pre>Flask Application<br>       ↓<br>   Dockerfile<br>       ↓<br> Docker Image<br>       ↓<br>   Docker Hub<br>       ↓<br> Kubernetes Deployment<br>       ↓<br>     Pods<br>       ↓<br> Kubernetes Service<br>       ↓<br>   Application<br>       ↓<br> Rolling Update</pre><h3>🛠️ Technologies Used</h3><ul><li><strong>Python / Flask</strong> — Application</li><li><strong>Docker</strong> — Containerization</li><li><strong>Docker Hub</strong> — Container image registry</li><li><strong>Kubernetes</strong> — Container orchestration</li><li><strong>Minikube</strong> — Local Kubernetes cluster</li><li><strong>kubectl</strong> — Kubernetes CLI</li><li><strong>Linux / Ubuntu</strong> — Development environment</li></ul><h3>1. Creating the Flask Application</h3><p>I started by creating a simple Flask application inside /project1.</p><p>The application exposes two endpoints:</p><ul><li>/ – Displays the hostname and application version</li><li>/health – Provides a health check</li></ul><p>The main purpose of displaying the hostname was to make it easy to see which Kubernetes pod was handling the request.</p><h3>app.py</h3><pre>from flask import Flask<br>import socket<br>import os</pre><pre>app = Flask(__name__)</pre><pre>@app.route(&quot;/&quot;)<br>def home():<br>    return f&quot;Hello from {socket.gethostname()} | Version: {os.getenv(&#39;APP_VERSION&#39;, &#39;v1&#39;)}&quot;</pre><pre>@app.route(&quot;/health&quot;)<br>def health():<br>    return &quot;OK&quot;, 200</pre><pre>if __name__ == &quot;__main__&quot;:<br>    app.run(host=&quot;0.0.0.0&quot;, port=5000)</pre><p>The important part here is:</p><pre>socket.gethostname()</pre><p>Because every Kubernetes pod has its own hostname, this allows me to identify which pod responded to the request.</p><p>The application version is retrieved using:</p><pre>os.getenv(&quot;APP_VERSION&quot;, &quot;v1&quot;)</pre><p>This also makes the application easy to configure through environment variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RVZpN7KzkXnHBrEHvKMMEg.png" /><figcaption><em>Figure 1: Creating and verifying the Flask application code.</em></figcaption></figure><h3>2. Creating requirements.txt</h3><p>Next, I created a requirements.txt file containing the Flask dependency.</p><pre>Flask==3.1.2</pre><p>This allows Docker to install the required Python dependency during image creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqDelF8eaxSs8QezbWO8KA.png" /><figcaption><em>Figure 2: Flask dependency defined in requirements.txt.</em></figcaption></figure><h3>3. Creating the Dockerfile</h3><p>Once the application was ready, I created a Dockerfile to package it into a container.</p><pre>FROM python:3.11-slim</pre><pre>WORKDIR /app</pre><pre>COPY requirements.txt .</pre><pre>RUN pip install --no-cache-dir -r requirements.txt</pre><pre>COPY app.py .</pre><pre>ENV APP_VERSION=v1</pre><pre>EXPOSE 5000</pre><pre>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><h3>What each instruction does</h3><p><strong>Base image</strong></p><pre>FROM python:3.11-slim</pre><p>Uses a lightweight Python image.</p><p><strong>Working directory</strong></p><pre>WORKDIR /app</pre><p>Sets /app as the working directory inside the container.</p><p><strong>Install dependencies</strong></p><pre>COPY requirements.txt .<br>RUN pip install --no-cache-dir -r requirements.txt</pre><p>Copies the requirements file and installs Flask.</p><p><strong>Copy application</strong></p><pre>COPY app.py .</pre><p>Copies the Flask application into the container.</p><p><strong>Environment variable</strong></p><pre>ENV APP_VERSION=v1</pre><p>Sets the default application version.</p><p><strong>Port</strong></p><pre>EXPOSE 5000</pre><p>Documents the port used by the Flask application.</p><p><strong>Start command</strong></p><pre>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>Starts the Flask application when the container launches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KEdowamZ5aVsOsSjn4zc-Q.png" /><figcaption><em>Figure 3: Dockerfile used to containerize the Flask application.</em></figcaption></figure><h3>4. Building the Docker Image</h3><p>With the application and Dockerfile ready, I built the Docker image:</p><pre>docker build -t ruship7800/kucl-demo-app:v1 .</pre><p>The image was successfully built and tagged as:</p><pre>ruship7800/kucl-demo-app:v1</pre><p>This gave me a versioned container image that could be used by Kubernetes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCYYiDpd1PE07fMsOLPqpw.png" /><figcaption><em>Figure 4: Successfully building the Docker image.</em></figcaption></figure><h3>5. Authenticating with Docker Hub</h3><p>Before pushing the image, I authenticated with Docker Hub:</p><pre>docker login</pre><p>Docker provided a browser-based authentication flow, and after successful authentication the terminal displayed:</p><pre>Login Succeeded</pre><p>This allowed me to push my locally built image to my Docker Hub repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJS0xkA1AcFgbTbmK-r6QQ.png" /><figcaption><em>Figure 5: Successfully authenticating with Docker Hub.</em></figcaption></figure><blockquote><strong><em>Security note:</em></strong><em> Never publish authentication credentials, access tokens, passwords, or private keys in a project blog.</em></blockquote><h3>6. Pushing the Image to Docker Hub</h3><p>After logging in, I pushed version 1:</p><pre>docker push ruship7800/kucl-demo-app:v1</pre><p>Docker reused layers that already existed in the registry and pushed the new layer.</p><p>The image was successfully published with a SHA256 digest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gFrkfsdI4UVMVHn7COCgg.png" /><figcaption><em>Figure 6: Pushing version 1 of the Docker image to Docker Hub.</em></figcaption></figure><h3>7. Building Version 2</h3><p>To demonstrate application versioning and Kubernetes updates, I built a second image:</p><pre>docker build \<br>  -t ruship7800/kucl-demo-app:v2 \<br>  --build-arg APP_VERSION=v2 .</pre><p>This created:</p><pre>ruship7800/kucl-demo-app:v2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Tabb4aPWXA9nB7c7RFCPg.png" /><figcaption><em>Figure 7: Building the version 2 Docker image.</em></figcaption></figure><h3>8. Pushing Version 2</h3><p>I then pushed the second image to Docker Hub:</p><pre>docker push ruship7800/kucl-demo-app:v2</pre><p>The push completed successfully.</p><pre>v2: digest: sha256:...</pre><p>At this point, Docker Hub contained both application versions:</p><pre>ruship7800/kucl-demo-app:v1<br>ruship7800/kucl-demo-app:v2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9TEk36v45B1IuPQfyXa5Rw.png" /><figcaption><em>Figure 8: Successfully pushing version 2 to Docker Hub.</em></figcaption></figure><h3>9. Deploying the Application to Kubernetes</h3><p>Next, I deployed the application to my Kubernetes cluster using:</p><pre>kubectl apply -f deployment.yml</pre><p>Kubernetes created two resources:</p><pre>deployment.apps/demo-app created<br>service/demo-app-svc created</pre><p>The Deployment manages the application Pods, while the Service provides network access to those Pods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWvtVSQYMG9nzSxz0cLxOg.png" /><figcaption><em>Figure 9: Creating the Kubernetes Deployment and Service.</em></figcaption></figure><h3>10. Checking Kubernetes Pods</h3><p>After creating the Deployment, I checked the Pods:</p><pre>kubectl get pods -o wide</pre><p>Initially, the Pods were in:</p><pre>ContainerCreating</pre><p>This is expected because Kubernetes was still creating the containers.</p><p>After waiting, I watched the Pods using:</p><pre>kubectl get pod -w</pre><p>The Pods eventually changed to:</p><pre>1/1   Running</pre><p>All three replicas were successfully running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbuyGjYH5AKIxPRr-YX_Cw.png" /><figcaption><em>Figure 10: Kubernetes Pods transitioning from ContainerCreating to Running.</em></figcaption></figure><h3>A Small Command-Line Lesson</h3><p>I initially typed:</p><pre>kubectl get pod -watch</pre><p>which produced:</p><pre>error: unknown shorthand flag: &#39;a&#39; in -atch</pre><p>The correct command is:</p><pre>kubectl get pod -w</pre><p>or:</p><pre>kubectl get pods --watch</pre><p>This was a small but useful reminder that Kubernetes CLI flags need to be used precisely.</p><h3>11. Verifying the Container Image</h3><p>Once the Pods were running, I checked which image was being used:</p><pre>kubectl describe pod demo-app-54587b7b79-9v7m6 | grep Image:</pre><p>The output showed:</p><pre>Image: ruship7800/kucl-demo-app:v1</pre><p>This confirmed that the Kubernetes Deployment was initially running version 1 of my application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDEW_wl0JwYGOg1ZNT_jag.png" /><figcaption><em>Figure 11: Verifying that the Kubernetes Pod is running the v1 image.</em></figcaption></figure><h3>12. Exposing the Application</h3><p>The Kubernetes Service was configured as a NodePort.</p><p>I checked it using:</p><pre>kubectl get svc demo-app-svc</pre><p>The result showed:</p><pre>NAME           TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)<br>demo-app-svc   NodePort   10.98.121.238   &lt;none&gt;        80:31791/TCP</pre><p>This means the service exposes port 80 internally and maps it to NodePort 31791.</p><p>Because I was using Minikube, I could retrieve the service URL with:</p><pre>minikube service demo-app-svc --url</pre><p>Which returned:</p><pre>http://192.168.49.2:31791</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDEW_wl0JwYGOg1ZNT_jag.png" /><figcaption><em>Figure 12: Exposing the Kubernetes application through a NodePort Service.</em></figcaption></figure><h3>13. Performing a Kubernetes Rolling Update</h3><p>One of the most important parts of this project was updating the application without manually deleting the existing Pods.</p><p>I changed the Deployment image using:</p><pre>kubectl set image deployment/demo-app \<br>demo-app=ruship7800/kucl-demo-app:v2</pre><p>Kubernetes responded:</p><pre>deployment.apps/demo-app image updated</pre><p>I then monitored the rollout:</p><pre>kubectl rollout status deployment/demo-app</pre><p>The output showed:</p><pre>Waiting for deployment &quot;demo-app&quot; rollout to finish:<br>1 old replicas are pending termination...</pre><p>and eventually:</p><pre>deployment &quot;demo-app&quot; successfully rolled out</pre><p>This demonstrated Kubernetes’ <strong>rolling update mechanism</strong>.</p><p>Instead of stopping the entire application and starting it again, Kubernetes gradually replaced the old Pods with new Pods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCNstC6ghcooQapRM3th9w.png" /><figcaption><em>Figure 13: Successfully performing a rolling update from v1 to v2.</em></figcaption></figure><h3>14. Checking Deployment History</h3><p>Finally, I checked the Deployment’s revision history:</p><pre>kubectl rollout history deployment/demo-app</pre><p>The output showed:</p><pre>REVISION  CHANGE-CAUSE<br>1         &lt;none&gt;<br>2         &lt;none&gt;</pre><p>This confirmed that Kubernetes recorded two revisions of the Deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCNstC6ghcooQapRM3th9w.png" /></figure><h3>🧠 What I Learned From This Project</h3><p>This project gave me hands-on experience with several important DevOps concepts.</p><h3>1. Containerization</h3><p>I learned how to package a Python application and its dependencies into a portable Docker image.</p><h3>2. Image Versioning</h3><p>Using:</p><pre>v1<br>v2</pre><p>made it possible to distinguish between application releases.</p><h3>3. Docker Registry</h3><p>I learned how to authenticate with Docker Hub and push container images to a remote registry.</p><h3>4. Kubernetes Deployments</h3><p>Instead of manually managing individual containers, Kubernetes manages the desired number of application replicas.</p><h3>5. Kubernetes Services</h3><p>The Service provides a stable networking layer in front of the Pods.</p><h3>6. Minikube</h3><p>Minikube allowed me to practice Kubernetes deployment locally without requiring a production cluster.</p><h3>7. Rolling Updates</h3><p>The most important part of the project was seeing Kubernetes replace the old application version with the new one while maintaining the Deployment.</p><h3>🔄 Complete Workflow</h3><p>The complete workflow I implemented was:</p><pre>                    ┌─────────────────┐<br>                    │   Flask App     │<br>                    │     app.py      │<br>                    └────────┬────────┘<br>                             │<br>                             ▼<br>                    ┌─────────────────┐<br>                    │   Dockerfile    │<br>                    └────────┬────────┘<br>                             │<br>                             ▼<br>              ┌────────────────────────────┐<br>              │     Docker Build           │<br>              │  v1          →       v2    │<br>              └─────────────┬──────────────┘<br>                            │<br>                            ▼<br>                    ┌─────────────────┐<br>                    │   Docker Hub    │<br>                    │ v1 / v2 images  │<br>                    └────────┬────────┘<br>                             │<br>                             ▼<br>                    ┌─────────────────┐<br>                    │   Kubernetes    │<br>                    │   Deployment    │<br>                    └────────┬────────┘<br>                             │<br>                 ┌───────────┼───────────┐<br>                 ▼           ▼           ▼<br>              Pod v2      Pod v2      Pod v2<br>                 │           │           │<br>                 └───────────┼───────────┘<br>                             ▼<br>                    ┌─────────────────┐<br>                    │ Kubernetes      │<br>                    │ Service         │<br>                    └────────┬────────┘<br>                             │<br>                             ▼<br>                       Application</pre><h3>⚠️ One Improvement I Would Make</h3><p>There is one technical detail I would improve in the current implementation.</p><p>The Dockerfile contains:</p><pre>ENV APP_VERSION=v1</pre><p>but the v2 build command uses:</p><pre>--build-arg APP_VERSION=v2</pre><p>A --build-arg only has an effect when the Dockerfile declares a corresponding ARG.</p><p>A cleaner implementation would be:</p><pre>FROM python:3.11-slim</pre><pre>WORKDIR /app</pre><pre>COPY requirements.txt .</pre><pre>RUN pip install --no-cache-dir -r requirements.txt</pre><pre>COPY app.py .</pre><pre>ARG APP_VERSION=v1<br>ENV APP_VERSION=${APP_VERSION}</pre><pre>EXPOSE 5000</pre><pre>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>Then:</p><pre>docker build \<br>  -t ruship7800/kucl-demo-app:v2 \<br>  --build-arg APP_VERSION=v2 .</pre><p>would actually embed v2 into the image environment.</p><p>An even better Kubernetes approach would be to control the application version through the Deployment’s environment variables rather than rebuilding the image simply to change configuration.</p><p>This is a good example of something I discovered while doing the project: <strong>getting a deployment to work is only the first step; understanding exactly how configuration flows through Docker and Kubernetes is equally important.</strong></p><h3>🎯 Final Takeaway</h3><p>This project helped me move beyond simply learning Docker and Kubernetes commands and actually understand how the pieces fit together.</p><p>I started with a simple Flask application and ended with a Kubernetes-managed deployment capable of being updated from one application version to another.</p><p>The complete process was:</p><pre># Build<br>docker build -t ruship7800/kucl-demo-app:v1 .</pre><pre># Push<br>docker push ruship7800/kucl-demo-app:v1</pre><pre># Deploy<br>kubectl apply -f deployment.yml</pre><pre># Verify<br>kubectl get pods -o wide</pre><pre># Expose<br>minikube service demo-app-svc --url</pre><pre># Update<br>kubectl set image deployment/demo-app \<br>demo-app=ruship7800/kucl-demo-app:v2</pre><pre># Monitor<br>kubectl rollout status deployment/demo-app</pre><pre># Check history<br>kubectl rollout history deployment/demo-app</pre><p>This gave me practical exposure to <strong>containerization, image registries, Kubernetes Deployments, Pods, Services, Minikube, versioning and rolling updates</strong>.</p><h3>📌 Project Stack</h3><p><strong>Python • Flask • Docker • Docker Hub • Kubernetes • Minikube • kubectl • Linux</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f5fcb3a86a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Dockerized NGINX Monitoring Stack with Prometheus and Grafana]]></title>
            <link>https://medium.com/@ruship7800/building-a-dockerized-nginx-monitoring-stack-with-prometheus-and-grafana-799c0b01c1dd?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/799c0b01c1dd</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[prometheus]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Wed, 09 Sep 2026 13:53:09 GMT</pubDate>
            <atom:updated>2026-09-09T13:53:09.275Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Monitoring is one of the most important parts of a DevOps environment.</p><p>For this project, I built an NGINX monitoring stack using:</p><ul><li>Docker</li><li>NGINX</li><li>NGINX Prometheus Exporter</li><li>Prometheus</li><li>Grafana</li></ul><p>The components communicate through a dedicated Docker network called monitoring. This allows containers to communicate using container names instead of manually configured IP addresses.</p><h3>Architecture</h3><p>The final architecture looks like this:</p><pre>NGINX<br>  │<br>  │ /nginx_status<br>  ▼<br>NGINX Prometheus Exporter<br>  │<br>  │ :9113<br>  ▼<br>Prometheus<br>  │<br>  │ :9090<br>  ▼<br>Grafana<br>  │<br>  │ :3000<br>  ▼<br>Dashboard</pre><p>The intended flow is:</p><p><strong>NGINX → NGINX Exporter → Prometheus → Grafana</strong></p><h3>1. Creating the Docker Network</h3><p>I started by creating a dedicated Docker bridge network:</p><pre>docker network create monitoring</pre><p>Then I verified it:</p><pre>docker network ls</pre><p>The monitoring network provides communication between the Prometheus, NGINX Exporter, and Grafana containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMAp2uWGzbBtiL0BOlJ5Rg.png" /><figcaption><em>Creating the dedicated Docker </em><em>monitoring network for communication between the monitoring containers.</em></figcaption></figure><h3>2. Configuring Prometheus</h3><p>Next, I created a directory for the Prometheus configuration:</p><pre>mkdir -p /opt/prometheus</pre><p>Then I created:</p><pre>/opt/prometheus/prometheus.yml</pre><p>My configuration:</p><pre>global:<br>  scrape_interval: 15s</pre><pre>scrape_configs:<br>  - job_name: &#39;prometheus&#39;<br>    static_configs:<br>      - targets: [&#39;localhost:9090&#39;]</pre><pre>  - job_name: &#39;nginx&#39;<br>    static_configs:<br>      - targets: [&#39;nginx-exporter:9113&#39;]</pre><p>The Prometheus configuration defines a 15-second scrape interval and two targets: Prometheus itself and the NGINX exporter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h_GEc_c4lhQqWMo4B-F80w.png" /><figcaption><em>Configuring Prometheus to scrape itself and the NGINX Prometheus Exporter.</em></figcaption></figure><h3>3. Running Prometheus</h3><p>I then started Prometheus as a Docker container:</p><pre>docker run -d \<br>  --name prometheus \<br>  --network monitoring \<br>  -p 9090:9090 \<br>  -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \<br>  prom/prometheus:latest</pre><p>The container is attached to the monitoring network and exposes Prometheus on port 9090.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4hK4pA-4orNlgx_c2HfRcQ.png" /></figure><h3>4. Running the NGINX Prometheus Exporter</h3><p>The next component was the NGINX Prometheus Exporter.</p><p>I deployed it using:</p><pre>docker run -d \<br>  --name nginx-exporter \<br>  --network monitoring \<br>  -p 9113:9113 \<br>  nginx/nginx-prometheus-exporter:latest \<br>  -nginx.scrape-uri=http://&lt;HOST-IP&gt;:8080/nginx_status</pre><p>The exporter reads NGINX’s status endpoint and exposes metrics that Prometheus can scrape on port 9113.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1EWHi6J1HUQq4g8rf22t_Q.png" /><figcaption><em>Deploying the NGINX Prometheus Exporter on the shared Docker network.</em></figcaption></figure><h3>5. Running Grafana</h3><p>Finally, I deployed Grafana:</p><pre>docker run -d \<br>  --name grafana \<br>  --network monitoring \<br>  -p 3000:3000 \<br>  grafana/grafana:latest</pre><p>Grafana was exposed on port 3000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qnNTONd7mRw4IAOGkRE38w.png" /><figcaption><em>Grafana running successfully on port 3000.</em></figcaption></figure><h3>6. Connecting Grafana to Prometheus</h3><p>Inside Grafana, I configured Prometheus as the data source.</p><p>The important part was using:</p><pre>http://prometheus:9090</pre><p>rather than localhost:9090.</p><p>Because both containers are connected to the same Docker network, Grafana can resolve the Prometheus container using its container name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dG_9nPbG9x0VSTlRY_6Ow.png" /><figcaption><em>Prometheus Server URL<br> </em><a href="http://prometheus:9090/"><em>http://prometheus:9090</em></a></figcaption></figure><h3>7. Testing the Prometheus Connection</h3><p>After configuring the data source, Grafana successfully queried the Prometheus API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GIYnJaIPLUlb7DLEiAB7w.png" /><figcaption><em>Grafana successfully communicating with the Prometheus API</em></figcaption></figure><h3>8. Importing the NGINX Dashboard</h3><p>After connecting Prometheus, I imported an NGINX monitoring dashboard.</p><p>The dashboard used in the project was <strong>Dashboard ID 12708</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsPsIX4m08jaHFtb7QWPGQ.png" /><figcaption><em>Importing an NGINX monitoring dashboard into Grafana.</em></figcaption></figure><h3>9. The Final Dashboard</h3><p>After importing the dashboard, I could see the NGINX monitoring panels in Grafana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sJglYE3f4ayagPFV-eQHjg.png" /><figcaption><em>NGINX Status for nginx-exporter:9113</em></figcaption></figure><h3>10. Troubleshooting</h3><p>This was actually one of the most useful parts of the project.</p><p>Not everything worked on the first attempt.</p><h3>Docker DNS issue</h3><p>Initially, Docker failed to pull the Prometheus image because the server couldn’t resolve Docker Hub.</p><p>The error was:</p><pre>lookup registry-1.docker.io on 127.0.0.53:53:<br>server misbehaving</pre><p>After resolving the DNS problem, the Prometheus image downloaded successfully.</p><h3>Port 9090 conflict</h3><p>The next issue was:</p><pre>failed to bind host port 0.0.0.0:9090:<br>address already in use</pre><p>Instead of immediately changing Prometheus to another port, I investigated the port:</p><pre>sudo ss -ltnp | grep :9090</pre><p>This revealed that systemd was holding the port.</p><p>I then checked the systemd sockets:</p><pre>sudo systemctl list-sockets --all | grep 9090</pre><p>which showed:</p><pre>[::]:9090    cockpit.socket    cockpit.service</pre><p>So the conflict was caused by <strong>Cockpit</strong>, which was already using port 9090.</p><p>This was a good practical lesson: before changing an application’s configuration, identify exactly what is occupying the port.</p><h3>11. NGINX Exporter Troubleshooting</h3><p>At the end of the setup, Grafana was successfully communicating with Prometheus, but the NGINX exporter dashboard showed:</p><p><strong>DOWN</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sJglYE3f4ayagPFV-eQHjg.png" /></figure><blockquote><em>At this stage, the Prometheus and Grafana components were communicating successfully, but the NGINX exporter target was still showing </em><em>DOWN. This became the next troubleshooting step: validating connectivity between the exporter container and the NGINX </em><em>/nginx_status endpoint.</em></blockquote><p>That makes the article more authentic.</p><h3>What I Learned</h3><p>This project gave me hands-on experience with:</p><h3>Docker</h3><ul><li>Docker networks</li><li>Container DNS</li><li>Port mapping</li><li>Container-to-container communication</li><li>Volume mounting</li></ul><h3>Prometheus</h3><ul><li>Prometheus configuration</li><li>Scrape intervals</li><li>Scrape targets</li><li>Exporters</li><li>Prometheus metrics</li></ul><h3>Grafana</h3><ul><li>Data sources</li><li>Dashboard imports</li><li>Prometheus integration</li><li>Monitoring visualization</li></ul><h3>Linux</h3><ul><li>ss</li><li>systemd sockets</li><li>Port troubleshooting</li><li>DNS troubleshooting</li></ul><h3>Final Architecture</h3><pre>┌──────────────┐<br>                    │    NGINX     │<br>                    │    :8080     │<br>                    └──────┬───────┘<br>                           │<br>                     /nginx_status<br>                           │<br>                           ▼<br>                 ┌──────────────────┐<br>                 │  NGINX Exporter  │<br>                 │      :9113       │<br>                 └────────┬─────────┘<br>                          │<br>                          ▼<br>                 ┌──────────────────┐<br>                 │    Prometheus    │<br>                 │      :9090       │<br>                 └────────┬─────────┘<br>                          │<br>                          ▼<br>                 ┌──────────────────┐<br>                 │     Grafana      │<br>                 │      :3000       │<br>                 └──────────────────┘</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6KceAcOqS5q_wZajsseSw.png" /></figure><h3>Conclusion</h3><p>Building this monitoring stack gave me a better understanding of how monitoring components communicate in a containerized environment.</p><p>More importantly, the project wasn’t just about following commands. I had to troubleshoot:</p><ul><li>Docker DNS</li><li>Port conflicts</li><li>systemd/Cockpit</li><li>Docker networking</li><li>Prometheus connectivity</li><li>NGINX exporter availability</li></ul><p>The next step is to resolve the NGINX exporter DOWN state and validate the complete monitoring pipeline:</p><pre>NGINX → Exporter → Prometheus → Grafana</pre><p>This project helped me strengthen my practical understanding of <strong>Docker, Linux, Prometheus, Grafana, networking, and DevOps troubleshooting</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=799c0b01c1dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes StatefulSet: A Hands-On Guide with NGINX]]></title>
            <link>https://medium.com/@ruship7800/kubernetes-statefulset-a-hands-on-guide-with-nginx-5cbf8bef1cdd?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cbf8bef1cdd</guid>
            <category><![CDATA[statefulsets]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Fri, 04 Sep 2026 08:29:23 GMT</pubDate>
            <atom:updated>2026-09-04T08:29:23.469Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started learning Kubernetes, I initially focused on Deployments because they are commonly used for running stateless applications.</p><p>But Kubernetes also provides another workload controller for applications where <strong>Pod identity, networking, and storage matter</strong> — the <strong>StatefulSet</strong>.</p><p>In this hands-on exercise, I created a StatefulSet running <strong>2 NGINX replicas</strong>, connected it to a <strong>Headless Service</strong>, and configured <strong>persistent storage using </strong><strong>volumeClaimTemplates</strong>.</p><p>Here’s what I learned.</p><h3>What is a StatefulSet?</h3><p>A <strong>StatefulSet</strong> is a Kubernetes workload controller designed for applications that need one or more of the following:</p><ul><li>Stable and unique Pod names</li><li>Stable network identities</li><li>Persistent storage</li><li>Ordered Pod creation</li><li>Ordered scaling</li><li>Ordered termination and updates</li></ul><p>For example, instead of Pods having generated names such as:</p><pre>nginx-7d8f9c6b5d-x7k2p<br>nginx-7d8f9c6b5d-m9q4r</pre><p>a StatefulSet creates predictable names:</p><pre>web-0<br>web-1<br>web-2</pre><p>This stable identity is one of the biggest differences between a StatefulSet and a Deployment.</p><h3>My StatefulSet Architecture</h3><p>For this practical exercise, I created three components:</p><pre>Headless Service<br>                       nginx<br>                         |<br>              +----------+----------+<br>              |                     |<br>            web-0                 web-1<br>          NGINX Pod             NGINX Pod<br>              |                     |<br>            PVC                   PVC<br>              |                     |<br>           1Gi Storage          1Gi Storage</pre><p>The main components are:</p><ol><li>A Headless Service called nginx</li><li>A StatefulSet called web</li><li>Two NGINX Pods</li><li>A separate PersistentVolumeClaim for each Pod</li></ol><h3>1. Creating the StatefulSet</h3><p>I created a file called:</p><pre>web.yaml</pre><p>The configuration contains both the Service and StatefulSet.</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: nginx<br>  labels:<br>    app: nginx<br>spec:<br>  ports:<br>    - port: 80<br>      name: web</pre><pre>  clusterIP: None</pre><pre>  selector:<br>    app: nginx</pre><pre>---<br>apiVersion: apps/v1<br>kind: StatefulSet<br>metadata:<br>  name: web</pre><pre>spec:<br>  serviceName: &quot;nginx&quot;</pre><pre>  replicas: 2</pre><pre>  selector:<br>    matchLabels:<br>      app: nginx</pre><pre>  template:<br>    metadata:<br>      labels:<br>        app: nginx</pre><pre>    spec:<br>      containers:<br>        - name: nginx<br>          image: registry.k8s.io/nginx-slim:0.21</pre><pre>          ports:<br>            - containerPort: 80<br>              name: web</pre><pre>          volumeMounts:<br>            - name: www<br>              mountPath: /usr/share/nginx/html</pre><pre>  volumeClaimTemplates:<br>    - metadata:<br>        name: www</pre><pre>      spec:<br>        accessModes:<br>          - &quot;ReadWriteOnce&quot;</pre><pre>        resources:<br>          requests:<br>            storage: 1Gi</pre><h3>Screenshot 1 — StatefulSet YAML</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHl8UUqp-V4A7IXHFyD47Q.png" /></figure><blockquote><strong><em>Caption:</em></strong><em> StatefulSet configuration containing a Headless Service, two replicas, NGINX container, and persistent storage using </em><em>volumeClaimTemplates.</em></blockquote><h3>2. Understanding the Headless Service</h3><p>The first section of my YAML creates a Service:</p><pre>kind: Service<br>metadata:<br>  name: nginx</pre><p>The important configuration is:</p><pre>clusterIP: None</pre><p>This makes the Service a <strong>Headless Service</strong>.</p><p>A normal Kubernetes Service usually gets a ClusterIP that provides a stable virtual IP and load balancing.</p><p>A Headless Service does not provide a virtual ClusterIP.</p><p>Instead, it allows Kubernetes DNS to expose the individual Pods.</p><p>This is particularly useful with StatefulSets because each Pod has its own stable identity.</p><p>For my StatefulSet, the Pods are:</p><pre>web-0<br>web-1</pre><p>and the Service is:</p><pre>nginx</pre><h3>3. Connecting the StatefulSet to the Service</h3><p>Inside the StatefulSet, I used:</p><pre>serviceName: &quot;nginx&quot;</pre><p>This associates the StatefulSet with the nginx Service.</p><p>The Service uses:</p><pre>selector:<br>  app: nginx</pre><p>The Pods created by the StatefulSet have:</p><pre>labels:<br>  app: nginx</pre><p>So Kubernetes can identify which Pods belong to the Service.</p><p>The relationship looks like this:</p><pre>nginx Service<br>     |<br>     | selector: app=nginx<br>     |<br>     +------ web-0<br>     |<br>     +------ web-1</pre><h3>4. Creating Two Replicas</h3><p>I configured:</p><pre>replicas: 2</pre><p>The StatefulSet therefore creates two Pods:</p><pre>web-0<br>web-1</pre><p>Notice the numbering.</p><p>StatefulSet Pods follow an ordinal identity starting from 0.</p><p>If I changed:</p><pre>replicas: 2</pre><p>to:</p><pre>replicas: 3</pre><p>Kubernetes would create:</p><pre>web-0<br>web-1<br>web-2</pre><p>This predictable naming is extremely useful for stateful applications.</p><h3>5. Running the NGINX Container</h3><p>Each Pod runs an NGINX container:</p><pre>containers:<br>  - name: nginx<br>    image: registry.k8s.io/nginx-slim:0.21</pre><p>The container exposes port 80:</p><pre>ports:<br>  - containerPort: 80<br>    name: web</pre><p>I also mounted persistent storage into:</p><pre>/usr/share/nginx/html</pre><p>This is the default HTML directory used by NGINX.</p><h3>6. Persistent Storage with volumeClaimTemplates</h3><p>One of the most important parts of this configuration is:</p><pre>volumeClaimTemplates:<br>  - metadata:<br>      name: www</pre><p>I requested:</p><pre>resources:<br>  requests:<br>    storage: 1Gi</pre><p>The important thing about volumeClaimTemplates is that Kubernetes creates a separate PVC for each StatefulSet Pod.</p><p>Conceptually:</p><pre>web-0<br>  |<br>  +--- www-web-0<br>          |<br>         1Gi</pre><pre>web-1<br>  |<br>  +--- www-web-1<br>          |<br>         1Gi</pre><p>This means the storage is associated with the individual StatefulSet identity.</p><p>That is very different from treating all replicas as completely interchangeable.</p><h3>7. Applying the Configuration</h3><p>Once the YAML file was ready, I applied it using:</p><pre>kubectl apply -f web.yaml</pre><p>Kubernetes returned:</p><pre>service/nginx created<br>statefulset.apps/web created</pre><p>This confirmed that both resources were successfully created.</p><h3>Screenshot 2 — Applying the YAML</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msbnY5oW-NBjFbvv8FWUaQ.png" /></figure><blockquote><strong><em>Caption:</em></strong><em> Creating the Headless Service and StatefulSet using </em><em>kubectl apply.</em></blockquote><h3>8. Watching the Pods Start</h3><p>After creating the StatefulSet, I wanted to see how Kubernetes created the Pods.</p><p>I ran:</p><pre>kubectl get pods --watch</pre><p>Initially, web-0 appeared as:</p><pre>web-0   0/1   Pending</pre><p>Then it moved to:</p><pre>web-0   0/1   ContainerCreating</pre><p>and finally:</p><pre>web-0   1/1   Running</pre><p>After that, Kubernetes started creating web-1.</p><p>Eventually, I saw:</p><pre>web-0   1/1   Running<br>web-1   1/1   Running</pre><h3>Screenshot 3 — StatefulSet Pod Creation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p4BFh_jjzNVigINFWm2Jtw.png" /></figure><blockquote><strong><em>Caption:</em></strong><em> Watching StatefulSet Pods transition from </em><em>Pending to </em><em>ContainerCreating and finally </em><em>Running.</em></blockquote><p>This was one of the most useful parts of the practical because I could actually observe the StatefulSet bringing up the replicas.</p><h3>9. Verifying the Pods</h3><p>After both Pods were running, I checked them with:</p><pre>kubectl get pods</pre><p>The output was:</p><pre>NAME    READY   STATUS    RESTARTS   AGE<br>web-0   1/1     Running   0          31s<br>web-1   1/1     Running   0          20s</pre><h3>Screenshot 4 — Running StatefulSet Pods</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZ5nxJTsCXp3GjinJi5UrQ.png" /></figure><blockquote><strong><em>Caption:</em></strong><em> Both StatefulSet replicas are running successfully with stable names </em><em>web-0 and </em><em>web-1.</em></blockquote><p>The important thing to notice is the Pod naming:</p><pre>web-0<br>web-1</pre><p>These names are predictable and associated with the StatefulSet’s identity.</p><h3>10. Verifying the Service</h3><p>Next, I checked the Service:</p><pre>kubectl get service nginx</pre><p>The result was:</p><pre>NAME    TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)<br>nginx   ClusterIP   None         &lt;none&gt;        80/TCP</pre><h3>Screenshot 5 — Headless Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D13MmFfxRNBI42XeXK4MGw.png" /></figure><blockquote><strong><em>Caption:</em></strong><em> The </em><em>nginx Service has </em><em>CLUSTER-IP: None, confirming that it is a Headless Service.</em></blockquote><p>The None value is the important part here.</p><p>It indicates that Kubernetes is not assigning the Service a normal virtual ClusterIP.</p><h3>11. Verifying the StatefulSet</h3><p>Finally, I checked the StatefulSet:</p><pre>kubectl get statefulsets.apps web</pre><p>The result showed:</p><pre>NAME   READY   AGE<br>web    2/2     ...</pre><h3>Screenshot 6 — StatefulSet Status</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bc3lSwrqd4lAI0Q7PFKmKw.png" /></figure><blockquote><strong><em>Caption:</em></strong><em> The StatefulSet reports </em><em>2/2 ready replicas, confirming that both Pods are successfully running.</em></blockquote><p>The 2/2 means:</p><pre>Desired replicas = 2<br>Ready replicas   = 2</pre><p>So the StatefulSet is healthy.</p><h3>StatefulSet vs Deployment</h3><p>A common question is:</p><blockquote><em>Why not just use a Deployment?</em></blockquote><p>The main difference is how Kubernetes treats the Pods.</p><p>FeatureDeploymentStatefulSetPod identityGenerally interchangeableStablePod namesGenerated namesPredictable namesExampleapp-7d8f...web-0, web-1Stable network identityNot per-Pod by defaultSupportedPersistent storage identityNot inherently tied to Pod identitySupportedOrdered creationNot the main purposeSupportedOrdered scalingNot the main purposeSupportedTypical useStateless applicationsStateful applications</p><h3>What Happens If a StatefulSet Pod Is Deleted?</h3><p>This is an interesting experiment to try next.</p><p>Suppose I delete:</p><pre>kubectl delete pod web-0</pre><p>The StatefulSet controller will recreate the Pod.</p><p>The important part is that the replacement will still be:</p><pre>web-0</pre><p>rather than getting a completely new random identity.</p><p>This is one of the key concepts behind StatefulSets.</p><p>The identity belongs to the StatefulSet ordinal, not simply to the current Pod instance.</p><h3>Common Use Cases for StatefulSets</h3><p>StatefulSets are commonly useful for applications where individual instances need stable identity or persistent storage.</p><p>Examples include:</p><h3>Databases</h3><pre>PostgreSQL<br>MySQL<br>MongoDB</pre><h3>Distributed systems</h3><pre>Kafka<br>ZooKeeper<br>Elasticsearch</pre><h3>Other stateful applications</h3><p>Applications that require:</p><ul><li>Persistent data</li><li>Stable hostnames</li><li>Individual node identity</li><li>Ordered startup</li><li>Ordered shutdown</li></ul><p>can potentially benefit from StatefulSets.</p><h3>An Important Lesson</h3><p>One thing I learned from this practical is that:</p><blockquote><strong><em>StatefulSet does not simply mean “a Deployment with storage.”</em></strong></blockquote><p>A StatefulSet provides a combination of:</p><pre>Stable Identity<br>      +<br>Stable Network Identity<br>      +<br>Persistent Storage<br>      +<br>Ordered Operations</pre><p>That makes it fundamentally different from a standard Deployment.</p><h3>My Hands-On Kubernetes Workflow</h3><p>The complete workflow I followed was:</p><pre>Create web.yaml<br>      ↓<br>kubectl apply -f web.yaml<br>      ↓<br>Service created<br>      ↓<br>StatefulSet created<br>      ↓<br>web-0 created<br>      ↓<br>web-0 Running<br>      ↓<br>web-1 created<br>      ↓<br>web-1 Running<br>      ↓<br>Verify Pods<br>      ↓<br>Verify Service<br>      ↓<br>Verify StatefulSet</pre><p>The commands I used were:</p><pre>kubectl apply -f web.yaml</pre><pre>kubectl get pods --watch</pre><pre>kubectl get pods</pre><pre>kubectl get service nginx</pre><pre>kubectl get statefulsets.apps web</pre><h3>Final Takeaway</h3><p>This hands-on exercise helped me understand StatefulSets much better than simply reading about them.</p><p>I created:</p><pre>1 StatefulSet<br>2 NGINX Pods<br>1 Headless Service<br>2 Persistent Storage Claims</pre><p>The final architecture was:</p><pre>nginx<br>              Headless Service<br>                     |<br>             +-------+-------+<br>             |               |<br>           web-0           web-1<br>             |               |<br>           PVC             PVC<br>           1Gi             1Gi</pre><p>The most important things I took away are:</p><p><strong>StatefulSet → stable identity</strong></p><p><strong>Headless Service → stable network discovery</strong></p><p><strong>volumeClaimTemplates → persistent storage per replica</strong></p><p><strong>Ordinal Pod names → </strong><strong>web-0, </strong><strong>web-1, </strong><strong>web-2</strong></p><p>If an application needs Pods to be <strong>interchangeable</strong>, a Deployment is usually the better fit.</p><p>If each Pod needs its own <strong>identity, storage, or ordered lifecycle</strong>, StatefulSet becomes a much better choice.</p><h3>What I Would Try Next</h3><p>My next experiment would be to delete web-0 and observe:</p><pre>kubectl delete pod web-0</pre><p>Then:</p><pre>kubectl get pods --watch</pre><p>and verify that Kubernetes recreates:</p><pre>web-0</pre><p>This would demonstrate one of the most important StatefulSet concepts in practice: <strong>stable Pod identity even when the Pod itself is recreated.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cbf8bef1cdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes DaemonSets: What They Are, How They Work, and a Practical Example]]></title>
            <link>https://medium.com/@ruship7800/kubernetes-daemonsets-what-they-are-how-they-work-and-a-practical-example-e0a9cc51ce77?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0a9cc51ce77</guid>
            <category><![CDATA[kubernetes-daemonset]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 09:46:44 GMT</pubDate>
            <atom:updated>2026-09-02T09:46:44.551Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re learning Kubernetes, you’ve probably worked with Deployments and Pods. But what happens when you need to run a particular Pod on every node in your cluster?</p><p>That’s where a Kubernetes DaemonSet comes in.</p><p>In this blog, I’ll explain what a DaemonSet is, how it works, when to use it, and how I created and verified a DaemonSet for Fluentd in a Kubernetes cluster.</p><h3>What is a DaemonSet?</h3><p>A DaemonSet is a Kubernetes workload resource that ensures a copy of a specific Pod runs on each node that matches the DaemonSet’s scheduling rules.</p><p>In simple terms:</p><blockquote><em>One matching node → One DaemonSet Pod</em></blockquote><p>For example, if your Kubernetes cluster has:</p><pre>Node 1 → Fluentd Pod<br>Node 2 → Fluentd Pod<br>Node 3 → Fluentd Pod</pre><p>When a new node joins the cluster:</p><pre>New Node 4<br>     ↓<br>DaemonSet detects the node<br>     ↓<br>Fluentd Pod is created on Node 4</pre><p>Similarly, if a node is removed, the corresponding DaemonSet Pod is no longer required.</p><p>This makes DaemonSets particularly useful for node-level services.</p><h3>Why do we need DaemonSets?</h3><p>There are many situations where you want the same service running on every node.</p><p>Common examples include:</p><ul><li>Log collection agents</li><li>Monitoring agents</li><li>Node-level security agents</li><li>Storage-related agents</li><li>Network plugins</li><li>System-level utilities</li></ul><p>A classic example is log collection.</p><p>Imagine every application Pod on your cluster generates logs on the node:</p><pre>Kubernetes Cluster<br>                       |<br>        +--------------+--------------+<br>        |              |              |<br>      Node 1         Node 2         Node 3<br>        |              |              |<br>    App Logs        App Logs        App Logs<br>        |              |              |<br>    Fluentd         Fluentd         Fluentd<br>        |              |              |<br>        +--------------+--------------+<br>                       |<br>                  Elasticsearch</pre><p>Instead of manually creating a Fluentd Pod on every node, a DaemonSet automatically handles this for you.</p><h3>My Practical DaemonSet Example</h3><p>I created a DaemonSet named:</p><pre>fluentd-elasticsearch</pre><p>inside the kube-system namespace.</p><p>The first step was creating the Kubernetes YAML configuration and applying it with:</p><pre>kubectl apply -f daemonset.yaml</pre><p>The result confirmed that the DaemonSet was successfully created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVZ75JZ7u0jUR-sKOikgTA.png" /></figure><p><em>Figure 1: Creating the Fluentd Elasticsearch DaemonSet using kubectl.</em></p><h3>Checking the DaemonSet</h3><p>After creating the DaemonSet, I verified its status using:</p><pre>kubectl get daemonsets.apps -n kube-system</pre><p>The output showed:</p><pre>NAME                    DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE<br>cilium                  1         1         1       1            1<br>cilium-envoy            1         1         1       1            1<br>fluentd-elasticsearch   1         1         1       1            1</pre><p>The important part here is:</p><pre>DESIRED   CURRENT   READY   AVAILABLE<br>1         1         1       1</pre><p>This tells us that Kubernetes wanted one Fluentd Pod, one was created, and that Pod was ready and available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ceDTTB6N59sDgIWs_yb6Q.png" /></figure><p><em>Figure 2: Verifying the DaemonSet and its desired, current, ready, and available Pod counts.</em></p><h3>Checking the DaemonSet Pod</h3><p>Next, I checked the Pods running in the kube-system namespace:</p><pre>kubectl get pods -n kube-system</pre><p>Among the Pods, we can see:</p><pre>fluentd-elasticsearch-gcg18</pre><p>with the status:</p><pre>1/1   Running</pre><p>This confirms that the Pod created by the DaemonSet is running successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ceDTTB6N59sDgIWs_yb6Q.png" /></figure><p><em>Figure 3: The Fluentd DaemonSet Pod is running successfully.</em></p><h3>Understanding the DaemonSet YAML</h3><p>Here’s the important structure of the YAML I used:</p><pre>apiVersion: apps/v1<br>kind: DaemonSet</pre><pre>metadata:<br>  name: fluentd-elasticsearch<br>  namespace: kube-system</pre><pre>spec:<br>  selector:<br>    matchLabels:<br>      name: fluentd-elasticsearch</pre><pre>  template:<br>    metadata:<br>      labels:<br>        name: fluentd-elasticsearch</pre><pre>    spec:<br>      containers:<br>        - name: fluentd-elasticsearch<br>          image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1</pre><p>Let’s break this down.</p><h3>1. apiVersion</h3><pre>apiVersion: apps/v1</pre><p>This tells Kubernetes which API version should be used for the DaemonSet resource.</p><h3>2. kind</h3><pre>kind: DaemonSet</pre><p>This tells Kubernetes that we want to create a DaemonSet.</p><p>For comparison:</p><pre>kind: Pod</pre><p>creates a Pod, while:</p><pre>kind: Deployment</pre><p>creates a Deployment.</p><p>Here we’re explicitly asking Kubernetes to manage Pods according to DaemonSet behavior.</p><h3>3. metadata</h3><pre>metadata:<br>  name: fluentd-elasticsearch<br>  namespace: kube-system</pre><p>The DaemonSet is named:</p><pre>fluentd-elasticsearch</pre><p>and is deployed into:</p><pre>kube-system</pre><p>The kube-system namespace is commonly used for Kubernetes system components.</p><h3>The Selector</h3><p>One of the most important parts is:</p><pre>selector:<br>  matchLabels:<br>    name: fluentd-elasticsearch</pre><p>The selector tells the DaemonSet which Pods belong to it.</p><p>The labels in the Pod template must match the selector:</p><pre>template:<br>  metadata:<br>    labels:<br>      name: fluentd-elasticsearch</pre><p>So Kubernetes essentially establishes this relationship:</p><pre>DaemonSet<br>    |<br>    | selector<br>    ↓<br>name: fluentd-elasticsearch<br>    |<br>    ↓<br>Matching Pods</pre><p>Keeping the selector and Pod labels consistent is extremely important.</p><h3>Running Fluentd</h3><p>The container configuration specifies:</p><pre>containers:<br>  - name: fluentd-elasticsearch<br>    image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1</pre><p>This tells Kubernetes to run the Fluentd Elasticsearch container image.</p><p>Fluentd can be used as a log collector, making it a natural example for a DaemonSet.</p><h3>Mounting Node Logs</h3><p>Another important part of the configuration is the volume:</p><pre>volumeMounts:<br>  - name: varlog<br>    mountPath: /var/log</pre><p>The DaemonSet also defines a host path:</p><pre>volumes:<br>  - name: varlog<br>    hostPath:</pre><p>The idea is to make the node’s log directory available to the Fluentd container.</p><p>This allows the logging agent to access logs generated on the node where the Pod is running.</p><p>The architecture looks roughly like this:</p><pre>Kubernetes Node<br>│<br>├── /var/log<br>│     │<br>│     └──── Host logs<br>│<br>└── Fluentd Pod<br>       │<br>       └── /var/log</pre><p>This is a common pattern for node-level logging agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2hy3ObM0QJWfV0kHqiJfg.png" /></figure><p><em>Figure 4: DaemonSet YAML defining the Fluentd container, resources, tolerations, and host log volume.</em></p><h3>An Important Part: Tolerations</h3><p>My YAML also contains:</p><pre>tolerations:<br>  - key: node-role.kubernetes.io/control-plane<br>    operator: Exists<br>    effect: NoSchedule</pre><pre>  - key: node-role.kubernetes.io/master<br>    operator: Exists<br>    effect: NoSchedule</pre><p>These tolerations are important because control-plane nodes are commonly configured with taints that prevent ordinary workloads from being scheduled there.</p><p>Without the appropriate toleration, the DaemonSet may not run on those nodes.</p><p>The configuration is effectively saying</p><blockquote><em>This DaemonSet is allowed to run on nodes that have these taints.</em></blockquote><p>This is particularly useful for infrastructure-level agents such as logging and monitoring agents.</p><h3>Resource Requests and Limits</h3><p>The container also specifies resource requirements:</p><pre>resources:<br>  limits:<br>    memory: 200Mi</pre><pre>  requests:<br>    cpu: 100m<br>    memory: 200Mi</pre><p>The request tells Kubernetes how much resource the container requires for scheduling.</p><p>For example:</p><pre>CPU request:    100m<br>Memory request: 200Mi</pre><p>The memory limit specifies the maximum memory the container is allowed to consume:</p><pre>Memory limit: 200Mi</pre><p>Setting resource requests and limits helps Kubernetes make better scheduling decisions and prevents workloads from consuming unlimited resources.</p><h3>DaemonSet vs Deployment</h3><p>A common interview question is:</p><h3>What’s the difference between a Deployment and a DaemonSet?</h3><p>DeploymentDaemonSetRuns a specified number of replicasRuns a Pod on matching nodesReplica count is explicitly configuredPod placement is based on nodesGood for application workloadsGood for node-level workloadsPods can be distributed across nodesDesigned for node coverageExample: Web applicationExample: Fluentd agent</p><p>For example, a Deployment might run:</p><pre>replicas: 3</pre><p>giving you:</p><pre>Pod<br>Pod<br>Pod</pre><p>A DaemonSet instead focuses on node coverage:</p><pre>Node 1 → Pod<br>Node 2 → Pod<br>Node 3 → Pod</pre><h3>What Happens When a New Node Joins?</h3><p>This is one of the biggest advantages of a DaemonSet.</p><p>Suppose your cluster currently has:</p><pre>Node 1 → Fluentd<br>Node 2 → Fluentd</pre><p>Then a new node joins:</p><pre>Node 3</pre><p>The DaemonSet controller detects that Node 3 matches its scheduling criteria and automatically creates:</p><pre>Node 3 → Fluentd</pre><p>You don’t need to manually create another Pod.</p><h3>What Happens When a Node Is Removed?</h3><p>The opposite happens when a node leaves the cluster.</p><p>For example:</p><pre>Before:</pre><pre>Node 1 → Fluentd<br>Node 2 → Fluentd<br>Node 3 → Fluentd</pre><p>If Node 3 is removed:</p><pre>Node 1 → Fluentd<br>Node 2 → Fluentd</pre><p>The DaemonSet automatically adjusts to the current set of eligible nodes.</p><h3>Useful Commands for DaemonSets</h3><p>Here are some commands I use when working with DaemonSets.</p><h3>Create or update a DaemonSet</h3><pre>kubectl apply -f daemonset.yaml</pre><h3>List DaemonSets</h3><pre>kubectl get daemonsets</pre><p>or:</p><pre>kubectl get ds</pre><h3>Check DaemonSets in a namespace</h3><pre>kubectl get daemonsets -n kube-system</pre><h3>Get Pods created by the DaemonSet</h3><pre>kubectl get pods -n kube-system</pre><h3>Get detailed information</h3><pre>kubectl describe daemonset fluentd-elasticsearch -n kube-system</pre><h3>Check the YAML stored in the cluster</h3><pre>kubectl get daemonset fluentd-elasticsearch -n kube-system -o yaml</pre><h3>How I Verify a DaemonSet</h3><p>My basic troubleshooting workflow is:</p><pre>Create YAML<br>    ↓<br>kubectl apply<br>    ↓<br>Check DaemonSet<br>    ↓<br>kubectl get ds<br>    ↓<br>Check Pods<br>    ↓<br>kubectl get pods<br>    ↓<br>Check Pod status<br>    ↓<br>Running / Ready</pre><p>If something isn’t working, I would then use:</p><pre>kubectl describe daemonset &lt;name&gt; -n &lt;namespace&gt;</pre><p>and:</p><pre>kubectl describe pod &lt;pod-name&gt; -n &lt;namespace&gt;</pre><p>For container-level issues, I would also check:</p><pre>kubectl logs &lt;pod-name&gt; -n &lt;namespace&gt;</pre><h3>Key Takeaways</h3><p>A DaemonSet is one of the most useful Kubernetes resources for infrastructure and node-level workloads.</p><p>The key points to remember are:</p><ol><li>A DaemonSet ensures Pods run on matching nodes.</li><li>It is commonly used for logging and monitoring agents.</li><li>New eligible nodes automatically receive the DaemonSet Pod.</li><li>Removed nodes no longer require the Pod.</li><li>Node selectors, labels, and tolerations control where the Pods run.</li><li>Resource requests and limits help control resource consumption.</li><li>kubectl get daemonsets is useful for checking DaemonSet status.</li><li>kubectl get pods helps verify that the Pods are actually running.</li></ol><p>In my example, I used a Fluentd Elasticsearch DaemonSet to demonstrate this behavior. After applying the YAML, Kubernetes successfully created the fluentd-elasticsearch DaemonSet, and the resulting Pod was shown as Running and Ready.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0a9cc51ce77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes ReplicaSet: A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/@ruship7800/kubernetes-replicaset-a-beginner-friendly-guide-2f1c4999433f?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f1c4999433f</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-replicaset]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 11:50:09 GMT</pubDate>
            <atom:updated>2026-09-01T11:50:09.675Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O-YwyYRsEHLA7JHhtFSD5g.png" /></figure><p>Kubernetes is designed to run applications reliably, even when containers fail. One of the Kubernetes objects that helps achieve this reliability is the <strong>ReplicaSet</strong>.</p><p>A ReplicaSet ensures that a specified number of identical Pods are running at any given time. If a Pod fails or gets deleted, the ReplicaSet automatically creates a replacement.</p><p>In this blog, we will understand what a ReplicaSet is, why it is used, how it works, and how to create and manage one using kubectl.</p><h3>What is a ReplicaSet?</h3><p>A <strong>ReplicaSet</strong> is a Kubernetes controller that maintains a stable set of replica Pods running at any given time.</p><p>For example, suppose your application requires three Pods to be running:</p><pre>ReplicaSet<br>    |<br>    +--- Pod 1<br>    +--- Pod 2<br>    +--- Pod 3</pre><p>If Pod 2 crashes or is deleted:</p><pre>ReplicaSet<br>    |<br>    +--- Pod 1<br>    +--- Pod 3<br>    +--- New Pod</pre><p>The ReplicaSet notices that only two Pods are running and creates another Pod to bring the total back to three.</p><p>This is one of the ways Kubernetes provides <strong>self-healing</strong> for applications.</p><h3>Why Do We Need a ReplicaSet?</h3><p>Running a single Pod has a major problem: if that Pod fails, the application becomes unavailable.</p><p>For example:</p><pre>User<br>  |<br>  v<br>Application Pod</pre><p>If the Pod goes down:</p><pre>User<br>  |<br>  X<br>Pod unavailable</pre><p>With a ReplicaSet, we can run multiple copies:</p><pre>+--- Pod 1<br>             |<br>Users ------ +--- Pod 2<br>             |<br>             +--- Pod 3</pre><p>If one Pod fails, the ReplicaSet creates a replacement.</p><p>This provides:</p><ul><li><strong>High availability</strong></li><li><strong>Self-healing</strong></li><li><strong>Multiple replicas of an application</strong></li><li><strong>Better reliability</strong></li></ul><h3>How Does a ReplicaSet Work?</h3><p>A ReplicaSet primarily uses two important things:</p><h3>1. Replica count</h3><p>The replicas field specifies how many Pods should be running.</p><p>For example:</p><pre>replicas: 3</pre><p>This tells Kubernetes:</p><blockquote><em>“I want three Pods matching this ReplicaSet.”</em></blockquote><h3>2. Selector</h3><p>The ReplicaSet uses a <strong>selector</strong> to identify which Pods belong to it.</p><p>For example:</p><pre>selector:<br>  matchLabels:<br>    app: nginx</pre><p>The ReplicaSet looks for Pods with the matching label.</p><h3>Creating a ReplicaSet</h3><p>Let’s create a simple ReplicaSet that runs three NGINX Pods.</p><p>Create a file called:</p><pre>nginx-replicaset.yaml</pre><p>Add the following configuration:</p><pre>apiVersion: apps/v1<br>kind: ReplicaSet</pre><pre>metadata:<br>  name: nginx-replicaset</pre><pre>spec:<br>  replicas: 3</pre><pre>  selector:<br>    matchLabels:<br>      app: nginx</pre><pre>  template:<br>    metadata:<br>      labels:<br>        app: nginx</pre><pre>    spec:<br>      containers:<br>        - name: nginx<br>          image: nginx:latest</pre><p>Let’s understand this configuration.</p><h3>Understanding the YAML</h3><h3>apiVersion</h3><pre>apiVersion: apps/v1</pre><p>This specifies the Kubernetes API version used for the ReplicaSet.</p><h3>kind</h3><pre>kind: ReplicaSet</pre><p>This tells Kubernetes that we want to create a ReplicaSet.</p><h3>metadata</h3><pre>metadata:<br>  name: nginx-replicaset</pre><p>This gives our ReplicaSet a name.</p><h3>replicas</h3><pre>replicas: 3</pre><p>This tells Kubernetes to maintain three Pods.</p><h3>selector</h3><pre>selector:<br>  matchLabels:<br>    app: nginx</pre><p>The selector tells the ReplicaSet which Pods it should manage.</p><h3>Pod template</h3><pre>template:<br>  metadata:<br>    labels:<br>      app: nginx</pre><p>The labels here must match the selector.</p><p>The ReplicaSet will use this template whenever it needs to create a new Pod.</p><h3>Creating the ReplicaSet</h3><p>Apply the configuration using:</p><pre>kubectl apply -f nginx-replicaset.yaml</pre><p>You should see something similar to:</p><pre>replicaset.apps/nginx-replicaset created</pre><p>Now check the ReplicaSet:</p><pre>kubectl get replicaset</pre><p>You may see:</p><pre>NAME               DESIRED   CURRENT   READY   AGE<br>nginx-replicaset   3         3         3       20s</pre><p>This means Kubernetes successfully created three replicas.</p><h3>Checking the Pods</h3><p>Run:</p><pre>kubectl get pods</pre><p>You should see something similar to:</p><pre>NAME                     READY   STATUS    AGE<br>nginx-replicaset-abc12   1/1     Running   30s<br>nginx-replicaset-def34   1/1     Running   30s<br>nginx-replicaset-ghi56   1/1     Running   30s</pre><p>Notice that Kubernetes automatically generated unique names for the Pods.</p><h3>Testing Self-Healing</h3><p>One of the most useful features of a ReplicaSet is its ability to replace failed or deleted Pods.</p><p>Let’s delete one of the Pods:</p><pre>kubectl delete pod nginx-replicaset-abc12</pre><p>Now immediately check the Pods:</p><pre>kubectl get pods</pre><p>You will notice that Kubernetes creates a new Pod.</p><p>For example:</p><pre>NAME                     READY   STATUS    AGE<br>nginx-replicaset-def34   1/1     Running   2m<br>nginx-replicaset-ghi56   1/1     Running   2m<br>nginx-replicaset-jkl78   1/1     Running   5s</pre><p>The ReplicaSet detected that the number of Pods dropped from three to two.</p><p>It then created a replacement.</p><p>This is the <strong>self-healing behavior</strong> of Kubernetes.</p><h3>Scaling a ReplicaSet</h3><p>We can also change the number of replicas.</p><p>Suppose we want five Pods instead of three.</p><p>Run:</p><pre>kubectl scale replicaset nginx-replicaset --replicas=5</pre><p>Now check:</p><pre>kubectl get pods</pre><p>There should now be five Pods.</p><p>You can also verify the ReplicaSet:</p><pre>kubectl get rs</pre><p>Example:</p><pre>NAME               DESIRED   CURRENT   READY<br>nginx-replicaset   5         5         5</pre><h3>Scaling Down</h3><p>If we want to reduce the number of Pods to two:</p><pre>kubectl scale replicaset nginx-replicaset --replicas=2</pre><p>Kubernetes will terminate the extra Pods until only two remain.</p><h3>ReplicaSet vs Pod</h3><p>A Pod represents the actual running workload, while a ReplicaSet manages the desired number of matching Pods.</p><p>PodReplicaSetRuns containersManages PodsRepresents one instanceMaintains multiple instancesDoes not maintain replicas itselfMaintains desired replica countCan disappear if it failsCreates replacement Pods</p><p>A useful way to remember this is:</p><p><strong>Pod = Application instance</strong></p><p><strong>ReplicaSet = Pod manager</strong></p><h3>ReplicaSet vs Deployment</h3><p>This is an important Kubernetes interview question.</p><p>A ReplicaSet maintains the desired number of Pods, but a <strong>Deployment</strong> provides higher-level management of those Pods and ReplicaSets.</p><p>The relationship generally looks like:</p><pre>Deployment<br>     |<br>     v<br>ReplicaSet<br>     |<br>     +--- Pod<br>     +--- Pod<br>     +--- Pod</pre><p>When you create a Deployment, Kubernetes typically creates and manages a ReplicaSet for you.</p><p>For example:</p><pre>apiVersion: apps/v1<br>kind: Deployment</pre><pre>metadata:<br>  name: nginx</pre><pre>spec:<br>  replicas: 3</pre><pre>  selector:<br>    matchLabels:<br>      app: nginx</pre><pre>  template:<br>    metadata:<br>      labels:<br>        app: nginx</pre><pre>    spec:<br>      containers:<br>        - name: nginx<br>          image: nginx:latest</pre><p>Instead of manually creating a ReplicaSet, you would normally use a Deployment for application workloads.</p><p>A Deployment can provide features such as:</p><ul><li>Rolling updates</li><li>Rollbacks</li><li>Version management</li><li>Replica management</li></ul><p>Therefore, <strong>you generally create Deployments rather than ReplicaSets directly for most application deployments.</strong></p><h3>Useful ReplicaSet Commands</h3><p>Here are some commands worth remembering:</p><h3>List ReplicaSets</h3><pre>kubectl get rs</pre><h3>Get detailed information</h3><pre>kubectl describe rs nginx-replicaset</pre><h3>View ReplicaSet YAML</h3><pre>kubectl get rs nginx-replicaset -o yaml</pre><h3>Scale ReplicaSet</h3><pre>kubectl scale rs nginx-replicaset --replicas=5</pre><h3>Delete ReplicaSet</h3><pre>kubectl delete rs nginx-replicaset</pre><h3>Important Interview Questions</h3><p>If you’re preparing for a Kubernetes or DevOps interview, make sure you can answer these questions.</p><h3>1. What is a ReplicaSet?</h3><p>A ReplicaSet is a Kubernetes controller that maintains a specified number of identical Pods.</p><h3>2. What happens if a Pod managed by a ReplicaSet is deleted?</h3><p>The ReplicaSet detects that the desired number of Pods is no longer available and creates a replacement Pod.</p><h3>3. How does a ReplicaSet identify the Pods it manages?</h3><p>It uses <strong>label selectors</strong>.</p><h3>4. What is the difference between a ReplicaSet and a Pod?</h3><p>A Pod runs the application container, while a ReplicaSet ensures that the desired number of matching Pods are running.</p><h3>5. ReplicaSet vs Deployment?</h3><p>A ReplicaSet maintains Pods, while a Deployment manages ReplicaSets and provides additional capabilities such as rolling updates and rollbacks.</p><h3>6. Should we normally create ReplicaSets manually?</h3><p>Usually, no. For application deployments, a Deployment is generally preferred because it manages ReplicaSets for you.</p><h3>Final Takeaway</h3><p>A ReplicaSet is an important Kubernetes concept because it provides <strong>replica management and self-healing</strong>.</p><p>The basic idea is simple:</p><pre>Desired State<br>     |<br>     v<br>ReplicaSet<br>     |<br>     v<br>&quot;Keep 3 Pods running&quot;<br>     |<br>     +--- Pod 1<br>     +--- Pod 2<br>     +--- Pod 3</pre><p>If one Pod disappears:</p><pre>Pod 1<br>Pod 2<br>Pod 3  ---&gt; deleted</pre><pre>ReplicaSet detects the difference</pre><pre>Pod 1<br>Pod 2<br>New Pod</pre><p>The key thing to remember is:</p><blockquote><strong><em>A ReplicaSet continuously works to make the actual number of matching Pods equal to the desired number.</em></strong></blockquote><p>And in real-world Kubernetes deployments, you will most often interact with ReplicaSets <strong>indirectly through Deployments</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f1c4999433f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps Kubernetes Infrastructure with RKE2 on GCP]]></title>
            <link>https://medium.com/@ruship7800/devops-kubernetes-infrastructure-with-rke2-on-gcp-2aee098ffe74?source=rss-8c8bbaf7458d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2aee098ffe74</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Rushi]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 08:18:12 GMT</pubDate>
            <atom:updated>2026-01-27T08:18:12.734Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes is widely used in modern cloud and DevOps environments. While managed Kubernetes services are popular, many organizations still prefer <strong>self-managed clusters</strong> for better control and security.<br> In this article, I’ll share my experience setting up an <strong>RKE2 Kubernetes cluster on Google Cloud Platform (GCP)</strong>.</p><h3>Why RKE2?</h3><p>RKE2 (Rancher Kubernetes Engine 2) is a <strong>secure and enterprise-ready Kubernetes distribution</strong>.<br> It is designed for production use and follows strong security practices by default.</p><p>Using RKE2 helped me understand how real companies deploy Kubernetes clusters outside managed services.</p><h3>Why Google Cloud Platform?</h3><p>Google Cloud Platform provides reliable virtual machines and networking features.<br> By using GCP, I gained hands-on experience with:</p><ul><li>Creating VM instances</li><li>Configuring firewall rules</li><li>Managing secure SSH access</li><li>Running Kubernetes in a cloud environment</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1fj8F7UDM2c_biyRgMi4w.png" /></figure><h3>Project Overview</h3><p>In this project, I deployed a <strong>self-managed Kubernetes cluster</strong> using RKE2 on GCP virtual machines.</p><h3>What I implemented:</h3><ul><li>Created Linux VM instances on GCP</li><li>Set up control plane and worker nodes</li><li>Installed and configured RKE2</li><li>Verified cluster health and node status</li><li>Tested Kubernetes workloads</li></ul><p>This setup closely matches <strong>real-world production environments</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KW-BorWzqr5YQRsiEPz0lg.png" /></figure><h3>What I Learned from This Project</h3><h3>Kubernetes Internals</h3><p>I learned how Kubernetes works internally, including:</p><ul><li>Control plane responsibilities</li><li>Worker node communication</li><li>Cluster initialization process</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prPY086JvbY1IGa3OTiM5g.png" /></figure><h3>Linux &amp; System Administration</h3><p>This project improved my Linux skills such as:</p><ul><li>Managing systemd services</li><li>File permissions and networking</li><li>Troubleshooting cluster issues</li></ul><h3>Cloud &amp; DevOps Skills</h3><p>I gained practical experience in:</p><ul><li>Cloud infrastructure management</li><li>Secure cluster deployment</li><li>DevOps-style problem solving</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gqx_pvXHmEr97wPA53Rv8w.png" /></figure><h3>Conclusion</h3><p>Setting up an <strong>RKE2 Kubernetes cluster on GCP</strong> was a valuable learning experience.<br> It strengthened my understanding of Kubernetes, cloud infrastructure, and real-world DevOps practices.</p><p>This project is a big step forward in my journey toward a <strong>Cloud / DevOps Engineer role</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2aee098ffe74" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>