Skip to content
>_ StartupJobList_

Technology decisions

Terraform vs Kubernetes: provisioning and workload reconciliation

Terraform and Kubernetes are complementary. Terraform provisions and changes infrastructure through providers, including clusters, networks and managed services. Kubernetes reconciles desired workload objects inside a running cluster. Decide which system owns each resource and field, then make the handoff explicit so two controllers do not fight over the same state.

Terraform 1.15 state and plan concepts plus Kubernetes declarative objects and controllers. They operate at different layers and can be used together; this comparison does not recommend replacing one with the other.

Terraform manages infrastructure resources through provider APIs and records their identities in Terraform state. Kubernetes continuously reconciles workload objects against desired state in a cluster. A common design uses Terraform for the cluster, network and initial platform services, then Kubernetes controllers for Deployments, Services and other workload objects.

Compare the practical consequences

Scroll sideways to compare all columns on a smaller screen.

Terraform and Kubernetes by decision criterion
CriterionTerraformKubernetesWhat changes the decision
Cluster and cloud infrastructureTerraform can manage cluster, network, identity and managed-service resources through their providers.Kubernetes consumes an existing cluster; it does not create the cloud account, VPC or control plane by itself.Assign cluster lifecycle and workload lifecycle to named owners with a documented handoff.
Application replica and rollout stateTerraform can create Kubernetes provider objects but does not continuously reconcile every workload change as the cluster runs.Kubernetes controllers reconcile Deployments, Pods, Services and rollout state continuously.Use Kubernetes for application rollout and health behavior when operating a cluster-based workload.
Change and reconciliation loopA reviewed Terraform plan proposes changes from configuration, state and provider observations; apply executes that plan.Kubernetes controllers repeatedly compare live objects with desired manifests and act to reduce the difference.Choose whether a change is an infrastructure plan or an in-cluster desired-state update before automation runs.
Failure and drift visibilityTerraform state and plans reveal provider resource changes, but require a new operation to observe and reconcile drift.Kubernetes controller status, events and conditions reveal ongoing reconciliation and workload health.Monitor both control loops; a successful apply does not prove that Pods are ready or that the service is healthy.
Resource ownership overlapTerraform should own the infrastructure objects declared in its state and configuration.Kubernetes controllers own fields and child objects they reconcile within the cluster.Avoid two systems continuously applying conflicting values to the same field or resource.
Adoption and reversalTerraform can establish provider-backed infrastructure ownership through imports and state moves.Kubernetes can adopt workloads through manifests and controllers after cluster access and policy are ready.Migrate a bounded resource class, prove rollback and data ownership, then expand; do not transfer ownership by deleting state or controllers blindly.

↑ Back to sections

Who owns one service from network to running Pods?

Terraform can provision a cluster, network, node pools and managed dependencies. Kubernetes then reconciles a Deployment into Pods, exposes a Service and reports readiness. The handoff includes credentials, API access, version compatibility and a clear owner for shared fields.

For a web service, Terraform creates the managed cluster and its network. A deployment pipeline applies a Kubernetes Deployment and Service. The Kubernetes controller replaces failed Pods and advances the rollout; Terraform continues to own cluster-level settings and provider resources.

The chain needs an explicit bootstrap boundary. Terraform's apply identity must not silently become every workload's runtime identity. Separate deployment credentials, namespace policy and service accounts according to the threat model.

Ownership trace · Worked example
Terraform owns: cluster, network, node pools, managed database
Handoff: Kubernetes API endpoint, scoped deploy identity, namespace policy
Kubernetes owns: Deployment, Pods, Service, workload rollout and readiness

This trace places resources at their lifecycle owner and names the handoff. It is an architecture artifact, not an executable deployment or production recommendation.

Non-executable ownership trace; no deployment or runtime claim.

Follow-up: Can Terraform manage Kubernetes manifests too?

Yes, a Kubernetes provider can manage objects, but the team must still choose a single owner for each resource and field. Do not let Terraform and a GitOps controller continually overwrite the same object.

Read the source: Terraform: What is Terraform? · Kubernetes: Controllers

↑ Back to sections

How do their feedback loops differ?

Terraform runs a plan and apply workflow that compares configuration, state and provider observations. Kubernetes controllers continuously observe API objects and reconcile toward their declared desired state.

Terraform is suited to reviewed infrastructure changes with dependency planning and state locking. Kubernetes is suited to ongoing workload control such as restoring replica count after a Pod exits.

Neither loop proves the user-facing service works. Add health checks, rollout analysis, service-level signals and clear operator action for both infrastructure and workload failures.

Follow-up: Does Kubernetes continuously undo every manual change?

Controllers reconcile the fields and resources they own according to their behavior. Some changes may be tolerated or ignored, and conflict behavior depends on the object and field manager. Inspect actual status and ownership.

Read the source: Terraform: Planning and Applying · Kubernetes: Declarative management of Kubernetes objects

↑ Back to sections

What happens when two systems own the same field?

Competing reconcilers can repeatedly overwrite a value or produce plans that try to undo the other system's change. Split ownership by resource or field and use an explicit handoff when ownership changes.

Terraform sets a Deployment replica count to three while a Kubernetes autoscaler changes it to eight. Terraform may later plan to restore three; the autoscaler may then scale it back. Pick the autoscaler as the owner of replicas or remove the overlapping Terraform field from the steady-state path.

