OpenBao CSI provider for mounting secrets into pods

The OpenBao CSI provider delivers secrets to pods through the Secrets Store CSI Driver. This page covers when to use it, how it is configured, and what to confirm before rollout.

On this page

When the OpenBao CSI provider fits how your pods get secrets

Choose the OpenBao CSI provider when pods need OpenBao secrets as files and those secrets should never be baked into container images. The provider works alongside the Secrets Store CSI Driver: when a pod starts, the driver asks the provider to fetch the secrets named in a SecretProviderClass and mounts them into the pod as a volume. This matters because Kubernetes Secrets are stored unencrypted in etcd by default, and the good practices for Kubernetes Secrets guidance points to external stores delivered through the Secrets Store CSI Driver as an alternative. For a platform team, the appeal is one source of truth in OpenBao, with the cluster holding references to secrets instead of copies of them.

The CSI path fits best when the workload reads configuration from a file path, when images are minimal and cannot host an injected sidecar or agent, or when you want the pod to wait until its secrets exist before the application starts. Weigh the trade-offs before you commit. Secrets arrive as mounted files, so the application or a small wrapper must read them, and any environment variable needs an extra sync step. Dynamic credentials and lease renewal also behave differently from static values, so confirm how the provider handles renewal for each secret type you plan to use. If your main need is rotation without restarting workloads, compare this path with the other delivery methods before you standardize on it.

Before you adopt it, confirm the details against the current OpenBao and Secrets Store CSI Driver documentation, because provider behavior, supported authentication options and version compatibility change between releases. Ask three questions of your own environment: which Kubernetes version and distribution you run, whether your admission controls and Pod Security Standards settings allow the CSI volume and any node-level components the driver needs, and which OpenBao auth method your pods will use. Record those answers in the design document. A pilot in a non-production namespace will show whether your images, reload behavior and node plugin placement match what the documentation describes.

What runs in the cluster and what each part does

Mounting an OpenBao secret into a pod takes several cooperating parts, and each one fails differently. Knowing which part owns which step tells you where to look first when a pod sits in ContainerCreating or a mount comes up empty.

Secrets Store CSI Driver on each node

The node-level driver runs as a DaemonSet and handles the kubelet volume call for any pod that mounts a CSI volume backed by a SecretProviderClass. It calls the provider over a gRPC socket on the node and blocks the pod's volume setup until the provider returns. If the driver pod is missing or unhealthy on a node, pods scheduled there stay in ContainerCreating with mount errors in the pod events, so check the driver DaemonSet on every node pool, not only one.

OpenBao provider container

The provider is the component that talks to OpenBao. It runs alongside the driver on each node, reads the SecretProviderClass referenced by the pod, logs in to OpenBao with the pod's service account token, and fetches the requested secrets. Failures here show up as provider errors in the driver or provider logs, such as a rejected login or a missing secret path, and the pod event usually names the failed mount.

SecretProviderClass objects

A SecretProviderClass is a namespaced custom resource that declares which OpenBao address, role, and secret paths a pod may read. It is the main review point for access, because it defines which secrets become visible to a workload. A typo in a path or role name is usually caught only at mount time, so validate the object in the same change as the workload manifest.

Pod service account

The pod's service account is the identity OpenBao sees. The provider presents the projected token for that account to OpenBao, so the account that gets bound to the OpenBao role determines what the pod can read. Sharing one service account across unrelated workloads widens the blast radius, and a pod that runs under the default service account is a common cause of an unexpected permission denial.

OpenBao Kubernetes auth method

The Kubernetes auth method in OpenBao checks the pod's token with the Kubernetes TokenReview API and maps the verified service account and namespace to an OpenBao role and policy. Each role binds specific service accounts and namespaces to specific policies. A failed login here appears as a permission or authentication error in the provider logs, and the fix is usually in the role binding or the cluster connection settings, not in the pod.

OpenBao auth methods

How a pod gets its secrets at startup

