Deploying the OpenBao Helm chart with OpenTofu

Manage the OpenBao Helm release as code with OpenTofu's Helm provider, covering HA Raft values, the multi-line server configuration and AWS KMS seal settings in one reviewable plan.

On this page

Why teams manage the OpenBao Helm release with OpenTofu

A platform team running OpenBao on Kubernetes usually wants the Helm release, its values and its seal settings reviewed and versioned like the rest of its infrastructure. Managing the OpenBao Helm release with OpenTofu puts the chart version, the values file and the seal configuration into one plan that can be reviewed, approved and tracked in version control. OpenTofu's Helm provider reads a chart reference and a set of values, renders the release, and applies it to the target cluster. The provider stores the release state in the same state file as the cloud resources it manages, so a seal key, an IAM role and the OpenBao release can change in one reviewed change set.

Running helm by hand works for a lab, but it leaves the values in a shell history or a local file and makes drift hard to see. With the provider, a helm_release resource records the chart version and the values that were applied, and a later tofu plan shows the difference before anything changes. The trade-off is that the provider is one more layer to version and upgrade, and the state file becomes sensitive because it can hold rendered values. Teams that already run OpenTofu for cluster and cloud infrastructure usually gain the most. Teams with no infrastructure-as-code practice may find the operational overhead outweighs the benefit.

Before adopting this approach, confirm the chart version you intend to pin, the Kubernetes versions it supports, and the state backend's encryption and access controls with your own security team. The chart's own documentation and the OpenBao release notes are the sources to check for the current requirements.

How the OpenTofu plan, Helm release and OpenBao pods fit together

The diagram starts with the OpenTofu state and plan, where the Helm provider reads the server configuration as a multi-line string and applies the chart to the cluster. The release creates the StatefulSet, and each OpenBao pod joins the Raft cluster by exchanging data with its peers on the persistent volumes. The seal stanza in the same configuration reaches out to AWS KMS, the one call that crosses the trust boundary. Check that the state file, the chart values and the KMS key policy are reviewed together, because a change to any of them alters how the cluster starts and recovers.

Data and control flow from the OpenTofu plan to the OpenBao pods and the AWS KMS seal.

Which Helm values and seal options fit which deployment

This table compares the server topologies and seal choices you can express in the OpenBao Helm values inside one OpenTofu plan. Read each row as a decision: the fit, what changes in the plan, and what to confirm against the chart version you pin. The main takeaway is that HA with integrated Raft storage or PostgreSQL are the documented supported HA backends, and auto-unseal adds a cloud KMS dependency to the same plan.

OptionWhen it fitsWhat changes in the planConfirm against the chart version
Standalone, single serverNon-production trials or a single-node test cluster where outage is acceptableOne replica, file or in-memory storage values, no HA stanza in the server configurationDefault storage values and whether the chart still defaults to dev mode
HA with integrated Raft storageProduction clusters that want OpenBao to own its storage without a separate databaseReplica count of three or five, server.ha.raft enabled, a multi-line HCL server configuration string, and persistent volume claims per podRaft stanza keys, node ID handling, and the retry_join settings the chart renders
HA with PostgreSQL storageTeams that already operate a PostgreSQL service with backup and failover they trustHA storage set to PostgreSQL with a connection string from a Kubernetes Secret, and no Raft volumesWhether the chart exposes PostgreSQL storage through values or needs a custom configuration block
External or non-chart storageOrganizations that need storage managed outside the release for policy reasonsStorage endpoint values only; the release does not create data volumesOwnership of backups and restores, which stay with your team
Shamir seal (manual unseal)Labs or small environments where operators can unseal each restartNo seal stanza; the plan does not reference any cloud resourceUnseal procedure documentation and how pods behave after rescheduling
AWS KMS auto-unsealProduction pods that must recover after rescheduling without an operator presentA seal stanza with the awskms type and key ID, plus IAM permissions for the pod identity added to the same planSeal stanza syntax, the migration path from Shamir, and the IAM actions the seal requires

How the server configuration string shapes the plan

