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

Can't install Gateway-API CRDs with `kubernetes_manifest` due to forbidden 'status' attribute key

Open thetillhoff opened this issue 6 months ago • 0 comments

I can't install the Gateway-API CRDs with the kubernetes_manifest resource. It says 'status' attribute key is not allowed in manifest configuration.

Terraform Version, Provider Version and Kubernetes Version

Terraform version: 1.12.1
Kubernetes provider version: 2.37.1
Kubernetes version: 1.33.1

Affected Resource(s)

Gatway-API CRDs v1.3.0

Terraform Configuration Files

data "http" "gateway_api_crds" {
  url = "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.3.0/standard-install.yaml"

  request_headers = {
    Accept = "text/yaml"
  }

    lifecycle {
    postcondition {
      condition     = contains([200], self.status_code)
      error_message = "Status code invalid"
    }
  }
}

resource "kubernetes_manifest" "gateway_api_crds" {
  for_each = {
    for manifest in provider::kubernetes::manifest_decode_multi(data.http.gateway_api.response_body) :
    "${manifest.kind}--${manifest.metadata.name}" => manifest
  }

  manifest = each.value
}

Debug Output

The link in your Github bug report template forwards me to this page, which isn't useful at all. Couldn't find the page meant manually either. So here are the normal logs:

│ Error: Forbidden attribute key in "manifest" value
│ 
│   with kubernetes_manifest.gateway_api_crds["CustomResourceDefinition--gateways.gateway.networking.k8s.io"],
│   on gateway-api.tf line 17, in resource "kubernetes_manifest" "gateway_api_crds":
│   17: resource "kubernetes_manifest" "gateway_api_crds" {
│ 
│ 'status' attribute key is not allowed in manifest configuration

Steps to Reproduce

Applying the above code to a Kubernetes cluster via Terraform.

Expected Behavior

I'd expect it to install the CRDs contained in the yaml file downloaded via the url.

Actual Behavior

Got said error.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

thetillhoff avatar Jun 02 '25 21:06 thetillhoff