Is there a way to do that with helm?
No. Reading helm/helm #3553 (comment), this doesn't seem possible if the templates don't have a metadata.namespace
field.
They notably advertise to use helm template | kubectl apply --namespace foo
. If that doesn't work for you, kustomize might be another option.
You could also open an issue in the repository elastic/helm-charts to discuss the feature.