The OpenBao Helm chart takes its server configuration as a multi-line HCL string under server.ha.raft.config (or the equivalent key for your mode), and the OpenTofu Helm provider passes that string through as a value in the release's values block. The HCL is opaque to OpenTofu. It does not parse the string during tofu plan, so an unquoted brace, a missing closing quote or a line indented one level too far will show as a clean plan and fail only when the chart renders the template or the pod starts and parses the file. Plan review therefore tells you almost nothing about whether the server will boot. Ask your team to run tofu plan with the rendered values output, and to check the resulting ConfigMap or config file with a parser before the first apply in each environment.

The string carries three decisions that deserve explicit review. The storage "raft" stanza sets the data path and node identity, the listener "tcp" block sets TLS certificate and key paths, and the seal block selects how the root key is protected, such as an AWS KMS seal with its region and key ID. Each of these is a place where a value that looks correct in a plan can point at the wrong file or key. Also confirm that disable_mlock is absent. Per the OpenBao migration guide, the project stopped using mlock in 2.0.0, so a configuration carried over from an older Vault setup should have that line removed. Confirm the exact chart and server version you intend to deploy against the OpenBao releases page before you copy any configuration forward.

To keep the string readable and reviewable, move it out of the resource body. The templatefile() function can render a .hcl.tftpl file with variables for the storage path, TLS paths and KMS key, and locals can hold computed values such as the pod count used in retry_join entries. Keep the template in version control next to the plan so reviewers see the HCL as a file, where syntax highlighting and an HCL formatter can catch errors that a multi-line string hides. Interpolated values should be validated in the plan, for example by checking that the KMS key ARN matches the expected account. Ask your implementation partner to show where the template ends and where the raw HCL begins, since mixing the two is the most common source of indentation errors.

Setup sequence for the OpenTofu-managed OpenBao release

This sequence takes the OpenBao Helm release from an empty plan to a running Raft cluster that OpenTofu owns end to end, with a check at each stage so drift, unexpected replacements or missing peers surface before they reach production.

  1. Pin the OpenTofu and Helm provider versions

    The platform engineer who owns the root module pins the OpenTofu version, the Helm provider and the Kubernetes provider in the version constraints, then commits the generated dependency lock file. Pin the OpenBao chart version too, and confirm the OpenBao server image tag you intend to run against the release notes for the chart version you chose. Confirm the image tag against the OpenBao releases page rather than assuming the chart's default. Done when tofu init completes on a clean checkout and the lock file lists the same provider versions on every workstation and in CI.

  2. Confirm cluster and namespace prerequisites

    Before any resource is planned, confirm with the cluster owner that the target Kubernetes version is still within the upstream support window, that a dedicated namespace exists for OpenBao, and that the nodes or storage class can hold three Raft pods with persistent volumes on separate nodes. Check the TLS plan for the listener and the Pod Security Standards level the namespace enforces, since the OpenBao pods need settings the restricted profile may reject. Done when a server-side dry run of the namespace and storage class checks passes and the cluster owner has signed off on the Kubernetes version in writing.

  3. Create the IAM role for the KMS seal

    The cloud or security team creates an IAM role that the OpenBao pods can assume, with permission limited to the encrypt and decrypt operations on one named AWS KMS key. Choose how the pods receive the role, such as IAM Roles for Service Accounts, and record the trust policy and the key ARN in the module inputs rather than in the values file. Confirm the exact seal configuration keys and required permissions against the current OpenBao seal documentation before writing the policy. Done when a test call using the role's credentials can encrypt and decrypt against the key and no other key.

  4. Write the values and server configuration

    The platform engineer sets HA Raft values, the replica count, the storage size and the service settings in the Helm values, and passes the OpenBao server configuration as a multi-line string under the server config key. The seal stanza, listener TLS paths and Raft retry-join addresses for each pod go in that string, and the KMS key identifier is injected from the module variables. Render the final configuration with tofu console or the plan output and read it line by line for typos, leftover disable_mlock settings and mismatched service names. Done when the rendered config matches the design document and the chart values pass a schema check.

  5. Review the plan for unexpected replacements

    Run tofu plan and save the output with -out, then have a second engineer review it before any apply. The expected result for a first deployment is a set of creates for the namespace, Helm release, service accounts, and TLS secrets, with no destroys. On later runs, any replacement of the StatefulSet, persistent volume claims or the Helm release itself must be explained and approved, because replacing the StatefulSet can remove the Raft data path. Done when the reviewed plan shows only the intended creates or updates, with zero destroys or unexplained replacements.

  6. Apply the saved plan

    Apply the reviewed plan file rather than running a fresh apply, so the change set matches what was reviewed. The Helm release is created and the StatefulSet starts its pods in order. Watch the rollout with kubectl get pods -n followed by the namespace name and the -w flag, and confirm that the pods are scheduled on different nodes as planned. Done when the apply finishes without errors and the state file records the release at the expected chart and app version.

  7. Initialize the first node and join Raft peers

    Initialize only one pod with bao operator init through an exec session, store the recovery material according to your key custody plan, and confirm the seal is KMS-backed so no manual unseal keys are needed for routine restarts. Then confirm the other pods join the Raft cluster by running bao operator raft list-peers and checking that each expected node appears with a voter role. Initialization material must never be written into OpenTofu state or the values file. Done when list-peers shows the expected number of voters and every pod reports Ready.

  8. Verify pod readiness and active node routing

    Confirm that the number of pods reporting Ready equals the replica count in the values, and check the health endpoint of each pod so you can see which node is active and which are standby. Test the Kubernetes service that routes to the active node by writing and reading a throwaway secret through it, then delete one non-active pod and confirm the cluster keeps quorum and the pod rejoins. Record the results in the change ticket. Done when the expected pod count is Ready, a write through the service succeeds, and the deleted pod returns as a Raft peer.

