My requirement is - Setting up highly available vault on kubernetes cluster & Migrating data from existing vault to new vault(which will be setup on k8s).
Couple of questions on this
Do we have any operator which is recommended by Hashicorp for setting up vault on kubernetes cluster?
what is the best way for migrating secrets from one vault to another?
WIth that setup there are two best possibilities, one easier than the other.
You migrate (using vault operator migrate) from etcd to Raft storage.
After this you can follow the standard backup guide to then restore the data on the new cluster.
AWS KMS will take care of the rest of the process.
Backup the etcd cluster only to then restore the etcd cluster on the new cluster.
AWS KMS will take care of the rest of the process.
Some notes:
I recommend if you decide to get with the first option to backup Raft on your Raft leader. You can identify the leader in the outcome of the command vault operator raft list-peers
When migrating, due to that you export the data outside of Vault, I recommend rotating your encryption keys.
Thanks for your reply I have tried the same steps but getting below error, the issue may be because vault is running mode but not sure how can I stop in pod
Error migrating: error mounting âstorage_destinationâ: failed to create fsm: failed to open bolt file: timeout
I have migrated all the data to s3 bucket then then I logged in to my pod and created migrate.hcl file with below content
storage_source âs3â {
bucket = âxxxxxâ
region = âxxxxxâ
access_key = âxxxxxâ
secret_key = âxxxxxâ
session_token = ââ
I have migrated the data from gcp bucket to s3 bucket thatâs why my source is s3 also if you can see the issue is with destination not the source, I have gone through itâs document operator migrate - Command | Vault by HashiCorp they mentioned that itâs an offline but I am doing it in k8 cluster so how can I stop vault
When I migrate from file storage to raft storage it creates a vault.db and a raft.db file. But to restore the data on the new cluster I need a .snap file. So I donât understand how to migrate using option 1? Can you please explain in more detail?
If you are migrating file to raft outside of the final destination cluster, you would need to start up a running Vault using your temporary migrated Raft data, and make a backup snapshot from that. You could then restore that snapshot into the final target cluster.