Skip to content

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

@thetillhoff

Description

@thetillhoff

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @arybolovlev@thetillhoff

      Issue actions

        Can't install Gateway-API CRDs with `kubernetes_manifest` due to forbidden 'status' attribute key · Issue #2739 · hashicorp/terraform-provider-kubernetes