Security controls to review in the plan

The OpenTofu plan for OpenBao touches three sensitive areas at once: the state file that records every value the provider sees, the cloud key that unseals the server, and the network path that carries secrets between clients and pods. The cards below cover one control each, with the check to run before the first apply.

State encryption and access

OpenTofu state records resource attributes, and values passed through the Helm provider can end up in it. Confirm that state is stored in an encrypted backend, that state encryption is enabled where your OpenTofu version supports it, and that read access to the state object is limited to the few people and pipelines that apply the plan. Treat any state copy on a laptop or in a shared artifact bucket as a secret store that needs the same controls.

KMS key policy for auto-unseal

If the plan configures AWS KMS as the seal, the key policy decides who can encrypt and decrypt the root key. Check that the OpenBao pods use a dedicated IAM role that can only call the encrypt and decrypt operations on that one key, and that administrators cannot use the same role to read other keys. Confirm the key policy does not grant broad account principals access and that key deletion and policy changes are restricted to a separate security group.

Least-privilege IAM for the seal

The IAM role that the pods assume for auto-unseal is a separate control from the key policy. Review the role trust policy so that only the OpenBao service account in the intended namespace can assume it, and confirm no static access keys are placed in the Helm values or in the state. Ask the platform team to show the exact actions granted, since over-broad wildcard permissions on the key are a common finding.

TLS on the listener and the cluster

The listener serves the API that clients use, and the cluster port carries traffic between Raft peers. Both need certificates, and the plan should set the TLS paths and the certificate chain explicitly rather than relying on defaults. Check the certificate issuer, the subject names used by the service DNS entries, the expiry and renewal process, and whether the Helm values disable TLS anywhere, including in test releases that later move to production.

Recovery keys and root tokens in output

Unseal material and the initial root token are sensitive from the moment they are generated. Check that the plan does not capture them in Terraform outputs, CI job logs, Helm notes or chart hook output, and that the pipeline masks any variable that could echo them. Agree in advance where the initial root token is stored, who receives it, and when it is revoked after the first administrative setup.

Pipeline secrets and log review

The apply pipeline holds credentials for the cluster, the cloud account and the state backend, and each can expose values if verbose logging is enabled. Review whether plan and apply output is stored, who can read it, and how long it is retained. Run a test apply in a non-production cluster and search its logs and state for secret values before the production run.

Upgrades, drift and the chart maturity trade-off

Upgrades to the OpenBao release should run through the same OpenTofu plan that created the release, so every version change is visible before it reaches the cluster. Pin the helm_release chart version and the server.image tag together in the same module, and treat a change to either as one reviewable diff. Check candidate versions on the OpenBao releases page, but do not assume the chart version and the server image version move in step. Confirm which chart version ships with which OpenBao image before you pin them, and test the pair in a non-production cluster first.

