<?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: Marco</title>
    <description>The latest articles on DEV Community by Marco (@marco13moo).</description>
    <link>https://dev.to/marco13moo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4075032%2Fa20d9ca5-581a-4a78-a7f5-ee6aad8134f5.jpg</url>
      <title>DEV Community: Marco</title>
      <link>https://dev.to/marco13moo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marco13moo"/>
    <language>en</language>
    <item>
      <title>Daily Dose of DevOps — Terraform remote state explained</title>
      <dc:creator>Marco</dc:creator>
      <pubDate>Fri, 14 Aug 2026 08:09:34 +0000</pubDate>
      <link>https://dev.to/marco13moo/daily-dose-of-devops-terraform-remote-state-explained-3poe</link>
      <guid>https://dev.to/marco13moo/daily-dose-of-devops-terraform-remote-state-explained-3poe</guid>
      <description>&lt;h1&gt;
  
  
  Terraform Remote State Explained
&lt;/h1&gt;

&lt;p&gt;Terraform remote state management is a crucial aspect of modern infrastructure as code (IaC) practices. It allows teams to manage Terraform state files in a shared, version-controlled manner, which is essential for collaboration and disaster recovery. This article delves into the mechanics of Terraform remote state, its benefits, failure modes, and trade-offs. We will also provide a technically correct example and conclude with key takeaways.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to Terraform Remote State
&lt;/h2&gt;

&lt;p&gt;Terraform's remote state management enables you to store your Terraform state in a remote backend, such as Amazon S3, Azure Blob Storage, or a remote database like Consul or Vault. This approach provides several advantages over the default local state file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Version Control&lt;/strong&gt;: Remote state can be version-controlled, making it easier to track changes and revert to previous states.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: It supports multiple users and teams, making it suitable for large-scale infrastructure management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disaster Recovery&lt;/strong&gt;: Remote state can be backed up and restored, ensuring data safety.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: It allows for more secure storage options, such as encrypted S3 buckets or Vault.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting Up Remote State
&lt;/h2&gt;

&lt;p&gt;To set up remote state in Terraform, you need to configure the backend in your &lt;code&gt;terraform.tfstate&lt;/code&gt; file or in a &lt;code&gt;backend.tf&lt;/code&gt; file. Here’s an example of using an S3 backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your-bucket-name"&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"path/to/your/terraform/state"&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-west-2"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Concepts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Backend Configuration
&lt;/h3&gt;

&lt;p&gt;Backend configuration specifies the type of remote state backend and its parameters. Common backends include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S3&lt;/strong&gt;: Amazon S3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Storage&lt;/strong&gt;: Azure Blob Storage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consul&lt;/strong&gt;: HashiCorp Consul&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vault&lt;/strong&gt;: HashiCorp Vault&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  State Locking
&lt;/h3&gt;

&lt;p&gt;State locking is a feature that prevents multiple Terraform processes from modifying the state concurrently. This is crucial for preventing conflicts and ensuring consistency.&lt;/p&gt;

&lt;h3&gt;
  
  
  State Versioning
&lt;/h3&gt;

&lt;p&gt;State versioning allows you to track changes to your infrastructure over time. Each change to the state file results in a new version, which can be useful for auditing and rollback purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Modes and Trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Network Issues
&lt;/h3&gt;

&lt;p&gt;Network connectivity to the remote backend can be a failure point. If the backend is not reachable, Terraform operations will fail. Ensuring reliable network access to the backend is essential.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Risks
&lt;/h3&gt;

&lt;p&gt;Using a remote backend introduces security risks. Ensure that the backend is properly secured, and access is restricted to authorized users. Encryption should be used to protect sensitive data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;p&gt;Remote state operations can be slower than local state operations due to network latency. For critical infrastructure, consider the performance implications and choose a backend that minimizes latency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Complexity
&lt;/h3&gt;

&lt;p&gt;Managing remote state introduces additional complexity. You need to manage backend configurations, credentials, and potentially integrate with version control systems. This complexity needs to be managed to avoid operational overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Here’s a complete example of using an S3 backend for remote state management:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# backend.tf&lt;/span&gt;
&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your-bucket-name"&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"path/to/your/terraform/state"&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-west-2"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# main.tf&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"example"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-0c55b159cbfafe1f0"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the Terraform state is stored in an S3 bucket named &lt;code&gt;your-bucket-name&lt;/code&gt; under the key &lt;code&gt;path/to/your/terraform/state&lt;/code&gt;. The &lt;code&gt;aws_instance&lt;/code&gt; resource is managed using this remote state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remote state management&lt;/strong&gt; is essential for collaborative and scalable infrastructure as code practices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend configuration&lt;/strong&gt; is crucial for specifying the type of remote backend and its parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State locking&lt;/strong&gt; and &lt;strong&gt;versioning&lt;/strong&gt; are important features for ensuring consistency and tracking changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network issues&lt;/strong&gt; and &lt;strong&gt;security risks&lt;/strong&gt; are potential failure modes, requiring robust network access and secure backend management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt; and &lt;strong&gt;complexity&lt;/strong&gt; are trade-offs that need to be considered when implementing remote state management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By understanding these concepts and best practices, you can effectively manage your Terraform state in a remote backend, ensuring robust and secure infrastructure management.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>infrastructure</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Daily Dose of DevOps — Kubernetes readiness vs liveness probes</title>
      <dc:creator>Marco</dc:creator>
      <pubDate>Thu, 13 Aug 2026 08:15:11 +0000</pubDate>
      <link>https://dev.to/marco13moo/daily-dose-of-devops-kubernetes-readiness-vs-liveness-probes-1ldn</link>
      <guid>https://dev.to/marco13moo/daily-dose-of-devops-kubernetes-readiness-vs-liveness-probes-1ldn</guid>
      <description>&lt;h1&gt;
  
  
  Kubernetes Readiness vs Liveness Probes: Understanding the Differences and Their Implications