The diagram starts when the kubelet sees a pod that mounts a CSI volume and asks the Secrets Store CSI Driver to prepare it. The driver calls the OpenBao provider, which presents the pod's service account token to OpenBao so that OpenBao can check it with a Kubernetes TokenReview and issue a client token. The provider then reads the secrets named in the SecretProviderClass and writes them into the volume before the container starts. Check that the pod waits for this step and that the optional sync to a Kubernetes Secret is only enabled where env variables are needed.

Startup sequence for a pod mounting OpenBao secrets through the CSI provider.

Which configuration options fit which workload

This table compares the main SecretProviderClass and sync choices for the OpenBao CSI provider, including file mounts, Kubernetes Secret sync and rotation behavior. Read each row against your workload, then confirm the exact key names in the provider documentation before you write manifests.

OptionWhen it fitsTrade-off
File mount with secret objectsApplications that read credentials from a file path and can reload them without a restartSecrets live on a tmpfs volume in the pod, so your application must read the file at the right time and handle changes
Object definitions per secret pathPods that need a small, explicit set of OpenBao paths with clear file namesEach path and file name is a separate entry to maintain, which grows with the number of secrets and teams
Kubernetes Secret sync for environment variablesWorkloads that only accept environment variables, such as some legacy images or Helm chartsSynced values are stored as Kubernetes Secrets, so etcd encryption at rest and tight RBAC on Secret reads become required
Sync disabled, file onlyWorkloads where secrets must not be persisted in etcd at allEnvironment variables are not available, so the application or a wrapper script must read files at startup
Rotation polling enabledLong-running pods where credentials change, such as rotated static secrets or renewed leasesShorter polling intervals raise load on OpenBao and the sync agent, and applications still need to pick up new values
Rotation polling disabledShort-lived jobs and batch pods that read secrets once and exitPods keep the value they read at startup, so a rotated secret requires a pod restart
Startup blocking until secrets are writtenPods that must not start without their credentials, such as database clientsA failed or slow OpenBao call delays or blocks pod startup, so availability of OpenBao affects workload scheduling

How SecretProviderClass objects map OpenBao paths to files

A SecretProviderClass is the file that tells the Secrets Store CSI Driver what to fetch from OpenBao and where to put it. Its provider field selects the OpenBao CSI provider, and its parameters block carries three things: vaultAddress for the OpenBao endpoint, roleName for the Kubernetes auth role the provider logs in with, and objects, a list in which each entry names a KV path to read and the file name to write in the volume. Confirm the exact parameter keys and object syntax against the provider documentation for the release you run, because the provider's configuration follows the Vault provider conventions and small differences matter. One class can serve several pods in the same namespace, but every pod that references it receives the same files. If two workloads need different secrets or different permissions, give each its own role and its own class.

The provider does not read secrets with a static credential. It presents the pod's service account token to OpenBao, so the service account the pod runs as must be listed in the role's bound_service_account_names and the pod's namespace in bound_service_account_namespaces. The role's policy must also allow read on each path listed in objects. When any of these three do not match, the login fails and the pod cannot start, which is usually the first symptom people see. Use a dedicated service account for each workload instead of the namespace default, and test each new class with a single pod before you roll it out to a Deployment. Keep the role's policy narrow: one path per workload is easier to review than a wildcard.

A SecretProviderClass is a namespaced object, so a pod can mount only a class that lives in its own namespace. A class in one namespace cannot be referenced from another, and the namespace is also part of the role binding, so a pod in a different namespace cannot log in with a role meant for its neighbor. Use these boundaries on purpose. Plan namespaces around trust boundaries, and restrict who can create or edit SecretProviderClass objects with Kubernetes RBAC, because anyone who can write a class can point it at a role and paths of their choosing. Review that access as you would any other access to secret paths. Ask your platform team to confirm which admission controls apply to these objects in your clusters before you depend on them for isolation.

Setting up the CSI provider step by step

