Search code examples
hashicorp-vaultvault

Error initializing: context deadline exceeded Hashicorp Vault


We installed a 3 node Vault cluster in HA mode on a GKE cluster using this Git Repo.

Below is the status of Pods before initializing the vault.

enter image description here

We logged into the vault-0 pod and tried initializing the vault but received the below error.

enter image description here

Below is the status of the vault after we receive this error.

enter image description here

Below is the status of the PVC.

enter image description here

This shows that the vault has been initialized but we received an error instead of tokens and keys. We referred to this article for this error but no fate. Please help us to resolve this.


Solution

  • I think you're using it within a Private GKE Cluster.

    If so, and you are using the injector, you need to open the tcp:8080 port to the controlplane.

    Here is a little gcloud command to do it quickly.

    MASTER_GKE_RULE=$(gcloud compute firewall-rules list --filter="name~YOURCLUSTERNAME-[0-9a-z]*-master" --format=json  | jq -r '.[0] | .name')
    
    gcloud compute firewall-rules update $MASTER_GKE_RULE --allow tcp:8080,tcp:10250,tcp:443,tcp:8443
    

    Don't forget to replace YOURCLUSTERNAME with the actual name of your cluster.

    If you wanna read more informations about this issue : Click here