I tried following the guide below for enabling TLS for vault.
And the guide below for CSI Vault
I set up everything but i get the error below on pods
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 12s default-scheduler Successfully assigned fashionhousek8s/create-fashionhousek8s-db-job-4tl4l to ip-172-21-172-255.eu-central-1.compute.internal
Warning FailedMount 5s (x5 over 12s) kubelet MountVolume.SetUp failed for volume "secrets-store-inline" : rpc error: code = Unknown desc = failed to mount secrets store objects for pod fashionhousek8s/create-fashionhousek8s-db-job-4tl4l, err: rpc error: code = Unknown desc = error making mount request: Error loading CA File: open /home/admin/vault/certificates/vault.ca: no such file or directory
Note that this is only defined for the Vault server but not for the CSI DaemonSet (because in that tutorial the csi is not enabled).
The error you’re getting is telling you the vault-csi-provider pods cannot find the CA certificate because it hasn’t been mounted to a volume.
In order to do that, just replicate the same configuration in the csi config section of your values.yaml as csi.volumes and csi.volumeMounts and pass the correct path to the mounted secret in vaultCACertPath
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 80s default-scheduler Successfully assigned fashionhousek8s2/create-fashionhousek8s2-db-job-rdhm9 to ip-172-21-172-255.eu-central-1.compute.internal
Warning FailedMount 16s (x8 over 80s) kubelet MountVolume.SetUp failed for volume "secrets-store-inline" : rpc error: code = Unknown desc = failed to mount secrets store objects for pod fashionhousek8s2/create-fashionhousek8s2-db-job-rdhm9, err: rpc error: code = Unknown desc = error making mount request: Error loading CA File: open /home/admin/vault/certificates/vault.ca: no such file or directory
So i have to unseal 3 times. For vault-0, it did unsealed after 3 times but for vault-1 and vault-2 it stayed sealed like the one on the documentation with a single key.
I’m not very familiar with manual unsealing since I use auto-unseal but I believe if the node/pod has joined the cluster successfully, you should be able to run vault operator unseal without any arguments and it will ask you to input the 3 keys, one at a time.
It should report as unsealed afterwards.
Kind of … you have to re-run vault operator unseal the appropriate number of times, yourself, rather than it repeatedly prompting. This is because in a real deployment using split unseal keys, each key share would be provided by a different person.
When you provide an unseal key, that is going to be used to enable joining a Raft cluster, there is a lot more work for Vault to do, compared to a normal unseal.
As a result, when the automatic vault status display, that is automatically shown by vault operator unseal after submitting the unseal key, is fetched, Vault is still reading as sealed, because it is still processing the cluster join in the background.
If you repeatedly run vault status yourself after this, you will find the vault-1 and vault-2 pods do complete their transition to being unsealed after a little while.