<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Noushad Hasan</title>
    <description>The latest articles on DEV Community by Noushad Hasan (@noushad_hasan_4be85cd12d6).</description>
    <link>https://dev.to/noushad_hasan_4be85cd12d6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3205018%2F72aa3de7-6a05-412c-a350-711af0ba4221.jpg</url>
      <title>DEV Community: Noushad Hasan</title>
      <link>https://dev.to/noushad_hasan_4be85cd12d6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/noushad_hasan_4be85cd12d6"/>
    <language>en</language>
    <item>
      <title>Kubernetes Gateway API</title>
      <dc:creator>Noushad Hasan</dc:creator>
      <pubDate>Tue, 16 Sep 2025 06:14:01 +0000</pubDate>
      <link>https://dev.to/noushad_hasan_4be85cd12d6/kubernetes-gateway-api-h1a</link>
      <guid>https://dev.to/noushad_hasan_4be85cd12d6/kubernetes-gateway-api-h1a</guid>
      <description>&lt;h2&gt;
  
  
  Gateway API in Kubernetes: The Next Evolution in Traffic Management
&lt;/h2&gt;

&lt;p&gt;Kubernetes has become the de facto platform for running containerized applications at scale. But running apps in Kubernetes isn’t just about deploying Pods — it’s about getting external traffic in. For years, the go-to way of doing that was with the Ingress API.&lt;br&gt;
Ingress is the traffic routing mechanism primarily used in the Kubernetes environments. However it comes with several limitations. One such example is, it supports only Layer 7 HTTP based traffic. So,to overcome all the Ingress limitations, the Kubernetes Gateway API was development.&lt;/p&gt;

&lt;p&gt;Gateway API, a more powerful and flexible evolution of Ingress. Think of it like moving from an old Nokia phone to a modern smartphone — both make calls, but one unlocks a whole new set of possibilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Gateway API has the following key features-&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Protocol Agnosticism:&lt;/strong&gt; &lt;br&gt;
It provides a unified API for managing different layers of network   traffic, from simple L4 TCP/UDP connections to complex L7 application-aware routing based on HTTP and gRPC protocols.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6aauqjaeu7823aj44f5z.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6aauqjaeu7823aj44f5z.webp" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advanced Request Matching:&lt;/strong&gt; &lt;br&gt;
It enables sophisticated traffic control by allowing routing decisions &lt;br&gt;
to be based on HTTP request attributes, such as path, header values, and &lt;br&gt;
query parameters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-Team Routing:&lt;/strong&gt; &lt;br&gt;
It safely allows traffic from a public entry point to be routed to &lt;br&gt;
applications managed by different teams in different namespaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Portability &amp;amp; Standardization:&lt;/strong&gt; &lt;br&gt;
It reduces lock-in by offering a common, vendor-neutral specification &lt;br&gt;
for ingress configuration, minimizing the reliance on implementation-&lt;br&gt;
specific annotations and making manifests portable across different &lt;br&gt;
Kubernetes environments and ingress controllers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistent API for Mesh &amp;amp; Ingress:&lt;/strong&gt; &lt;br&gt;
It extends the same routing principles and API objects beyond the &lt;br&gt;
cluster edge into the service mesh, providing a consistent operational    experience for both north-south (ingress) and east-west (mesh) traffic &lt;br&gt;
when integrated with providers like Istio and Linkerd.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, the Gateway API is an improved version of Kubernetes Ingress that offers more powerful and flexible traffic management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gateway API Controller&lt;/strong&gt;&lt;br&gt;
As we learned in the Ingress lesson, even though we define routing rules in the Ingress object, the actual routing is handled by the Ingress Controller.&lt;/p&gt;

&lt;p&gt;The same concept applies to the Gateway API.&lt;/p&gt;

&lt;p&gt;While the Gateway API provides many objects to manage cluster traffic, the actual routing is done by a Gateway API Controller. This controller is not built into Kubernetes. You need to enable them by installing the Gateway API Custom Resource Definitions (CRDs).&lt;/p&gt;

&lt;p&gt;Various Gateway API controllers are available, some of them are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Nginx Gateway Fabric&lt;/li&gt;
&lt;li&gt;    Kong Gateway&lt;/li&gt;
&lt;li&gt;    Envoy Gateway&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;How Gateway API Actually Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the coolest things about Gateway API is that it isn’t just “Ingress v2.” It’s built around a component model that makes networking modular, role-based, and flexible. Let’s break it down:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Core Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;GatewayClass&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Defines the “blueprint” for how Gateways are provisioned.&lt;/p&gt;

&lt;p&gt;Usually provided by a controller (like NGINX, Traefik, Istio, Cilium).&lt;/p&gt;