This sequence takes a cluster from a running OpenBao server to a test pod that reads secrets from a mounted volume, with each step ending in a check you can run. It confirms version support first, then wires authentication, policy, and the SecretProviderClass together so the secrets path can be proven before any production workload depends on it.

  1. Confirm Kubernetes and component version support

    Before installing anything, check the Kubernetes version of your cluster against the supported minor lines on the Kubernetes releases page, and confirm the Secrets Store CSI Driver and OpenBao CSI provider versions you plan to use are compatible with that Kubernetes version and with your OpenBao release. Your platform team owns this check, and DeployOpen will record the result in the design document. You know it is done when the target versions are written down with the source you checked for each one.

  2. Install the Secrets Store CSI Driver

    Install the Secrets Store CSI Driver into its own namespace using the chart or manifests published by the driver project, and enable the options your design needs, such as secret syncing to Kubernetes Secrets if you plan to use environment variables. Confirm the DaemonSet pods are running on every node where workloads will mount secrets. The check is that the driver pods are ready on all eligible nodes and the CSIDriver object exists in the cluster.

  3. Deploy the OpenBao CSI provider

    Deploy the OpenBao provider as a DaemonSet alongside the driver, using the same node selection and tolerations as the driver so every node that runs the driver also runs the provider. Review the provider's socket path and the driver's provider directory settings so both sides agree. The check is that the provider pods are running on each node and their logs show no errors when a pod is later scheduled on that node.

  4. Configure Kubernetes auth with one role per workload

    In OpenBao, enable the Kubernetes auth method, configure it to validate service account tokens against your cluster, and create a policy and a role for each workload or namespace. Bind each role to a specific service account name and namespace, and grant only the read paths that workload needs. Ask your OpenBao administrator to confirm the token review settings for your Kubernetes version. The check is a login test from a pod using its own service account token, which should return a token scoped to that role and nothing broader.

  5. Create the SecretProviderClass

    Create a SecretProviderClass in the workload namespace that names the OpenBao provider, the OpenBao address, the Kubernetes auth role, the secret paths and the file names to write. If you need environment variables, add a secretObjects section to sync selected values into a Kubernetes Secret. Apply it and confirm with kubectl that the object exists and that the referenced role and paths match the names created in the previous step.

  6. Mount the class in a test pod

    Deploy a test pod in the same namespace that uses the same service account bound to the OpenBao role, and mount a CSI volume that references the SecretProviderClass. Use a read-only mount and a minimal image that lets you list the directory. Describe the pod and confirm the volume attached without events reporting permission or provider errors. The check is that the pod reaches Running and the mount path lists the expected files.

  7. Verify file contents and startup blocking

    Read each mounted file and compare its contents to the value stored in OpenBao, using the same secret version. Then test startup blocking by pointing the SecretProviderClass at a path that does not exist or temporarily removing the role's read permission, and confirm the pod stays in ContainerCreating rather than starting without secrets. Restore the correct configuration afterward. The check is that the pod starts only when the secret can be read, and the failure is visible in pod events.

Startup blocking and syncing to Kubernetes Secrets for environment variables

The main operational property of the CSI approach is that a pod does not start until its secrets volume is mounted, which means the Secrets Store CSI Driver must successfully call the OpenBao CSI provider and receive every object named in the SecretProviderClass before the container runs. If OpenBao is unreachable, sealed, or the pod's role in roleName is wrong or lacks read access to the path, the pod stays in a pending or container creating state with mount errors instead of starting with empty or stale values. That is the behavior most teams want, but it changes incident response: a bad policy change or an OpenBao outage shows up first as stuck rollouts and scheduling delays, so alerts should watch for pods stuck on volume mounts. Confirm the exact events and retry behavior in your driver version, and test the failure on a non-production namespace by pointing a role at a path it cannot read.

Environment variables are the common reason teams enable the sync option, which writes the mounted values into a Kubernetes Secret referenced by secretObjects in the SecretProviderClass. That Secret is a separate copy with its own lifecycle. It is stored in etcd, which holds Secrets unencrypted by default, so encryption at rest for the API server must be enabled and verified before the sync is used for real credentials. Anyone who can read or list Secrets in the namespace can also read the synced values, so RBAC should deny list and watch access to Secrets for workloads and most humans, and audit logging should cover reads. The synced Secret also outlives the pod and is removed only when the SecretProviderClass is deleted or the pod that mounts it is gone, which can leave copies behind after rotation.

