Running multiple OpenBao Agent Injector replicas with cert-manager

Issuing the Agent Injector webhook certificate with cert-manager lets several injector replicas run behind one admission webhook. This page covers what changes, the configuration options, setup steps and the points to confirm first.

On this page

Running multiple OpenBao Agent Injector replicas with cert-manager: when teams need it

Running several Agent Injector replicas makes sense only when every replica can serve the same webhook identity, and cert-manager is what makes that practical. The Agent Injector is a mutating admission webhook. When the Kubernetes API server creates a pod that carries OpenBao injection annotations, it calls the injector, which adds the OpenBao Agent containers to the pod spec before the pod starts. The API server reaches the webhook over TLS and checks the certificate against a CA bundle stored in the MutatingWebhookConfiguration. Every pod creation in an injected namespace therefore depends on that endpoint and its certificate. The injector's self-signed model is built around one certificate that the injector generates for itself, so it does not extend cleanly to several pods that must present the same identity. Confirm how your chart version generates and stores this certificate before you add replicas.

The case for replicas is availability of admission, not throughput. With one injector pod, a restart, node drain or eviction leaves the webhook unreachable. Whether that blocks pod creation depends on the webhook's failurePolicy and the namespace selector, so check both before you decide. If the policy is Fail, pods with injection annotations cannot start during the gap. If it is Ignore, they start without Agent containers and their secrets never arrive, which is harder to notice. Either outcome justifies running more than one replica behind a Service, plus a PodDisruptionBudget so voluntary drains cannot remove every replica at once. Ask your platform team which failure policy the chart sets and which namespaces are labeled for injection.

Adopting cert-manager adds a dependency your team must operate. cert-manager issues a certificate whose DNS names match the injector Service, a configured issuer signs it, and the CA must reach the webhook configuration. Confirm in the chart documentation for your version whether the injector can read an existing certificate Secret, and whether a component such as cainjector or your own process keeps caBundle current. Plan who owns the issuer, how cert-manager upgrades are tested against the injector, and what happens to pod creation if renewal fails. Before production, test in a non-production cluster by restarting one replica at a time and creating an annotated test pod after each step to confirm the Agent containers are injected.

How the injector webhook, cert-manager and the API server fit together

The diagram starts with the Kubernetes API server, which calls the injector's mutating webhook over TLS when a pod is created. That call crosses the trust boundary, so the API server must trust the certificate the webhook presents. The Service fronts several injector replicas, while cert-manager issues the serving certificate into a Secret that the replicas mount. The caBundle field in the webhook configuration must match that issuer's CA, so check that the chain validates before scaling beyond one replica.

Webhook calls from the API server, with cert-manager supplying the serving certificate and CA bundle.

Which certificate model fits your cluster

The injector chart can generate its own certificate authority and a serving certificate for the admission webhook, so a first install needs no extra components. The chart stores the material in the release namespace and writes the CA bundle into the webhook configuration when it renders. This is the simplest path for evaluation or a single replica, but the trust chain lives inside the release, so scaling out needs more checking.

  • CA ownership: The chart creates the CA, and the platform team does not hold or manage a CA of its own for this webhook.
  • Rotation: Renewal depends on what a helm upgrade reissues. Confirm whether the chart regenerates the certificate on each upgrade and whether the webhook configuration updates in the same release.
  • CA bundle delivery: The chart injects the CA bundle directly, so the API server trusts the webhook without manual steps.
  • Multiple replicas: Confirm in your chart version that this mode supports more than one replica and that every pod serves the same certificate material.

This model fits labs, evaluations and single-replica deployments where no PKI team needs visibility into the webhook CA. Before you scale replicas, check the generated Secret, the caBundle on the webhook configuration and the chart's documented values for generated certificates.

Configuration options and when each fits

This table lists the chart values and cert-manager resources that control the injector's TLS certificate and replica count, with the trade-off each one carries. Confirm exact key names against the chart version you deploy, since they change between releases. The main takeaway is that the certificate source and the issuer scope decide whether the replicas can share one webhook identity safely.

