...
Copy the hivemq-license file to the
vault-0
pod.Code Block language bash kubectl cp hivemq.lic vault-0:/tmp/
Verify that the file is copied.
Code Block language bash kubectl exec -it vault-0 -- ls /tmp
Code Block language text hivemq.lic
Start an interactive shell session on the
vault-0
pod.Code Block language bash kubectl exec -it vault-0 -- /bin/sh
Your system prompt is replaced with a new prompt
/ $
. Commands issued at this prompt are executed on thevault-0
container.Enable kv-v2 secrets at the path
hivemq
.Code Block language bash vault secrets enable -path=hivemq kv-v2
Code Block language text Success! Enabled the kv-v2 secrets engine at: hivemq/
Create a secret at path
hivemq/myenv/license
with ahivemq_license_b64
key and base64-encoded/tmp/hivemq.lic
file.Code Block language bash cd /tmp vault kv put hivemq/myenv/license hivemq_license_b64="$(base64 -w 0 hivemq.lic)"
Code Block language text ====== Secret Path ====== hivemq/data/myenv/license ======= Metadata ======= Key Value --- ----- created_time 2024-02-21T17:34:39.261249639Z custom_metadata <nil> deletion_time n/a destroyed false version 1
Verify that the secret is defined at the path
hivemq/myenv/license
.Code Block language bash vault kv get hivemq/myenv/license
Code Block language text ====== Secret Path ====== hivemq/data/myenv/license ======= Metadata ======= Key Value --- ----- created_time 2024-02-21T14:57:01.446984026Z custom_metadata <nil> deletion_time n/a destroyed false version 1 ========= Data ========= Key Value --- ----- hivemq_license_b64 SCFNUSRbM10.......
The secret is ready for the application.
Lastly, exit the
vault-0
pod.Code Block language bash exit
...