bank-vaults / vault-operator

Kubernetes operator for Hashicorp Vault
https://bank-vaults.dev/docs/operator/
Apache License 2.0
53 stars 21 forks source link

Banazai operator : CA secrets distributed by operator in all namespace causing errors in Cert Manager Ca Injector #478

Closed kumarBiplab1987 closed 1 month ago

kumarBiplab1987 commented 1 month ago

Preflight Checklist

Operator Version

v1.22.1

Installation Type

Helm

Bank-Vaults Version

v1.31.0

Kubernetes Version

v1.25.5

Kubernetes Distribution/Provisioner

rancher

Expected Behavior

When distributing CA certs through operator it should not copy the cert manager annotations in the vault tls secrets.

Actual Behavior

We are using cert manager to manage the certificates of all vault services in our kubernetes cluster. When we are trying to create a namespace for our services, Banzai is automatically creating secret includes ca cert in that namespace, which is having cert manager annotations in the metadata of the secret resource and cert manager CA injector pod is complains that associated certificates resource with the secret is not present in that namespace.

cert-manager/secret-for-certificate-mapper "msg"="unable to fetch certificate that owns the secret" "error"="Certificate.cert-manager.io "vault" not found" "certificate"={"Namespace":"infra","Name":"vault"} "secret"={"Namespace":"infra","Name":"vault-tls"}

Steps To Reproduce

  1. Install Banzai vault operator.
  2. Use Cert manager to generate vault certificates.
  3. Use "existingTlsSecretName: vault-tls" in the crd when bringing up the vault services.

Configuration

No response

Logs

Logs from the cert manager CA injector
cert-manager/secret-for-certificate-mapper "msg"="unable to fetch certificate that owns the secret" "error"="Certificate.cert-manager.io "vault" not found" "certificate"={"Namespace":"infra","Name":"vault"} "secret"={"Namespace":"infra","Name":"vault-tls"}

Additional Information

No response

kumarBiplab1987 commented 1 month ago

Linking the existing defect https://github.com/bank-vaults/vault-operator/issues/124

csatib02 commented 1 month ago

Closing in favour of the original issue: https://github.com/bank-vaults/vault-operator/issues/124