&lt;/h1&gt;

&lt;p&gt;In Kubernetes, ensuring that your application pods are both alive and ready to serve traffic is critical. Two key mechanisms for monitoring the health of your pods are &lt;strong&gt;readiness probes&lt;/strong&gt; and &lt;strong&gt;liveness probes&lt;/strong&gt;. These probes help in maintaining the health of your application and ensuring that only healthy instances are handling requests. Understanding the differences between these probes and their implications is essential for effective DevOps practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Readiness and Liveness Probes?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Liveness Probes
&lt;/h3&gt;

&lt;p&gt;Liveness probes are used to determine if a container is running and healthy. If a liveness probe fails, Kubernetes will restart the container. This ensures that the application does not stay in a non-functional state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Readiness Probes
&lt;/h3&gt;

&lt;p&gt;Readiness probes are used to determine if a container is ready to start accepting traffic. If a readiness probe fails, Kubernetes will not send traffic to the pod. This is useful in scenarios where a pod is in the process of starting up and is not yet ready to handle requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration of Probes
&lt;/h2&gt;

&lt;p&gt;Both liveness and readiness probes can be configured using the &lt;code&gt;livenessProbe&lt;/code&gt; and &lt;code&gt;readinessProbe&lt;/code&gt; fields in the pod's specification. The configuration includes several parameters such as &lt;code&gt;httpGet&lt;/code&gt;, &lt;code&gt;tcpSocket&lt;/code&gt;, &lt;code&gt;exec&lt;/code&gt;, and &lt;code&gt;initialDelaySeconds&lt;/code&gt;, &lt;code&gt;periodSeconds&lt;/code&gt;, &lt;code&gt;timeoutSeconds&lt;/code&gt;, &lt;code&gt;failureThreshold&lt;/code&gt;, and &lt;code&gt;successThreshold&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Configuration
&lt;/h3&gt;

&lt;p&gt;Here is an example of how to configure both probes in a Kubernetes deployment manifest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webapp-deployment&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webapp&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webapp&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webapp&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:latest&lt;/span&gt;
        &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
        &lt;span class="na"&gt;livenessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/healthz&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
          &lt;span class="na"&gt;initialDelaySeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;
          &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
          &lt;span class="na"&gt;timeoutSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
          &lt;span class="na"&gt;failureThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
          &lt;span class="na"&gt;successThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
        &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/readiness&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
          &lt;span class="na"&gt;initialDelaySeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
          &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
          &lt;span class="na"&gt;timeoutSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
          &lt;span class="na"&gt;failureThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
          &lt;span class="na"&gt;successThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the liveness probe checks the &lt;code&gt;/healthz&lt;/code&gt; endpoint every 10 seconds, and if it fails three times in a row, the container is restarted. The readiness probe checks the &lt;code&gt;/readiness&lt;/code&gt; endpoint every 10 seconds, and if it fails three times in a row, the pod is not used to route traffic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure Modes and Trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Liveness Probes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Failure Mode&lt;/strong&gt;: The application may remain in a non-functional state, causing downtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trade-offs&lt;/strong&gt;: Overly aggressive liveness probes can lead to unnecessary container restarts, which can cause service disruption and increased load on the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Readiness Probes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Failure Mode&lt;/strong&gt;: Traffic is sent to a pod that is not yet ready to handle requests, leading to potential errors or degraded service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trade-offs&lt;/strong&gt;: If the initial delay or period is too short, the application might not have enough time to initialize properly, leading to false negatives. Conversely, if it is too long, traffic might be delayed or routed to unhealthy pods.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use Cases&lt;/strong&gt;: Liveness probes are used to ensure that a container is running and healthy, while readiness probes are used to determine if a container is ready to start accepting traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration&lt;/strong&gt;: Both probes can be configured using &lt;code&gt;httpGet&lt;/code&gt;, &lt;code&gt;tcpSocket&lt;/code&gt;, or &lt;code&gt;exec&lt;/code&gt; actions, with parameters like &lt;code&gt;initialDelaySeconds&lt;/code&gt;, &lt;code&gt;periodSeconds&lt;/code&gt;, and &lt;code&gt;failureThreshold&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failure Modes&lt;/strong&gt;: Incorrectly configured liveness or readiness probes can lead to either unnecessary restarts or delayed traffic routing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trade-offs&lt;/strong&gt;: Balancing the parameters of the probes is crucial to avoid both false positives and false negatives.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By understanding the differences and implications of liveness and readiness probes, you can ensure that your applications are both healthy and ready to serve traffic, leading to more robust and reliable deployments.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>monitoring</category>
    </item>
  </channel>
</rss>