The Helm chart is still maturing, so each plan deserves a human review step before tofu apply, even when the change looks small. Run tofu plan -out=tfplan and review the saved plan file, paying attention to changes in the StatefulSet, the server.ha.raft configuration block, the seal stanza and any resources that would be replaced rather than updated. Replacing a pod or a PersistentVolumeClaim in an HA Raft cluster has consequences that a generic diff does not explain, so confirm with the chart's release notes what a change will do. Ask your team to record who approved each plan.

Drift shows up when someone changes the release outside OpenTofu, for example with helm upgrade or a manual edit to a StatefulSet. Schedule tofu plan runs with -detailed-exitcode in CI to detect differences without applying them, and treat any non-empty plan on an unchanged repository as an incident to investigate. Also decide who may change the release in the cluster, and restrict Helm and Kubernetes write access to the pipeline identity. Before you adopt this workflow, confirm how your chosen Helm provider version reports drift on release values, because provider behavior has changed across releases.

Limits to confirm in your environment

The OpenBao Helm chart, the OpenTofu Helm provider and the Kubernetes cluster each move on their own schedule. The cards below list the checks that connect those three components, so a plan that validates today still works after the next chart, provider or cluster upgrade.

Chart version and Kubernetes support

Confirm which Kubernetes versions the OpenBao Helm chart version you pin is tested against. A chart release can require a newer minimum cluster version than the one you run today, and the chart's own documentation is the authority on that range. Record the chart version in the OpenTofu configuration so a plan never silently pulls a newer chart. Check the supported range again before any cluster upgrade.

Migration guide

Helm provider version behavior

Confirm how the Helm provider version you pin handles the values argument, multi-line server configuration strings, and release replacement. Provider releases change how values are merged and how failed upgrades are reported, which can alter what a plan shows. Pin the provider version, run a plan against a non-production cluster after every provider change, and read the provider changelog before upgrading.

KMS seal support in the chosen image

Confirm that the OpenBao image tag you deploy includes the AWS KMS seal option you intend to use. Seal support can differ between image variants and releases, so check the image and the seal configuration documentation rather than assuming it is present. Also confirm the IAM permissions the seal needs, because a missing permission only appears when a pod restarts and tries to unseal.

Kubernetes version support window

Confirm how long your target Kubernetes minor version receives support, because the OpenBao chart and the cluster will both need upgrades on that schedule. Kubernetes maintains only the three most recent minor releases, so a cluster that falls behind forces an upgrade path you must plan. Check the release calendar before you pin a chart version, and confirm that the chart supports the version you expect to run during the next support window.

Kubernetes releases

Version skew between chart and cluster

Confirm that the OpenBao image, the chart and the cluster are compatible with one another during an upgrade. The Kubernetes version skew policy sets how far kubelets may lag the API server, and the OpenBao chart may rely on specific API versions for StatefulSets or service accounts. Test the upgrade order in a non-production environment before changing the production cluster.

Version skew policy

Questions teams ask before deploying OpenBao with OpenTofu

What drives the cost of deploying OpenBao with OpenTofu?

The cost depends mostly on how many environments the code must cover, how much of the surrounding platform is new, and how many seal and identity decisions are still open. Each cost component is a different party's time: your platform engineers, your security team reviewing the design, the cloud and KMS administrators creating keys and roles, and any partner hours for the module design, the plan and review, and handover. Most of the spend is one-time (module design, state layout, first cluster, runbooks). Recurring costs are upgrades to the chart and provider versions, plan reviews, and cluster operations after go-live. Ask any quote to separate these lines and to state which environments and seal options are included.

How long does an OpenBao OpenTofu deployment usually take?

Duration follows scope: a single non-production cluster with a fixed Helm values file takes far less time than a multi-environment HA setup with cloud KMS auto-unseal, identity integration and reviewed state handling. The main schedule risks are waiting on KMS keys and IAM roles, agreeing the Raft and TLS design, and getting change approval for the first production apply. No duration is given here because it depends on your environment. Ask for a timeline tied to a written scope with named milestones, and ask which of your teams must act at each step.

What does the work need from our side?

