Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes_manifest - Failed to determine GroupVersionResource for manifest #1873

Closed
papanito opened this issue Oct 14, 2022 · 3 comments
Closed

Comments

@papanito
Copy link

Terraform Version, Provider Version and Kubernetes Version

Terraform version: 1.3.2
Kubernetes provider version: v2.11.0
Kubernetes version: 1.23

Terraform Configuration Files

resource "kubernetes_manifest" "opa-podmonitor" {
  manifest = {
    apiVersion = "monitoring.coreos.com/v1"
    kind = " PodMonitor"
    metadata = {
      name = "opa-pod-monitor"
      namespace = "cattle-gatekeeper-system"
      labels = {
          team = "skywalkers"
      }
    }
    spec = {
      selector = {
        matchLabels = {
          "gatekeeper.sh/operation" = "audit"
        }
      }
      podMetricsEndpoints = {
        
      }
    }
  }
}

Debug Output

TBD

Steps to Reproduce

  1. terraform plan

Expected Behavior

Terraform plan just runs fine

Actual Behavior

Error when running terraform plan

│ Error: Failed to determine GroupVersionResource for manifest
│
│   with kubernetes_manifest.opa-podmonitor,
│   on gatekeeper.tf line 12, in resource "kubernetes_manifest" "opa-podmonitor":
│   12: resource "kubernetes_manifest" "opa-podmonitor" {
│
│ no matches for kind " PodMonitor" in group "monitoring.coreos.com"

Important Factoids

APIs are there

$ kubectl get apiservices | grep monit
v1.monitoring.coreos.com                     Local                                                            True        19h
v1alpha1.monitoring.coreos.com               Local                                                            True        19h
v1alpha1.monitoring.kiali.io                 Local    

I can manually add it using the Rancher UI
image

References

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
@papanito papanito added the bug label Oct 14, 2022
@github-actions github-actions bot removed the bug label Oct 14, 2022
@jrhouston
Copy link
Collaborator

I see there's some stray whitespace here:

 kind = " PodMonitor"

Could you try removing it and see if you get the error? We might need to add some whitespace stripping somewhere for kind.

@papanito
Copy link
Author

@jrhouston thanks that was it - was probably too tired on Friday to see it :-P

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants