Search code examples
hashicorp-vault

How to connect vault CLI to Vault Cluster installed on k8s?


I have installed the vault cluster in k8s (AKS), now i try to connect to that cluster with vault CLI
the problem is i can't find any info or documentation .
i downloaded the vault.exe, but where do I configure it to connect to the cluster?


Solution

  • You need to export some env to use the vault CLI:

    // Your vault server address
    $ export VAULT_ADDR=https://127.0.0.1:8200
    
    // vault token
    $ export VAULT_TOKEN= "****"
    
    // If your server is secured with TLS
    $ export VAULT_CACERT=ca.crt 
    $ export VAULT_CLIENT_CERT=tls.crt
    $ export VAULT_CLIENT_KEY=tls.key 
    

    Now, you ready to use the vault CLI.

    $ vault status
    Key             Value
    ---             -----
    Seal Type       shamir
    Initialized     true
    Sealed          false
    ... ... ...