SettingWhat it controlsTrade-off and when to choose it
Injector replica countNumber of injector pods behind the webhook ServiceMore than one replica removes a single point of failure for pod admission, but only works once every replica serves the same certificate. Keep one replica until the certificate source is changed.
Certificate source toggleWhether the chart generates a self-signed certificate or uses one you supplyThe self-signed option is simplest for a single replica. Choose the cert-manager path when replicas must share a certificate that a managed issuer rotates.
Issuer or ClusterIssuer referenceWhich cert-manager issuer signs the webhook certificateAn Issuer stays within one namespace and limits blast radius. A ClusterIssuer lets several namespaces reuse one CA but widens who can request certificates from it.
Certificate durationLifetime of the issued webhook certificateShorter lifetimes reduce exposure if a key leaks but increase renewal activity. Confirm the default duration in your cert-manager version and the chart's expectations.
Renewal windowHow long before expiry cert-manager reissues the certificateA wider window gives more time to notice renewal failures before admission breaks. Too narrow a window risks an outage if the issuer is unavailable near expiry.
DNS names for the webhook ServiceSubject alternative names the certificate must coverNames must match the in-cluster Service DNS the API server calls. A mismatch causes every admission request to fail TLS verification, so confirm the names against the rendered Service.
Webhook failure policyWhat the API server does when the injector cannot respondFail closed blocks pod creation during an outage and protects secret delivery. Fail open lets pods start without injected secrets, which can hide misconfiguration. Choose deliberately and test both paths.

Setup sequence with checks

This sequence takes the injector from its single self-signed certificate to several Ready replicas that share a cert-manager issued certificate, with a check at every step so each change is confirmed before the next one starts. The platform team runs it in a non-production cluster first, then repeats it in production.

  1. Confirm cert-manager health and CRDs

    Before changing anything, the platform team confirms that the cert-manager controller, webhook and cainjector pods are Running in their namespace and that the cert-manager custom resource definitions, including Certificate and Issuer, are installed on the cluster. Check the pods with kubectl get pods in the cert-manager namespace and the CRDs with kubectl get crd. The step is done when every cert-manager pod is Ready and the Certificate and Issuer resource types resolve. If the webhook is not Ready, stop here, because new Certificate objects will not be admitted.

  2. Create the issuer for injector certificates

    The team creates an Issuer or ClusterIssuer that signs certificates for the injector webhook, using the CA source approved by their security team. The resource lives in the namespace where the injector runs, or cluster-wide if the organization prefers a shared issuer. Confirm the issuer's status with kubectl describe issuer and check that its Ready condition is True. Do not reuse a CA that is used for unrelated services unless the security owner has agreed to that trust boundary, and confirm with the security owner which CA source is approved before this step starts.

  3. Set injector values for cert-manager and replicas

    The team updates the Helm values for the OpenBao chart so the injector stops generating its own self-signed certificate and instead reads the TLS secret that cert-manager will produce. They also set the injector replica count to a value greater than one. Confirm the exact value keys against the chart version in use, since key names can change between chart releases, and check them with helm show values. Review the rendered diff in the change record. The step is done when the values file shows the cert-manager integration enabled and the replica count set, and the reviewer has confirmed both.

  4. Run a server-side dry run first

    Before applying the release, the team runs the Helm upgrade with the dry-run option against the target cluster, which renders the manifests and validates them with the API server. They check that the Certificate resource, the injector Deployment with its replica count and the webhook configuration appear in the output. They also confirm that no other release objects are being removed unexpectedly. The step is done when the dry run completes without errors and the rendered objects match the intended change. Keep the rendered output with the change request so the reviewer can compare it with the live state afterward.

  5. Apply the release and verify the Certificate

    The team applies the release, then checks that the Certificate object created by the chart reaches the Ready condition. Use kubectl get certificate and kubectl describe certificate to confirm that cert-manager issued the certificate and that the associated TLS secret exists with the expected subject names for the injector service. If the Certificate stays in a not-ready state, read the events and the issuer status before changing anything else. The step is done when the Certificate reports Ready and the secret contains certificate and key data.

  6. Confirm the webhook caBundle is populated

    The injector's mutating webhook configuration must carry the CA certificate that signed the webhook's serving certificate, or the API server will refuse to call it. The team checks that the caBundle field on the MutatingWebhookConfiguration is populated and matches the issuing CA, which cert-manager's CA injection or the chart's configuration should set. Inspect it with kubectl get mutatingwebhookconfiguration and decode the field. An empty caBundle is a common reason for admission failures, so treat it as a blocking failure. The step is done when the field is set and the chain verifies against the issuer's CA.

  7. Confirm more than one injector pod is Ready

    With the certificate and webhook in place, the team confirms that the injector Deployment has the intended number of pods and that more than one of them reports Ready. Check with kubectl get pods filtered to the injector labels, and review the readiness events if any pod is stuck. Also confirm that the pods are scheduled on different nodes where the cluster allows it, because a single node failure would otherwise remove every replica. The step is done when at least two injector pods are Ready at the same time, and the team has recorded the node placement.

  8. Test injection with a sample workload

    The final check is an end-to-end test. The team deploys a small sample workload in a test namespace, annotated so the injector adds an OpenBao Agent sidecar, and points it at a test secret path and a Kubernetes auth role that the platform team has already configured. They confirm that the pod starts, that the secret file appears at the expected path inside the container, and that the injector logs show the request was handled. They then delete the pod and repeat the test once while one injector replica is stopped, to confirm that another replica takes over. The step is done when the secret is delivered both times and the team has removed the sample workload.

