how to read vault and write it into different namespace

I’m using hashcorp vault in the current kubernetes environment that I’m working at. We got many namespaces that require the same setup include secrets. I was stuck in a situation which need to write vault into multiple namespace (environments) with the same value within the kubernetes cluster.

I know I can write json into the vault. However, rather than read it from local laptop. I’ve rather read it from other completed namespace and write into the new namespaces.

Hashicorp vaults have a really good documentation on that. So after the investigation. I’ll be able to do the following:

vault read secret/dev/s.p12 -format=json | jq -r .data | vault write secret/uat/s.p12 -