medium.com 7 min read Original Source

πŸ” OpenBao on Kubernetes: Agent Injector vs CSI Provider vs External Secrets Operator

Introduction

A default Kubernetes Secret is base64, not encryption β€” anyone with get secrets RBAC and etcd access can read it in plaintext. That single fact drives most of the architecture decisions in this article. OpenBao, the Linux Foundation fork of HashiCorp Vault, solves secret storage and rotation at the source, but getting a secret from OpenBao into a running pod is not one problem β€” it’s three competing ones, each with a different trust boundary. The Agent Injector puts a sidecar in every pod and keeps secrets in memory. The Secrets Store CSI Driver mounts them into tmpfs through a node-level driver, no sidecar required. External Secrets Operator (ESO) takes the opposite bet: it syncs OpenBao values into native Kubernetes Secrets so your application never has to know OpenBao exists. All three now ship OpenBao-native support β€” openbao-csi-provider, the OpenBao Agent Injector fork, and ESO’s Vault-compatible provider β€” so the choice is no longer “which one works with OpenBao,” it’s “which trust and operational trade-off does your workload actually need.” This article scores all three against a single production cluster running mixed workloads: legacy apps, high-security payment services, and everything in between.

What each approach actually does

Agent Injector relies on a mutating admission webhook. When a pod carries the right annotations, the webhook injects an openbao-agent-init init container and, optionally, a long-running sidecar. That sidecar authenticates against OpenBao using the pod’s ServiceAccount JWT (Kubernetes auth method), fetches secrets, renders them to templated files under /vault/secrets/, and keeps renewing tokens and re-rendering on lease expiry β€” all without the application code knowing OpenBao exists, as long as it can read files.

Secrets Store CSI Driver takes a different path: a SecretProviderClass custom resource declares which secrets to fetch, and a node-resident CSI driver β€” with the openbao-csi-provider binary β€” pulls them at pod mount time and writes them into a tmpfs volume. No sidecar per pod; the driver runs once per node and serves every pod scheduled there. Authentication happens via the mounting pod’s ServiceAccount, same Kubernetes auth method as the injector.

External Secrets Operator doesn’t touch the pod’s runtime at all. A cluster-wide controller reads ExternalSecret and SecretStore custom resources, pulls values from OpenBao through its Vault-compatible provider, and writes them into a standard Kubernetes Secret object. The application reads that Secret exactly as it would any other β€” via env var or volume mount β€” with zero OpenBao awareness required.

πŸš€ Stay Ahead with BenchHub.info

Want to dive deeper into the tools that power today’s tech stacks?

At BenchHub.info, we’re constantly benchmarking the latest AI,DevOps, ML, and Cloud-native tools so you don’t have to.

Don’t get left behind subscribe now and supercharge your tech decisions with data that matters.

🌐 www.benchhub.info

Subscribe here and join a community of builders, engineers, and decision-makers staying sharp in a fast-moving ecosystem.

Where the secret actually lives

This is the axis that matters most for a payment or PII workload, and it’s the one teams skip past fastest.

With the Agent Injector, the secret exists only in the sidecar’s memory and in the files it writes to a shared, in-pod volume β€” never in etcd, never on a persistent disk. Rotation is push-based: the agent watches the lease and re-renders the file when OpenBao issues a new value, so the application picks up fresh credentials without a restart, provided it re-reads the file rather than caching it at startup.

The CSI Driver keeps the secret in tmpfs, which is RAM-backed and never touches disk, but it doesn’t watch leases the way the Agent does. It re-fetches on a rotationPollInterval, and unless the application is wired to watch the mounted file for changes, a rotated secret sits in the volume unused until something restarts the pod. tmpfs is a real security improvement over etcd, but “not in etcd” is not the same guarantee as “actively rotated.”

ESO writes the value into a Kubernetes Secret, which means etcd β€” unless the cluster has encryption-at-rest enabled and RBAC locked down so only the intended ServiceAccount can get it. That’s a real operational burden, not a checkbox: it requires an EncryptionConfiguration with a KMS-backed provider, tight Role/RoleBinding scoping per namespace, and periodic key rotation, none of which ESO manages for you. Get any of that wrong and every ExternalSecret becomes a wide-open door. Rotation is polling-based, same coarse granularity as CSI, and because the application reads a Secret volume mount or env var, most setups need a pod restart to pick up a new value β€” commonly bolted on via a controller like Stakater’s Reloader.

Resource cost and blast radius at scale

The Injector’s overhead is linear: one sidecar per pod, roughly 50–100MB of RAM depending on cache and template settings. On a cluster running a handful of high-value services, that’s a rounding error. On a cluster running a few hundred replicas of a moderate-traffic service, it’s a second application’s worth of memory spent purely on secret delivery, and every pod restart now includes a webhook round-trip and an init container before the app container even starts.

