Helm releases and ownership
Understand what a Helm release manages
A chart is a package of templates, defaults and metadata. A release is an installed instance of a chart in a particular namespace and cluster, with release history. The Helm Terraform provider tracks that release through a Terraform resource. It does not expose every generated Deployment or Service as a separate Terraform address. Kubernetes controllers still reconcile the objects once the release exists. A chart version is not necessarily the application image version.
Configure a reviewed chart and values
Use a fixed reviewed chart artifact, dependency inventory and digest verification outside the example. For a repository chart, pin an exact version and review its dependencies; a version string alone is not proof of immutable bytes. The local archive name below is fictional. Helm provider 3.x uses a nested object for kubernetes configuration; older examples may use block syntax. Exact provider and chart compatibility still needs validation.
# Static fragment; chart archive and kubeconfig are not supplied.terraform { required_version = "= 1.14.8" required_providers { helm = { source = "hashicorp/helm" version = "= 3.1.2" } }}provider "helm" { kubernetes = { config_path = var.approved_lab_kubeconfig config_context = "bytemind-lab" }}resource "helm_release" "catalog" { name = "catalog" namespace = "catalog-lab" chart = "./reviewed/catalog-1.2.0.tgz" values = [yamlencode({ replicaCount = 2 })] wait = true timeout = 300}The configuration asks Helm to install catalog in an existing namespace with an override for replicaCount. The chart would need to define and consume that value. wait and timeout govern the provider/Helm waiting behavior, not end-to-end business success. Review the chart schema, render the approved artifact in isolation, inspect all generated kinds and cluster-wide permissions, and define an application health test. Never place secrets in values, plan files or state merely because a value is marked sensitive.
Review an upgrade before applying
Imagine release catalog moves from chart 1.2.0 to 1.3.0. Compare chart bytes, default values, application image, generated objects, API compatibility, selectors, storage, hooks and permissions. A Terraform plan may describe a release update without showing every downstream object change. A separate rendered-manifest diff is valuable. Rendering alone does not reproduce live admission or controller behavior.
Synthetic chart review (not Helm output):1.2.0: Deployment catalog, replicas 2, Service ClusterIP1.3.0: Deployment catalog, replicas 3, Service ClusterIPReview: image digest, probes, resource requests, rollout budget, hooksDo not assume rollback reverses a database migration, external side effect or changed persistent data. Document application recovery, compatibility and health checks before upgrade. Helm hooks can run workloads; review them as executable behavior, not merely configuration.
Keep CRD and GitOps ownership explicit
Charts may ship CRDs under crds/. Helm handles initial CRD installation differently from regular templated objects and does not provide routine upgrade or deletion of those CRDs. Confirm the chart layout and select a dedicated owner for schema upgrades. Custom resources may need another plan after API discovery. A GitOps controller such as Argo CD may render a Helm chart yet manage the resulting objects through its own reconciliation rather than an installed Helm release.
Object Desired-state ownerNamespace catalog-lab platform TerraformConfigMap catalog-settings Helm release OR GitOps (choose one)Deployment catalog Helm release OR GitOps (choose one)Deployment status Kubernetes controllerCatalog CRD platform API ownerDistinguish desired fields from status written by controllers. Avoid competing reconcilers of the same desired fields. A migration to GitOps requires an agreed handoff, state and release inventory, review of pruning/uninstall effects and explicit verification of the new owner. Do not uninstall a live release just to remove Terraform ownership; it can delete managed objects. Avoid broad ignore_changes as a substitute for governance.
Practice with an offline release inventory
The supplied provider-free model lists deployment stages and synthetic ownership claims. Its expected output identifies the ConfigMap as having two conflicting declared owners and reverses the stage order for retirement review. This simple model is not Terraform provider behavior or a server-side apply simulation. Resolve the ownership conflict and propose approval gates for chart upgrades, readiness and teardown. No chart download or cluster access is needed.
terraform { required_version = "= 1.14.8"}locals { stages = ["cluster", "bootstrap", "custom-resources", "applications"] claims = [ { object = "catalog-lab/ConfigMap/catalog-settings", owner = "terraform" }, { object = "catalog-lab/Deployment/catalog", owner = "gitops" }, { object = "catalog-lab/ConfigMap/catalog-settings", owner = "helm" } ] owners = { for claim in local.claims : claim.object => claim.owner... }}output "review" { value = { deployment_order = local.stages retirement_order = reverse(local.stages) conflicts = [for object, owners in local.owners : object if length(distinct(owners)) > 1] }}Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Helm releases and ownership — knowledge check
Review API discovery, chart releases and ownership.
What is a Helm release?
What must be checked beyond a Terraform helm_release update?
How does Argo CD commonly use Helm?
What is a limitation of Helm CRDs under crds/?
Does a Helm rollback necessarily reverse a database migration?