gavinbunney / terraform-provider-kubectl

Terraform provider to handle raw kubernetes manifest yaml files
https://registry.terraform.io/providers/gavinbunney/kubectl
Mozilla Public License 2.0
619 stars 105 forks source link

[Feature request] Specify namespace in kubectl_manifest resource #154

Open g1augusto opened 2 years ago

g1augusto commented 2 years ago

Hi and thanks for this provider,

I think it could be really useful to have an option to apply a specific namespace when importing YAML files in _kubectlmanifest .

At the moment is only possible by applying the namespace directly into the YAML file but it would be better to decouple the two things.

I would like to see something like this :

resource "kubectl_manifest" "sample" {
    yaml_body = file("sample.yaml")
    namespace = "sample-namespace"
}

this would have the effect of running :

kubectl apply -f sample.yaml --namespace=sample-namespace

Thanks!

nicoodle commented 2 years ago

Is this functionality not provided by the override_namespace argument?

g1augusto commented 2 years ago

@nicoodle Perhaps you are right, I will test.

Most likely I didn't think about it because there isn't an example in the documentation, my bad