Plan for access and approvals before the work begins. Typical needs are a Kubernetes cluster with a namespace for OpenBao, credentials that OpenTofu can use to create the Helm release and any cluster-scoped resources, a state backend with locking, and for auto-unseal, a KMS key plus an IAM role or workload identity that the OpenBao pods may use to call it. Also needed are DNS names and certificates for the API and cluster traffic, and a named owner for the seal and recovery material. Confirm the exact permissions with your cloud and cluster administrators, since they depend on your provider and policies.

Can our in-house team deploy OpenBao with OpenTofu without a partner?

Yes, if your team already runs Kubernetes, Helm and OpenTofu in production and has someone who understands OpenBao's initialization, unseal and Raft membership. The areas that most often need outside review are the seal design, the handling of recovery keys, and the separation between plan and apply in CI. A partner is most useful when the team lacks one of these skills or when the first deployment must be reviewed before production. Decide this by listing the skills you have, then comparing that list with the design decisions in this topic.

How does a partner scope this work?

A partner scopes the work by first inventorying the target clusters, environments, seal method, identity sources, backup expectations and the change process you must follow. The output is a written scope listing deliverables such as the OpenTofu module, environment variable files, the HA Raft values, validation steps, a runbook and a handover session, plus the items you will own. Ask for explicit exclusions, such as application secret migration or CSI integration, so those are not assumed. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and quotes follow from that scope.

How is this different from deploying the Helm chart with the Helm CLI?

Both install the same chart with the same values, but OpenTofu keeps the release definition in a plan you review and a state file that records what was applied. With the Helm CLI, the release state lives in the cluster as Helm release secrets, and changes are usually made by running commands or editing values files by hand. OpenTofu makes it easier to pass a multi-line server configuration as a string, to reference a KMS key created in the same plan, and to review changes before apply. The trade-off is an extra tool, provider versioning and state handling that your team must maintain.

Who owns the OpenTofu state file, and what does it contain?

Your organization should own the state file, and the owner should be a named team with access controls and audit logs on the state backend. State can hold resource identifiers, provider configuration and sometimes sensitive values, so treat it as a sensitive artifact: encrypt it at rest, restrict who can read it, and enable locking so two applies cannot overlap. Decide before the first apply where state is stored, who approves changes, and how recovery works if the backend is lost. Confirm these choices with your security team, and do not store secrets in plain values files that end up in state.

What should we check before the first production apply?

Check that the chart version is pinned, the values file has been reviewed for HA Raft and TLS settings, and the seal configuration matches the KMS key and IAM permissions you approved. Run a plan in a non-production environment, confirm the pods form a Raft cluster and that auto-unseal works after a pod restart, and test that recovery material is stored where only authorized people can reach it. Record the results so the plan, the apply and the verification are traceable for your change process.

How DeployOpen scopes and delivers this work

DeployOpen plans and implements the OpenBao Helm release and its OpenTofu code inside your own infrastructure, whether that is your cloud accounts, your data centers or an air-gapped network. The first step is a written scope that names the target clusters, the OpenBao chart version to pin, the storage topology (Raft on StatefulSets or another documented backend), the seal approach, and who holds the keys and credentials for the state backend and the cloud KMS key. Scope, deliverables and timelines are agreed in writing before work starts, so your team knows what will be delivered, what is excluded and what you must provide, such as cluster access, DNS and TLS certificates, and an approved change window. Ask for the scope to state which OpenTofu providers and module versions are in the deliverable and how upgrades to the chart will be tested before they reach production.

The deliverables are the working OpenTofu configuration, the values files and server configuration strings in version control, and runbooks for the operations your team will perform. Those runbooks should cover running tofu plan before every apply, the procedure for a chart upgrade, how a failed pod is recovered after rescheduling, and how the seal configuration is verified after a change. DeployOpen documents the code so that an engineer who was not in the build can read it, change a value and understand the consequences. Before handover, confirm that the documentation matches the state your team will actually run, and that the repository includes a clear owner for each file.

Most engagements of this kind are fixed-scope, and the quote follows from the written scope rather than from a published price list. The work that recurs after go-live is chart upgrades, OpenBao version upgrades, and the periodic review of the state file, provider versions and KMS permissions. DeployOpen offers retainers for ongoing upgrades and support, which you can compare against keeping that work with your own platform team. When you request a quote, ask which items are one-time, which recur, what the retainer includes, and how change requests to the agreed scope are priced and approved in writing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.