&lt;p&gt;Example: nginx, istio, or cilium GatewayClass.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Gateway&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An instance of a GatewayClass.&lt;/p&gt;

&lt;p&gt;Think of it as the data-plane entry point (like a load balancer or proxy).&lt;/p&gt;

&lt;p&gt;It defines listeners (ports, protocols, TLS config).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Routes (HTTPRoute, TCPRoute, GRPCRoute, TLSRoute, etc.)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Define how traffic flows once it hits the Gateway.&lt;/p&gt;

&lt;p&gt;Each Route type matches a specific protocol.&lt;/p&gt;

&lt;p&gt;Routes are attached to Gateways using parentRefs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Gateway Controller&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The real engine under the hood.&lt;/p&gt;

&lt;p&gt;Each GatewayClass is implemented by a controller (e.g., nginx-gateway-controller, cilium-gateway-controller).&lt;/p&gt;

&lt;p&gt;The controller watches Gateway + Route objects, configures the data plane (like Envoy, NGINX, HAProxy), and applies the rules.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TL;DR: &lt;br&gt;
GatewayClass = template&lt;br&gt;
Gateway = instance (entry point)&lt;br&gt;
Route = traffic rules&lt;br&gt;
Controller = brains that makes it work&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Enabling Protocols in YAML&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike Ingress (which was HTTP/HTTPS only), Gateway API supports multiple protocols right out of the box. You specify them under the listeners section of the Gateway.&lt;/p&gt;

&lt;p&gt;Here’s how:&lt;br&gt;
&lt;em&gt;HTTPS with TLS&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: https-gateway
spec:
  gatewayClassName: nginx
  listeners:
  - name: https
    protocol: HTTPS
    port: 443
    tls:
      mode: Terminate
      certificateRefs:
      - name: my-cert
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;gRPC Example&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: grpc-gateway
spec:
  gatewayClassName: istio
  listeners:
  - name: grpc
    protocol: GRPC
    port: 50051

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How It All Comes Together:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The infra team creates a GatewayClass and provisions a Gateway. This is like dropping a load balancer in front of the cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The app teams create HTTPRoute, TCPRoute, or GRPCRoute objects that attach to the Gateway.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The controller (e.g., Cilium, Istio, NGINX) watches these resources and updates the proxy or load balancer accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Boom 💥 — traffic flows according to your rules, across multiple protocols, without messy annotations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By splitting things into GatewayClass → Gateway → Routes, Kubernetes now supports:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clear separation of duties (infra vs app teams).&lt;/li&gt;
&lt;li&gt;Native support for more than just HTTP.&lt;/li&gt;
&lt;li&gt;A standardized way for controllers to extend functionality.&lt;/li&gt;
&lt;li&gt;Future-ready traffic management (mTLS, retries, canaries, etc.).&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>kubernetes</category>
      <category>apigateway</category>
      <category>devops</category>
    </item>
    <item>
      <title>Understanding Init Containers in Kubernetes: Use Cases, Examples, and Best Practices</title>
      <dc:creator>Noushad Hasan</dc:creator>
      <pubDate>Thu, 19 Jun 2025 10:45:38 +0000</pubDate>
      <link>https://dev.to/noushad_hasan_4be85cd12d6/understanding-init-containers-in-kubernetes-use-cases-examples-and-best-practices-ia1</link>
      <guid>https://dev.to/noushad_hasan_4be85cd12d6/understanding-init-containers-in-kubernetes-use-cases-examples-and-best-practices-ia1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Kubernetes gives you a powerful way to manage your containerised applications but what happens when your app needs a little prep work before it runs? That’s where init containers come in.&lt;/p&gt;

&lt;p&gt;Think of init containers as setup assistants. They handle important tasks like waiting for a database, setting permissions, or pulling down config files—before your main app even starts. In this guide, you’ll learn what init containers are, when to use them, how to write them, and the best ways to keep them secure and reliable.&lt;/p&gt;

&lt;p&gt;Whether you’re just getting started with Kubernetes or you're building more complex deployments, init containers can help you build apps that start right—and stay running.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Init Containers and Where Are They Used?
&lt;/h2&gt;

&lt;p&gt;Init containers are special containers that run before your main application containers in a Kubernetes pod. Their job is to get everything ready before your app kicks off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up configs: Pulling configuration files from a repo or service&lt;/li&gt;
&lt;li&gt;Database readiness: Waiting for a database to become available&lt;/li&gt;
&lt;li&gt;Secrets: Grabbing secrets from tools like HashiCorp Vault&lt;/li&gt;
&lt;li&gt;Permissions: Fixing file permissions before your app starts&lt;/li&gt;
&lt;li&gt;Data sync: Downloading large assets or syncing from a repo&lt;/li&gt;
&lt;li&gt;Health checks: Making sure a service is reachable before launching&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each init container runs one at a time, in the order you define. If any of them fail, your main app won’t start—so you can be sure everything is ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Should You Use Init Containers?
&lt;/h2&gt;

