Files
homelab-infra/infrastructure/openbao/terraform/monitoring.tf
T
panxiao81 834f654941
yaml / yaml (push) Successful in 35s
terraform / validate (push) Successful in 1m43s
ansible / collection-test (push) Successful in 1m55s
ansible / lint (push) Successful in 2m48s
接入 OpenBao 受鉴权监控并修复快照续期 (#162)
Co-authored-by: panxiao81 <[email protected]>
2026-09-25 20:39:31 +00:00

16 lines
618 B
Terraform

# 指标只读身份;vmagent 的 Bao Agent sidecar 使用 Pod SA 自动登录与续期。
resource "vault_policy" "metrics" {
name = "metrics"
policy = file("${path.module}/policies/metrics.hcl")
}
resource "vault_kubernetes_auth_backend_role" "metrics" {
backend = "kubernetes"
role_name = "metrics"
bound_service_account_names = ["vmagent-main"]
bound_service_account_namespaces = ["monitoring"]
token_policies = [vault_policy.metrics.name]
token_ttl = 900
token_max_ttl = 3600
}