CSI flips that curve: the driver is a DaemonSet, one instance per node, shared across every pod scheduled there. Startup latency drops too, since the driver is already resident when a pod requests its volume β€” no injection webhook delay, no init container. The trade-off is a bigger blast radius per failure: if the node-level driver misbehaves, every pod on that node loses its secrets path, not just one.

ESO’s controller is a single (or small HA set of) deployment for the entire cluster, which is the cheapest model by far and the easiest to reason about at scale β€” one thing to monitor, one thing to scale, clear Kubernetes Event objects when a sync fails. It also means secrets are already synced before a pod deploys, which is the fastest cold-start of the three. The cost shows up elsewhere: RBAC on Secret objects becomes the single most important control in the cluster, because ESO turns “OpenBao access control” into “Kubernetes Secret access control,” and the latter is coarser and easier to misconfigure at scale.

Compatibility with existing applications

This is where ESO wins outright, and it’s the reason most legacy migrations start there. An application that already consumes a Kubernetes Secret β€” via envFrom or a volume mount β€” needs zero code changes to adopt ESO. Swap the manually-created Secret for one an ExternalSecret manages, and the application never notices.

Injector and CSI both require the application to read from the filesystem β€” /vault/secrets/config.json or the CSI mount path β€” which is fine for anything already externalizing config to files, and a real refactor for anything reading from environment variables set at container build time or expecting a specific Secret object to exist. Teams underestimate this cost consistently: “just mount a file” sounds trivial until the app in question is a decade-old JVM service that reads System.getenv() at class-load time.

Table 1 β€” At-a-glance comparison

Table 2 β€” Feature and aspect matrix

ΒΉ Encryption-at-rest (KMS-backed EncryptionConfiguration) mitigates but does not eliminate this; it is a cluster-level control ESO does not manage.

Table 3 β€” Unweighted scorecard

[IMAGE: table_03_unweighted.png]

Scored on hands-on setup with OpenBao 2.x, openbao-helm injector, openbao-csi-provider, and ESO v0.16 against the Vault-compatible provider, October 2026. Raw totals treat every criterion as equally important, and by that measure ESO edges out the other two β€” almost entirely on the strength of app compatibility and scale, categories where it’s built to win.

Table 4 β€” Weighted scoring table

[IMAGE: table_04_weighted.png]

Security and app compatibility are weighted heaviest because they’re the two axes that actually change the shape of a migration: get security wrong and you have an incident, get compatibility wrong and the rollout stalls for months waiting on refactors.

The unweighted scores put ESO in front by four points; weighting for security and compatibility pulls the Agent Injector back into a dead heat at 3.60 apiece, with CSI trailing at 3.30. That flip is the whole story of this comparison: raw feature counting favors ESO because it wins the most individual categories, but the categories it loses β€” security posture, specifically β€” are the ones with the highest cost when they go wrong. A team optimizing purely for developer convenience will read the unweighted table and pick ESO; a team optimizing for a payment or PII workload will read the weighted table and land on the Injector or CSI instead. Neither read is wrong β€” they’re answering different questions.

Which one fits which workload

For a service handling payment data, cryptographic keys, or regulated PII, where the app can be adapted to read from a file, the Agent Injector is the strongest default: secrets never touch etcd, rotation is push-driven, and the sidecar cost is a reasonable price for that guarantee.

For a cluster running hundreds of pods where per-pod sidecar cost is unacceptable but the security bar is still high, the CSI Driver is the pragmatic middle ground β€” tmpfs storage without linear per-pod overhead, at the cost of push-based rotation.

For legacy applications that already consume Kubernetes Secrets, or teams prioritizing rollout speed and operational simplicity over the tightest possible secret storage guarantee, ESO is the correct starting point β€” provided etcd encryption-at-rest and strict Secret-scoped RBAC are treated as mandatory prerequisites, not optional hardening.

In most production setups this isn’t an either/or decision. The common pattern is ESO for legacy and low-sensitivity services, paired with the Injector or CSI Driver for the workloads that actually justify the extra operational cost β€” payment processing, crypto material, anything that would make the incident report interesting.

Conclusion

None of these three tools is “the OpenBao secrets solution” β€” they’re three different answers to where trust boundaries should sit, and OpenBao’s native support for all three means the decision no longer hinges on ecosystem maturity the way it did even a year ago. The real open question for most platform teams isn’t which mechanism to adopt, it’s whether they’re willing to run more than one at once, and whether their RBAC and etcd-encryption posture is actually strong enough to make ESO’s convenience worth its weaker default guarantee. As OpenBao’s own tooling matures independently of its Vault ancestry, expect the gap between these three to narrow on features and widen on exactly this kind of operational discipline.