Middle
How can a highly available HashiCorp Vault cluster with auto-unseal be built?
sobes.tech AI
Answer from AI
To build a highly available HashiCorp Vault cluster with auto-unseal, the following are typically used:
-
A Vault cluster of multiple nodes configured in HA mode, so that if one node fails, another can continue operating.
-
A backend for data storage supporting HA, such as Consul or Raft, to ensure a consistent state.
-
Auto-unseal — automatic unlocking of Vault at startup using external KMS (Key Management Service), such as AWS KMS, Azure Key Vault, Google Cloud KMS, or HSM.
Example Vault configuration with Raft and AWS KMS for auto-unseal:
storage "raft" {
path = "/vault/data"
node_id = "node1"
}
seal "awskms" {
region = "us-east-1"
kms_key_id = "your-kms-key-id"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 1
}
api_addr = "https://vault.example.com:8200"
cluster_addr = "https://vault.example.com:8201"
Thus, upon restart, Vault automatically unlocks via KMS, and the cluster provides fault tolerance and data consistency.