Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Copy the hivemq-license file to the vault-0 pod.

    Code Block
    languagebash
    kubectl cp hivemq.lic vault-0:/tmp/
  2. Verify that the file is copied.

    Code Block
    languagebash
    kubectl exec -it vault-0 -- ls /tmp
    Code Block
    languagetext
    hivemq.lic
  3. Start an interactive shell session on the vault-0 pod.

    Code Block
    languagebash
    kubectl exec -it vault-0 -- /bin/sh

    image-20240802-143511.pngImage Modified

    Your system prompt is replaced with a new prompt / $. Commands issued at this prompt are executed on the vault-0 container.

  4. Enable kv-v2 secrets at the path hivemq.

    Code Block
    languagebash
    vault secrets enable -path=hivemq kv-v2
    Code Block
    languagetext
    Success! Enabled the kv-v2 secrets engine at: hivemq/
  5. Create a secret at path hivemq/myenv/license with a hivemq_license_b64 key and base64-encoded /tmp/hivemq.lic file.

    Code Block
    languagebash
    cd /tmp
    vault kv put hivemq/myenv/license hivemq_license_b64="$(base64 -w 0 hivemq.lic)"
    Code Block
    languagetext
    ====== 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
  6. Verify that the secret is defined at the path hivemq/myenv/license.

    Code Block
    languagebash
    vault kv get hivemq/myenv/license
    Code Block
    languagetext
    ====== 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.

  7. Lastly, exit the vault-0 pod.

    Code Block
    languagebash
    exit

...