What breaks when replicas share a webhook

The first failure to plan for is certificate drift. When several injector replicas sit behind one Service, they all present the same serving certificate to the kube-apiserver, and the API server trusts that certificate only through the caBundle field on the MutatingWebhookConfiguration. If the certificate expires, is rotated without updating the bundle, or is issued by a CA that no longer matches the bundle, every replica fails the TLS handshake at once. Replicas do not protect you from this because the fault is shared. Confirm how your cert-manager setup injects the CA into caBundle (for example through the cert-manager CA injector annotation) and alert on certificate expiry before it happens.

The second risk is the failure policy. A MutatingWebhookConfiguration with failurePolicy: Fail causes the API server to reject pod creation when the webhook cannot be reached, so an outage of every injector endpoint, or a bad certificate, stops new pods from starting across the namespaces it selects. Check the namespaceSelector and objectSelector so the webhook only matches namespaces that need injection, and confirm which failure policy the chart sets for your version. A third risk is DNS: the serving certificate must list the Service DNS names the API server uses to reach the injector, such as the in-cluster Service name with its namespace and svc suffix. A certificate issued for a different name fails verification even when the pods are healthy. Test all three behaviors in a non-production cluster by scaling the injector to zero, rotating the certificate and breaking the bundle on purpose, then observing whether new pods are blocked.

Upgrades add a fourth failure mode: ordering. Rolling out a new chart version can replace the certificate, the webhook configuration and the injector Deployment in an order that leaves a window where the API server calls a webhook whose certificate no longer matches. Plan the upgrade so the new CA bundle is in place before the serving certificate changes, and run a canary install in a test cluster first. Ask your DeployOpen or internal reviewer to confirm the exact rollout sequence for your chart version before any production change.

Security and operational considerations

Moving the injector webhook to cert-manager changes who holds trust, who can change it and what happens when a certificate expires. The cards below cover the decisions that keep a multi-replica injector secure and renewing without surprises.

Protect the cert-manager CA key

If you use a CA Issuer, the CA private key becomes the root of trust for every webhook certificate it signs. Decide whether that key lives in a Secret inside the cluster, in an external signer or in an HSM-backed service, and document who can read it. A self-signed Issuer keeps the CA key inside the cluster, which is simpler but means a cluster compromise exposes the signing key. Confirm the choice with your security team before the first certificate is issued.

OpenBao on GitHub

Restrict who edits webhook and issuers

Anyone who can edit the MutatingWebhookConfiguration or the cert-manager Issuer and Certificate objects can redirect admission traffic or obtain signing ability. Bind edit rights to a small platform group, scope Issuer permissions to the injector namespace, and review ClusterRole bindings that cover these resource types. Check the bindings after each Helm upgrade, since chart changes can recreate them.

Guard the private key in the Secret

The serving certificate's private key is stored in a Kubernetes Secret in the injector namespace. Anyone with get or list access on that Secret can impersonate the webhook to the API server. Limit Secret read access to the cert-manager controller and the injector service account, avoid copying the Secret into other namespaces, and confirm that etcd encryption at rest is enabled, because Kubernetes Secrets are stored unencrypted in etcd by default.

Secrets good practices

Alert on certificate expiry and renewal failure

cert-manager renews certificates before expiry, but a failed renewal can go unnoticed until the webhook starts rejecting pod creation. Track the Certificate Ready condition and its expiry time, and alert when renewal has not completed within your planned window. Test the alert by pausing the issuer in a non-production cluster. Also confirm that the injector's CA bundle is updated after each rotation.

Scope the injector's OpenBao access

The injector authenticates to OpenBao through its Kubernetes auth role and reads only the secrets its policies allow. Bind the role to the injector service account and namespace, grant read on the specific paths it needs, and avoid broad wildcard policies. Certificate renewal does not change this access, but a certificate issued to the wrong identity would. Review the role and policy whenever the injector configuration changes.

Audit certificate renewals

Record who created or changed the Issuer and Certificate objects, and keep Kubernetes audit logs for Secret updates in the injector namespace. Retain cert-manager events so you can show when each certificate was issued, renewed and rotated. These records support incident response and give auditors evidence that webhook trust is controlled. Ask your platform team which audit policy levels are already enabled on the cluster.

Questions teams ask before running multiple injector replicas

What drives the cost and effort of moving the Agent Injector to cert-manager certificates?

The main drivers are how many clusters and namespaces run the injector, how much of the current setup is hand-managed, and how much change control each cluster requires. Cost has two parts: the time your engineers spend on the change, and any partner fees for the written scope. Work that is one-time includes designing the issuer and certificate chain, updating the Helm values, and testing webhook failover. Recurring work includes certificate renewal monitoring and the review that follows each OpenBao or chart upgrade. Ask any partner to itemize these parts in the quote so you can see what is one-time and what is ongoing.

