copy secret from one namespace to another code example
Example 1: kubectl copy secret namespace
kubectl get secret <secrt_name> --namespace=<namespace1_name> --export -o yaml |\
kubectl apply --namespace=<namespace2_name> -f -
Example 2: copy secret from one namespace to another
kubectl get secret <secret-name> -n <source-namespace> -o yaml \
| sed s/"namespace: <source-namespace>"/"namespace: <destination-namespace>"/\
| kubectl apply -n <destination-namespace> -f -