Cannot launch Vault from Helm on kubernetes

2/28/2020

I'm trying to follow along the Hashicorp docs to set up a Vault instance

https://www.youtube.com/watch?v=_r368h-mxxs&t=94s https://www.vaultproject.io/docs/platform/k8s/helm/run/

To start of with the initialisation I run

helm --namespace=myvault --name=vault .

But when I try to initialise the Vault instance itself with

kubectl --namespace=vault exec -it vault-0 -- vault operator init

I get the error

Error from server (BadRequest): pod vault-0 does not have a host assigned

Running

kubectl --namespace=vault describe pods vault-0

gives the error

Warning  FailedScheduling  60s (x21 over 10m)  default-scheduler  pod has unbound immediate PersistentVolumeClaims (repeated 3 times)

Is there a setting that I'm missing and not shown in the docs that needs set for this to work?

Running on prem Centos 7 cluster with 3 nodes

-- CEamonn
hashicorp-vault
kubernetes
kubernetes-helm

1 Answer

2/28/2020

Vault is deployed as StatefulSet which has volumeClaimTemplates

volumeClaimTemplates:
  - metadata:
      creationTimestamp: null
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      volumeMode: Filesystem

It seems for some reason the PVC and PV is not created and the pod needs to be bound to a PVC before it can be started. Below commands should give some clue.

kubectl describe pvc
kubectl describe pv
kubectl describe sc

If there is no default storage class you may need to create it so that the PersistentVolumeClaim can take the storage from there

-- Arghya Sadhu
Source: StackOverflow