A tool boundary is not enough if both tools write the same provider object. Review the generated plans, field managers, controller logs and state declarations before changing automation. Preserve a recovery plan for a partially transferred resource.

Follow-up: Can one system create an object that another later manages?

Yes, through a controlled handoff. Stop the first owner's reconciliation, verify identity and current values, import or adopt the object into the next system, then confirm one owner remains.

Read the source: Terraform: Purpose of State · Kubernetes: Declarative management

↑ Back to sections

How do you diagnose a service that exists but does not serve traffic?

Follow the dependency chain from provider resource health through cluster capacity, scheduling, Pod readiness, Service endpoints, network policy and application behavior. Use the control system responsible for each boundary rather than repeating apply commands.

Terraform can show that a cluster and load balancer resource were created. Kubernetes can show a Deployment with unavailable replicas or Pods stuck Pending. Application probes and logs can then reveal image pull, configuration or startup failures.

A readiness probe that reports success too early may route traffic to an app that cannot use its database. A Terraform resource being present does not establish a healthy dependency path, and a Kubernetes Ready condition does not prove business correctness.

Follow-up: Which signal should stop a rollout?

Use the user-visible health criteria and failure budget for the service, together with rollout status. Pause or roll back only when the prior version is safe against current data and dependencies.

Read the source: Kubernetes: Deployments · Kubernetes: Probes

↑ Back to sections

When is one tool unnecessary for the workload?

If a team deploys a few managed services without operating a Kubernetes cluster, Terraform can manage the infrastructure without Kubernetes. If a cluster is already provided by a platform team, an application team may use Kubernetes manifests without owning the cluster's Terraform state.

A small service on a managed container platform may need infrastructure as code but not a cluster control plane. Adding Kubernetes brings its own upgrades, capacity, identity and incident responsibilities.

An application team consuming a centrally operated cluster should not duplicate platform ownership merely to match another team's tooling. Use the interface the platform team supports and make its limits and escalation path clear.

Follow-up: Should a startup adopt both from day one?

Adopt only the control loops needed for the current workload and team. If using Kubernetes, name who operates cluster upgrades, capacity, networking and incident response before production traffic depends on it.

Read the source: Terraform: What is Terraform? · Kubernetes: Concepts

↑ Back to sections

How can infrastructure and workload ownership be changed safely?

Move one resource class at a time with explicit identity, state and rollback evidence. Stop the old reconciler before the new one begins, verify the new owner can observe the existing object, and define who owns data and external side effects.

For a cluster handoff, preserve Terraform state and provider configuration while a new platform owner validates access and control-plane health. For a workload move, keep the old deployment available until the new owner passes health and traffic checks, then change routing deliberately.

Reversal must account for storage, IP addresses, DNS caches, credentials, database schema and controller-generated children. Rolling back a Deployment or Terraform commit does not automatically undo a data migration or external API effect.

Follow-up: What evidence permits deleting the previous owner?

A fresh plan or controller status shows the intended new owner manages the correct object, no competing writer remains, recovery data is retained, and the service's health and rollback boundary are understood.

Read the source: Terraform: Refactor modules and resources · Kubernetes: Declarative management

↑ Back to sections

Salary context

Advertised salaries for these skills

These are Hacker News job posts that mention these technologies, not employee earnings or a measure of what a skill adds to pay. The amounts summarize annualized advertised minimums in approximate USD. Groups can overlap and differ in roles, locations and dates.

Terraform posts

100 posts · 100 usable advertised salary amounts

2024-06-04 to 2026-11-09

$150,000

Median advertised minimum, approximate USD/year

Middle 50%: $125,000–$170,000

Explore Terraform salaries → Browse matching job posts →
Currency and calculation basis

Approximate USD using ECB daily reference rates as of 2026-10-30. Original currencies and offer ranges remain on the source listings. These figures cover posts tagged Terraform, rather than every job in the broader technology family.

Kubernetes posts

157 posts · 157 usable advertised salary amounts

2024-06-05 to 2026-11-09

$144,000

Median advertised minimum, approximate USD/year

Middle 50%: $116,800–$160,000

Explore Kubernetes salaries → Browse matching job posts →
Currency and calculation basis

Approximate USD using ECB daily reference rates as of 2026-10-30. Original currencies and offer ranges remain on the source listings. These figures cover posts tagged Kubernetes, rather than every job in the broader technology family.

Middle-half salary ranges on one shared scale

The band runs from the 25th to 75th percentile; the vertical marker is the median. Both rows use approximate USD per year.

Terraform $150,000 median
Kubernetes $144,000 median
$116,800$170,000
How many source posts appear in both salary groups?

Source posts can appear in both groups in this salary dataset. The same advertised salary can therefore contribute to both summaries.

Terraform posts in this dataset 46 of 100 also tagged Kubernetes · 46.0%
Kubernetes posts in this dataset 46 of 157 also tagged Terraform · 29.3%
What these bars count

Bars count distinct source posts with known HN IDs in these salary cohorts, not every Hacker News post or the wider job market. Duplicate IDs count once; rows without a valid HN ID are left out, so the bars cannot establish overlap for the full population. These are source-post counts, not the salary-observation counts in the cards above. A missing tag does not prove a technology was not used. Overlap does not establish employer preference, adoption or a pay effect.

↑ Back to sections

Keep exploring