需要 Vault 兼容的密钥管理,但希望使用开源治理的替代方案。OpenBao 是 Vault 的社区分支,保留 KV、PKI、Transit、Kubernetes 认证等能力。
helm repo add openbao https://openbao.github.io/openbao-helm/
helm install openbao openbao/openbao \
--namespace openbao --create-namespace \
--set server.ha.enabled=true \
--set server.ha.raft.enabled=true \
--set server.dataStorage.size=20Gi
kubectl -n openbao get pods
kubectl -n openbao exec -it openbao-0 -- bao operator init
kubectl -n openbao exec -it openbao-0 -- bao operator unseal <KEY_1>
kubectl -n openbao exec -it openbao-0 -- bao operator unseal <KEY_2>
kubectl -n openbao exec -it openbao-0 -- bao operator unseal <KEY_3>
kubectl -n openbao exec -it openbao-0 -- bao login <ROOT_TOKEN>
kubectl -n openbao exec -it openbao-0 -- bao secrets enable -path=secret kv-v2
kubectl -n openbao exec -it openbao-0 -- bao kv put secret/demo/db username=app password='***'
bao auth enable kubernetes
bao write auth/kubernetes/config kubernetes_host="https://kubernetes.default.svc"
bao write auth/kubernetes/role/demo \
bound_service_account_names=demo \
bound_service_account_namespaces=demo \
policies=demo-read ttl=1h
bao audit enable file file_path=/openbao/logs/audit.log
bao operator raft snapshot save /openbao/backup/openbao.snap
bao status 显示未封存且 HA 正常。bao operator seal,会中断动态凭据。data/,否则读不到。bao — 初始化、解封、策略和快照kubectl — 查看 Pod 和日志helm — 安装和升级openssl — 证书检查