Why am I getting errors in this simple kubernetes hashicorp vault operator test project?

54 Views Asked by At

For a school assignment I have to (as a part of many things) implement Hashicorp's Vault Secret Operator. I'm using a guide for this on baeldung (https://www.baeldung.com/spring-vault-kubernetes-secrets) and am currently stuck with some errors.

I have executed kubectl apply -f [filename.yaml] on the following files:

vaultconnection.yaml:

apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultConnection
metadata:
  namespace: wout
  name: vault-local
spec:
  address: http://vault.vault.svc.cluster.local:8200

vaultauth.yaml:

apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultAuth
metadata:
  namespace: wout
  name: wout-test
spec:
  vaultConnectionRef: vault-local
  method: kubernetes
  mount: kubernetes
  kubernetes:
    role: wout-test-role
    serviceAccount: vault-test-sa

and lastly vaultstaticsecret.yaml:

apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultStaticSecret
metadata:
  namespace: wout
  name: wout-test
spec:
  vaultAuthRef: wout-test
  mount: secrets
  type: kv-v2
  path: wout-test
  refreshAfter: 60s
  hmacSecretData: true
  destination:
    create: true
    name: wout-test

Yet when executing kubectl get secret -n wout wout-test I get the following error:

Error from server (NotFound): secrets "wout-test" not found

Does anyone know what I am doing wrong? I'm quite certain it's something wrong in my yaml files but I can't figure out what!

Thanks a lot if anyone takes a look at this.

0

There are 0 best solutions below