Skip to content

Commit

Permalink
Fix Vault Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pratik705 authored and cloudnull committed Mar 1, 2024
1 parent 7ce3bef commit 876817e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ vault-agent-injector-7f9f668fd5-wk7tm 1/1 Running 0 55s
### Initialize Vault

``` shell
kubectl exec vault-0 -n vault -- vault operator init -key-shares=5 -key-threshold=3 -format=json > cluster-keys.json
kubectl exec vault-0 -n vault -- vault operator init -key-shares=3 -key-threshold=2 -format=json > cluster-keys.json
```

This command provides unseal keys and a root token in cluster-keys.json. Keep this information secure.


### Unseal Vault(vault-0)

On vault-0 pod, use any of the 2 unseal keys obtained during initialization:
``` shell
kubectl exec -it vault-0 -n vault -- sh
vault operator unseal
```
Repeat the unseal command as needed with different unseal keys.

### Join Vault Pods to Form a Cluster

``` shell
Expand All @@ -60,9 +70,9 @@ kubectl exec -it vault-2 -n vault -- sh
vault operator raft join -leader-ca-cert=@/vault/userconfig/vault-server-tls/ca.crt https://vault-0.vault-internal:8200
```

### Unseal Vault
### Unseal Vault(vault-1, vault-2)

On each Vault pod (vault-0, vault-1, vault-2), use any of the 3 unseal keys obtained during initialization:
On each Vault pod (vault-1, vault-2), use any of the 2 unseal keys obtained during initialization:
``` shell
kubectl exec -it vault-1 -n vault -- sh
vault operator unseal
Expand All @@ -75,7 +85,7 @@ Repeat the unseal command as needed with different unseal keys.
Use the root token obtained during initialization to authenticate:

``` shell
kubectl exec -it vault-0 -- vault login
kubectl exec -it vault-0 -n vault -- vault login
```

## Validation
Expand Down

0 comments on commit 876817e

Please sign in to comment.