&lt;p&gt;Init containers are useful when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your app needs something else to be ready (like a database).&lt;/li&gt;
&lt;li&gt;You want to keep setup logic separate from your app.&lt;/li&gt;
&lt;li&gt;The setup requires tools not included in your main container.&lt;/li&gt;
&lt;li&gt;Tasks need to run in a specific order.&lt;/li&gt;
&lt;li&gt;You want to keep your app image clean and lightweight.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When Not to Use Them
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For background tasks that need to run alongside your app.&lt;/li&gt;
&lt;li&gt;For anything that needs to keep running or restart if it fails.&lt;/li&gt;
&lt;li&gt;For simple tasks that don’t affect whether your app can start.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Use Init Containers (With Example)
&lt;/h2&gt;

&lt;p&gt;Here’s a practical example of using init containers to wait for a database and clone config files before starting the app -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
spec:
  containers:
  - name: myapp-container
    image: myapp:1.0
    ports:
    - containerPort: 80
    volumeMounts:
    - name: config-volume
      mountPath: /etc/config
  initContainers:
  - name: init-db
    image: busybox:1.28
    command: ['sh', '-c', 'until nc -z database-service 3306; do echo waiting for database; sleep 2; done;']
  - name: init-config
    image: alpine/git
    command: ['git', 'clone', 'https://github.com/myorg/config-repo.git', '/etc/config']
    volumeMounts:
    - name: config-volume
      mountPath: /etc/config
  volumes:
  - name: config-volume
    emptyDir: {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What’s happening here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;init-db waits until the database is up and reachable.&lt;/li&gt;
&lt;li&gt;init-config clones a Git repo into a shared volume.&lt;/li&gt;
&lt;li&gt;Both steps must succeed before the main container starts.&lt;/li&gt;
&lt;li&gt;The config is shared using a volume mounted in both containers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Benefits of Using Init Containers
&lt;/h2&gt;

&lt;p&gt;Here’s why init containers are worth using:&lt;br&gt;
✅ Keep things separate: Setup logic stays out of your main app&lt;/p&gt;

&lt;p&gt;✅ Order matters: Ensure steps run in the right sequence&lt;/p&gt;

&lt;p&gt;✅ Improve security: Run init containers with limited permissions&lt;/p&gt;

&lt;p&gt;✅ Lightweight images: Use special-purpose images for setup tasks&lt;/p&gt;

&lt;p&gt;✅ Better reliability: Don’t start your app unless everything’s ready&lt;/p&gt;

&lt;p&gt;✅ Easier debugging: If something breaks, you’ll know it’s in the setup&lt;/p&gt;

&lt;p&gt;✅ Flexible tools: Use different languages, packages, or shells&lt;/p&gt;

&lt;h2&gt;
  
  
  Potential Backdoors and Security Considerations
&lt;/h2&gt;

&lt;p&gt;Init containers can introduce risks if not handled carefully:&lt;br&gt;
&lt;strong&gt;Watch Out For:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Too many privileges:&lt;/strong&gt; Avoid running init containers as root unless
absolutely needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secret exposure:&lt;/strong&gt; Be careful when fetching and storing secrets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bad images:&lt;/strong&gt; Vulnerable or untrusted images can open up your cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistent changes:&lt;/strong&gt; Anything written to shared volumes will stick around.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Mitigation Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give init containers only the permissions they need.&lt;/li&gt;
&lt;li&gt;Use read-only filesystems if possible.&lt;/li&gt;
&lt;li&gt;Scan init container images for vulnerabilities regularly.&lt;/li&gt;
&lt;li&gt;Use PodSecurityPolicies (or PodSecurity Standards) to control what containers can do.&lt;/li&gt;
&lt;li&gt;For temporary debugging, use ephemeral containers instead.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Init containers give you control and flexibility when starting up your applications in Kubernetes. They make sure everything your app needs is ready before it even starts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use them for one-off setup tasks&lt;/li&gt;
&lt;li&gt;Keep setup logic clean and separate&lt;/li&gt;
&lt;li&gt;Use secure, minimal images&lt;/li&gt;
&lt;li&gt;Monitor their execution for early warning signs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re just starting with Kubernetes, init containers might feel like “extra work.” But once you use them, you’ll see how they can simplify your app logic, boost reliability, and give you a cleaner deployment process.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>containers</category>
      <category>devops</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Noushad Hasan</dc:creator>
      <pubDate>Tue, 27 May 2025 05:03:58 +0000</pubDate>
      <link>https://dev.to/noushad_hasan_4be85cd12d6/-5cl9</link>
      <guid>https://dev.to/noushad_hasan_4be85cd12d6/-5cl9</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/noushad_hasan_4be85cd12d6/debugging-docker-youre-probably-missing-this-hidden-gem-17e" class="crayons-story__hidden-navigation-link"&gt;Debugging Docker? You’re Probably Missing This Hidden Gem&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/noushad_hasan_4be85cd12d6" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3205018%2F72aa3de7-6a05-412c-a350-711af0ba4221.jpg" alt="noushad_hasan_4be85cd12d6 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/noushad_hasan_4be85cd12d6" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Noushad Hasan
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Noushad Hasan
                
              
              &lt;div id="story-author-preview-content-2531544" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/noushad_hasan_4be85cd12d6" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3205018%2F72aa3de7-6a05-412c-a350-711af0ba4221.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Noushad Hasan&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/noushad_hasan_4be85cd12d6/debugging-docker-youre-probably-missing-this-hidden-gem-17e" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 27 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/noushad_hasan_4be85cd12d6/debugging-docker-youre-probably-missing-this-hidden-gem-17e" id="article-link-2531544"&gt;
          Debugging Docker? You’re Probably Missing This Hidden Gem
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/docker"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;docker&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/containers"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;containers&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/monitoring"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;monitoring&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/noushad_hasan_4be85cd12d6/debugging-docker-youre-probably-missing-this-hidden-gem-17e#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>docker</category>
      <category>containers</category>
      <category>monitoring</category>
      <category>devops</category>
    </item>
    <item>
      <title>Debugging Docker? You’re Probably Missing This Hidden Gem</title>
      <dc:creator>Noushad Hasan</dc:creator>
      <pubDate>Tue, 27 May 2025 04:56:32 +0000</pubDate>
      <link>https://dev.to/noushad_hasan_4be85cd12d6/debugging-docker-youre-probably-missing-this-hidden-gem-17e</link>
      <guid>https://dev.to/noushad_hasan_4be85cd12d6/debugging-docker-youre-probably-missing-this-hidden-gem-17e</guid>
      <description>&lt;p&gt;Everyone uses Docker, but almost no one knows how to really debug a container.&lt;/p&gt;

&lt;p&gt;No, I’m not talking about the usual suspects:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`docker logs` → often empty or useless

`docker inspect` → static snapshot

`docker exec` → can’t attach before the container dies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sound familiar?&lt;/p&gt;

&lt;p&gt;When your container crashes in production (but works fine locally), you end up in a loop: tweaking the Dockerfile, redeploying, and praying.&lt;/p&gt;

&lt;p&gt;But there’s a better way.&lt;br&gt;
Enter &lt;code&gt;docker events&lt;/code&gt; – The Secret Weapon&lt;/p&gt;

&lt;p&gt;This little-known command streams real-time, low-level events straight from the Docker daemon. It exposes what docker logs won’t tell you.&lt;/p&gt;
&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;Your container keeps restarting. The logs show nothing. Instead of guessing, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker events --filter container=&amp;lt;your_container_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2025-05-04T18:20:01Z container create ...  
2025-05-04T18:20:02Z container start ...  
2025-05-04T18:20:03Z container health_status: unhealthy ...  
2025-05-04T18:20:04Z container kill signal=SIGTERM  
2025-05-04T18:20:04Z container restart  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom. Now you see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Health check failed → Container killed → Docker auto-restarted it
Your app logs? They won’t show this. The health check runs outside your main process.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pro Tips:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Filter by time:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker events --filter contaner=&amp;lt;container-id&amp;gt; --since="30m" --until "2025-05-04T18:00:00"  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Structured JSON output:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker events --filter container=&amp;lt;cont_id&amp;gt; --since="5m" --format '{{json .}}' | jq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;blockquote&gt;
&lt;p&gt;But What About Observability Tools?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sure, Grafana, Prometheus, and Loki are great. But they won’t catch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OOM kills before metrics are scraped&lt;/li&gt;
&lt;li&gt;Failed volume mounts&lt;/li&gt;
&lt;li&gt;Init containers that crash silently&lt;/li&gt;
&lt;li&gt;Sidecars restarting in the background&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;docker events sees everything—in real time.&lt;br&gt;
If you’re debugging Docker without it, you’re not debugging. You’re guessing.&lt;/p&gt;

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

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

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

&lt;h2&gt;
  
  
  Found this useful? Repost ♻️ to save your team hours of debugging pain.
&lt;/h2&gt;

</description>
      <category>docker</category>
      <category>containers</category>
      <category>monitoring</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