How long does this typically take, and what changes the timeline?

The timeline depends mostly on cluster count and change control, not on the certificate work itself. A single non-production cluster with a clear issuer design moves faster than several production clusters that each need an approved change window, a rollback plan and a staged rollout. Other factors include whether cert-manager is already installed and supported in your clusters, whether your CA decisions are made, and how many teams must sign off. Ask for a schedule that separates design, test, staged rollout and post-change verification, and confirm which steps depend on your approvals.

What must our team provide before the work starts?

Your team needs to provide access to the target clusters with rights to install cert-manager, edit the OpenBao Helm release and read injector logs. You also need a decision on the certificate authority: whether cert-manager issues from an internal CA, a self-signed issuer chain, or a CA that OpenBao PKI manages. Finally, you need change windows that cover each cluster, named approvers, and a rollback owner. Confirm with your platform team whether the webhook can be briefly disrupted during the switch, because the injector's mutating webhook affects pod creation while it is unavailable.

Can our in-house platform team do this without a partner?

Yes, a team that already runs Helm releases, cert-manager and OpenBao on Kubernetes can make this change internally. The work is bounded: define an issuer, request a certificate for the webhook service name, point the injector configuration at the secret, and run replicas behind the service. The harder part is validating failover and planning upgrades. If no one on the team has tested webhook behavior during pod creation or reviewed certificate rotation, a short external review of the design can reduce risk. Whether a partner is useful depends on your team's capacity and on the controls your auditors expect for production changes.

Which parts of the certificate workflow change when we upgrade OpenBao or the chart?

Upgrades can change the injector's configuration keys, the webhook resource names, and the way the chart expects the CA bundle to be supplied, so review the chart release notes before each upgrade. Run every upgrade with helm upgrade --dry-run first and compare the rendered webhook configuration with the certificate secret. Confirm that the cert-manager Certificate resource still matches the service DNS names used by the webhook. Also check the OpenBao release notes for any change to the injector's image or minimum Kubernetes version, since your cluster versions must stay within the Kubernetes version skew policy.

How do we check that the webhook stays available during certificate renewal?

Test renewal in a non-production cluster before you rely on it. Shorten the certificate duration in a test issuer, let cert-manager renew it, and confirm that the injector pods reload the new CA bundle without a restart gap. Then run pod creation tests during the renewal to confirm admission still succeeds. Monitor the certificate expiry and cert-manager's ready condition, and alert before the remaining lifetime gets short. Ask your partner or internal team to document the exact reload behavior of the chart version you run, because it determines whether a restart is needed.

Does this change affect how pods receive secrets from OpenBao?

The change affects only the TLS certificate used by the injector's admission webhook, not the secrets themselves. Pods still authenticate to OpenBao through their configured auth method, and the injector still renders secrets into the pod. However, if the webhook is unavailable during pod creation, new pods may fail to start or start without injected secrets, depending on the failure policy you configure. Review the webhook failure policy and the namespace selectors before the change, so that a webhook outage does not block unrelated workloads in namespaces that do not use injection.

How DeployOpen scopes and delivers this injector change

DeployOpen scopes this work in writing before any cluster is touched. The first step is a review of the current injector and cert-manager setup: how the Agent Injector was installed, whether its webhook certificate is still issued by the injector's own self-signed mechanism, which MutatingWebhookConfiguration and caBundle fields it populates, which cert-manager version and issuer type are already running, and how the injector's service account, RBAC and pod placement are defined. The review also records which workloads depend on injection today, so the team knows what a webhook outage would block. The output is a written inventory and a short list of gaps that the scope covers.

Next, the client and DeployOpen agree the certificate model in writing. This decision covers the issuer (for example, a cert-manager ClusterIssuer backed by an internal CA or a managed CA), the certificate's DNS names for the injector service, the renewal window, who owns the CA key, and how the caBundle is kept in sync with the webhook configuration. The deliverable is a short design record that names each object and its owner. Engagements are fixed-scope: the components in scope, the non-production cluster used for testing, the failure tests and the handover documents are all agreed before work starts, and the quote follows from that written scope.

The change is deployed and tested first in a non-production cluster, then moved to production under a rollback plan. Testing includes scaling the injector to several replicas, forcing a pod restart on one replica and on all of them, rotating the certificate, and confirming that admission still works while a single replica is down. DeployOpen then hands over runbooks for certificate renewal, CA rotation and webhook failure response. Ongoing support, upgrades and continuous testing are available as a retainer, which the client can add after handover. Confirm with your own team which cluster and change window are available before the scope is signed.

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.