Before choosing sync, compare it with reading the mounted file, which avoids the etcd copy but requires application changes. Ask your platform team whether encryption at rest uses a KMS provider they control, which namespaces will hold synced Secrets, and how rotation will reach running containers, since environment variables are read only at container start and need a rollout to change. Those answers decide whether the Secret copy is an acceptable trade-off for your workloads.

Security and operational considerations before production

Mounting OpenBao secrets into pods moves credentials into places that Kubernetes and OpenBao each protect differently. The cards below cover the risks that connect those two control planes, from where synced Secrets are stored to how far a pod's identity reaches. Use them as a pre-production checklist and confirm each item against your own cluster and policy set.

Synced Secrets in etcd

When the CSI provider syncs values into a Kubernetes Secret, that copy lives in etcd. Kubernetes stores Secrets unencrypted in etcd by default, so the synced copy is only as protected as your encryption at rest configuration. Confirm that encryption at rest is enabled for Secrets, that etcd backups are encrypted, and that anyone who can read etcd snapshots is treated as having read every synced value.

Secrets good practices

Least-privilege RBAC on Secrets

Any subject that can list or watch Secrets in a namespace can read every synced value in that namespace, even if it never mounts them. Restrict list and watch verbs to the workloads and controllers that need them, and avoid cluster-wide roles that bind Secrets. Review bindings after each release so that a convenient wildcard role does not quietly expose synced credentials.

Good practices

Service account token scope

The CSI provider authenticates each pod with its service account token, so the token's namespace and name decide which OpenBao role the pod can assume. Use a dedicated service account per workload rather than the namespace default, and disable automatic token mounting where a pod does not need the Kubernetes API. Confirm which audience and expiry your OpenBao Kubernetes or JWT role accepts.

Kubernetes authentication

OpenBao policy scope per role

Each OpenBao role should bind one service account to a policy that grants read access only to the paths that workload needs. A broad policy attached to a shared role turns any pod that matches the binding into a path to every secret it covers. Write policies per application and per environment, and test that a pod in one namespace cannot read another namespace's paths.

Rotation of dynamic credentials

Dynamic credentials synced into pods have leases, and a Kubernetes Secret copy does not renew or expire on its own. Decide whether the CSI provider rotation and sync settings will refresh the Secret and whether applications reload values without a restart. Confirm the lease TTL, the rotation interval and how a revoked lease appears to a running pod before you rely on dynamic values.

Audit logging on OpenBao

OpenBao audit devices record requests and responses, which lets you see which role read which path and when. Enable at least one audit device, send logs to storage your security team controls, and confirm that sensitive fields are hashed as your policy requires. Check that log retention meets your own requirements and that alerts cover repeated authentication failures from pod identities.

Pod and cluster baseline checks

Pods that mount secrets should run under the restricted profile in the Pod Security Standards, with non-root users, no privilege escalation and no host path mounts that could expose the secrets volume. Use the CIS Kubernetes Benchmark as a reference checklist for API server, etcd and RBAC settings, and have your team map each finding to a named owner before go-live.

Pod Security Standards

Questions teams ask before the CSI provider goes live

Can our team set up the OpenBao CSI provider on its own?

Yes, many platform teams can, provided they already run Kubernetes and have someone who administers OpenBao. The work combines three areas: the Secrets Store CSI Driver, the OpenBao CSI provider, and OpenBao's Kubernetes auth method with policies per workload. Teams without prior experience usually underestimate the policy and service account mapping, and the startup behavior when a secret is missing. A partner is most useful when the team lacks one of those skills or needs the work done on a fixed schedule. Ask any partner to show how they will test a pod that starts before its secret exists.

What makes the effort for this work go up or down?

Effort rises with the number of clusters, the number of workloads that read secrets, and how many distinct auth paths and policies you need. Sync needs matter as well: mounting secrets as files is simpler than also creating Kubernetes Secrets for environment variables, because the sync adds lifecycle and RBAC questions. The HA design of OpenBao also changes the work, since a single unavailable OpenBao can block pod startup. Workloads that share one service account or that use dynamic credentials need more review than static key/value reads. Ask the partner to list each of these drivers in the quote with the count they assumed.

What access and people do we need to provide?

