terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

Is it possible to create a kubernetes_manifest without deploying it on the cluster?

Open maonat opened this issue 2 years ago • 7 comments

Terraform version, Kubernetes provider version and Kubernetes version

Terraform version: Terraform v1.3.1
Kubernetes Provider version: 2.16.1
Kubernetes version: 1.24.6

Terraform configuration

resource "kubernetes_manifest" "test" {
  manifest = {
    // ...
  }
}

Question

is there a way to NOT deploy the manifest on the cluster?
I want to use the kubernetes_manifest as validator only which will help me creating multiple manifests without deploying them as I use FLUX and reconciliation for that.
I wasn't able to find anything on the documentation. Thanks!

maonat avatar Dec 12 '22 13:12 maonat

Planning kubernetes_manifest resources actually validates against the resource schema from the cluster, so that should be quite a bit of validation already done.

I'm not sure I fully understand the ask here. Do you need to generate some sort of output from the resources other than applying to the cluster?

alexsomesan avatar Dec 14 '22 16:12 alexsomesan

@alexsomesan

I need to be able to run a terraform apply without having the kubernetes manifest applied on the cluster.

I would like to find myself in a position to create a kubernetes_manifest without the need of applying it because I have flux that apply any manifest i push into the git repository.

So basically my objective is to generate a kubernetes manifest which will be saved on GitHub (thanks to the github provider) without making it apply because of the kubernetes_manifest functionality and this is not possible at the moment.

I hope I explained myself better! Thanks

maonat avatar Dec 14 '22 16:12 maonat

Hello, any update on this?

maonat avatar Mar 25 '23 00:03 maonat

@maonat

Potentially linked to https://github.com/hashicorp/terraform-provider-kubernetes/issues/1917

marziply avatar Jun 05 '23 17:06 marziply

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

github-actions[bot] avatar Jun 05 '24 00:06 github-actions[bot]

Hi, time passed and no update in this... Anyone able to provide some alternatives perhaps?

maonat avatar Jun 05 '24 05:06 maonat

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

github-actions[bot] avatar Jun 06 '25 00:06 github-actions[bot]