OpenBao operations guide
Use this guide to initialize, log in to, and operate the Helm-deployed OpenBao instance in this repository. For the active GCP KMS seal, read the auto-unseal runbook first.
The manifests in this repo deploy OpenBao in namespace openbao with the
service openbao.openbao.svc:8200 and a single-node Raft backend.
Source manifests live under kubernetes/apps/production/openbao/.
Check prerequisites
kubectlis configured for the target clusterbaois available in the OpenBao container or installed locally- You have access to the
openbaonamespace
Check pod status
Before initialization, confirm that the pod exists:
For this chart layout, the main pod is usually openbao-0.
Open a shell in the pod
Run bao inside the pod to connect directly to the local listener:
Inside the pod, set:
Check the current state:
Before initialization, the output should show that OpenBao is not initialized.
Initialize OpenBao
Initialize the instance once:
With the active GCP KMS auto-unseal configuration, the command prints:
- recovery keys
- initial root token
This output is highly sensitive.
For one recovery key share with a threshold of one:
Choose a threshold that matches the recovery process. Do not lower the threshold only to make bootstrap easier.
Unseal OpenBao
The active GCP KMS seal should unseal OpenBao automatically. Skip this section
when bao status reports Sealed false.
For a Shamir-sealed installation, unseal with a generated unseal key:
Paste one unseal key when prompted.
If you used multiple key shares, repeat with enough keys to meet the threshold.
Check the status again:
The output should include:
Initialized trueSealed false
Log in
Use the initial root token from bao operator init:
Paste the root token when prompted.
For a non-interactive login, run:
To export the root token for the current shell, run:
Confirm access:
Use the basic CLI
If you need a secrets engine, enable it:
If secret/ already exists, this command fails. Skip the command.
Write a secret:
Read the secret:
Read one field:
List secrets under a prefix:
Delete a secret version:
Use bao from a workstation
Access OpenBao from your workstation with port forwarding:
In another shell, use the local end of the port forward:
Use common commands
Check status:
Show enabled auth methods:
Show enabled secrets engines:
Enable Kubernetes auth:
Read a policy:
Follow operational limits
- Initialize each OpenBao cluster only once.
- Unseal is required after startup unless you configure auto-unseal.
- Do not store unseal keys or root tokens unencrypted in Git.
- Create less-privileged policies and tokens after bootstrap. Do not keep using the root token for normal automation.
Troubleshoot OpenBao
If bao status shows seal configuration missing, not initialized, the server
has not been initialized yet.
If bao status shows Sealed true, run bao operator unseal with enough keys.
If the pod runs but is not ready, inspect the logs:
The StatefulSet uses an OnDelete update strategy. Restart the pod directly:
With the active GCP KMS seal, the replacement pod should unseal itself. If it does not, follow the auto-unseal runbook. Do not initialize it again.
Configure the admin policy and OIDC
The following commands create a broad admin policy and an Authentik OIDC role. Run them only after you review the policy and replace blank client credentials.
bao policy write admin - <<'EOF'
path "*" {
capabilities = ["create", "read", "update", "delete", "list", "sudo"]
}
EOF
bao write auth/oidc/config oidc_discovery_url="https://auth.igresc.com/application/o/open-bao/" oidc_client_id="" oidc_client_secret="" default_role="authentik-admin"
bao write auth/oidc/role/authentik-admin - <<'EOF'
{
"role_type": "oidc",
"user_claim": "preferred_username",
"groups_claim": "groups",
"oidc_scopes": "openid,profile,email,groups",
"allowed_redirect_uris": [
"http://localhost:8250/oidc/callback",
"https://vault.local.isabelsoler.es/ui/vault/auth/oidc/oidc/callback",
"https://vault.local.isabelsoler.es/oidc/callback"
],
"policies": ["admin"],
"ttl": "1h",
"bound_claims": {
"groups": ["openbao-admins"]
}
}
EOF