0

I have been trying to bring up a Vault pod in K8!, I am using vault:1.2.4 and I have added the capability and config in the yaml as mentioned in the official docker page of vault But still, I always get the error:

Error loading configuration from /vault/config/local.json: stat /vault/config/local.json: no such file or directory

This is my deployment yaml:

  containers:
  - name: vault
    command: ["vault", "server", "-config", "/vault/config/local.json"]
    image: "vault:1.2.4"
    imagePullPolicy: IfNotPresent
    env:
      - name: VAULT_LOCAL_CONFIG
        value: '{"backend": {"file": {"path": "/vault/file"}}}'
    securityContext:
      capabilities:
        add:
          - IPC_LOCK
    volumeMounts:
      - name: configurations
        mountPath: /vault/config
        subPath: local.json
      - name: vault
        mountPath: /etc/tls
  volumes:
    - name: configurations
      configMap:
        name: vault
    - name: vault
      secret:
        secretName: vault

As per the doc, local.json should get created, but somehow it doesn't seem to be created, or created with wrong permissions?!

Tried to pull via helm - didn't work (ran into other issues)! Also tried to rebuild a separate container with this config file added, that didn't work either (get the same error)!

I am looking for a simple file based backend, and don't need Consul etc. Please correct me if this deployment config is incorrect, or if I am missing some steps!

Ani
  • 32
  • 12

1 Answers1

1

Duh! I was trying harder than I should! the command: need not be specified as it is built into the container. I removed the command: ["vault"... line and pod could go to Running state.

Ani
  • 32
  • 12