Expect to provide administrative access to the Kubernetes clusters involved, administrative access to the OpenBao cluster or a sandbox of it, and a non-production cluster where the setup can be tested before production. You also need a named owner for each workload that will mount secrets, because that owner confirms which secret paths and permissions the pod needs. Security or compliance reviewers should be available to approve the policy model. Confirm with the partner which of these access levels they need in writing, and how credentials for the work will be handled and removed afterward.

How does the CSI provider compare with the Agent Injector and External Secrets Operator?

The CSI provider mounts secrets into the pod filesystem through the Secrets Store CSI Driver, so the pod reads files at startup and no sidecar runs next to it. The Agent Injector adds a sidecar that renders templates and renews secrets, which means more running containers to size and monitor. External Secrets Operator syncs secrets into Kubernetes Secret objects, which suits GitOps and environment variables but places values in etcd unless you configure encryption at rest. Kubernetes documentation notes that Secrets are stored unencrypted in etcd by default and points to external stores through the Secrets Store CSI Driver as one option. Compare the three on sidecar overhead, where secret values end up, how renewal works, and how many components your team must upgrade. Ask each candidate to price the same workload set.

What should a quote for this work include?

A quote should follow directly from a written scope, and it should list the clusters, OpenBao environments, and workloads in that scope. It should name each deliverable, such as SecretProviderClass manifests, the OpenBao auth and policy configuration, startup blocking tests, and the decision on whether to sync to Kubernetes Secrets. Ask it to separate one-time work from recurring work such as upgrades of the CSI driver and provider, and to state who performs each upgrade. It should describe the test plan, the acceptance criteria, and the handover documentation. Finally, ask what is excluded, including OpenBao HA design, dynamic credential engines, and any changes to application code.

Which Kubernetes version should we check before going live?

Check the Kubernetes version of every target cluster against the currently maintained minor releases on the Kubernetes releases page before you choose a driver version. Kubernetes maintains the three most recent minor releases, and older clusters need an upgrade plan before the CSI components are installed. Follow the version skew policy when you upgrade the control plane and nodes, since kube-apiserver must be upgraded one minor version at a time. Confirm with the OpenBao and CSI provider documentation which Kubernetes versions each release supports, because that compatibility is what decides the installation plan.

How DeployOpen scopes and delivers CSI provider work

DeployOpen scopes CSI provider work as a fixed engagement with a written scope agreed before any cluster is touched. That scope names the clusters, the OpenBao instance or instances the workloads will authenticate against, the namespaces in play, and the list of workloads that will mount secrets. It also fixes the deliverables: the Secrets Store CSI Driver and OpenBao provider installed in your clusters, the SecretProviderClass objects, the service account and OpenBao role mappings, the optional secretObjects sync configuration, and the test evidence. Everything is deployed inside your own Kubernetes clusters and your own OpenBao, using your accounts, change process and GitOps tooling where you already have one. Confirm early whether your platform team wants these objects managed in Git, because that decision changes how the written scope describes ownership of each file.

The documentation is the part most often skipped in a DIY rollout, so DeployOpen treats it as a deliverable. It covers the role model: which OpenBao auth role each service account maps to, which policy each role carries, and which paths each SecretProviderClass reads. It records the decision for each workload about whether secrets appear only as files on a tmpfs volume or are also synced to a Kubernetes Secret, and why. Startup and failure behavior is tested against the scope, including a pod that starts before its secret exists, an OpenBao outage during pod scheduling, and a rotated secret that a running pod must pick up. Ask for a test matrix in the quote that lists each of these cases and the expected result, so you can verify the outcomes yourself.

After handover, upgrades are where CSI provider setups tend to drift, since the driver, the provider and OpenBao release on separate schedules. DeployOpen offers retainer support for those upgrades and for re-testing startup and rotation behavior after each change. A retainer is a recurring agreement that sits alongside the fixed-scope build, and it is priced from the written scope of ongoing work, not estimated here. Before you sign, confirm which Kubernetes versions your clusters run and which OpenBao release line you are on, check the OpenBao releases page for the current patch series, and agree in writing who approves an upgrade and who performs the rollback test.

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.