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

Switch to non-abandoned kubectl provider #5

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

js94x
Copy link
Contributor

@js94x js94x commented Jan 6, 2024

Fixes error message "the server could not find the requested resource" on EKS/Kubernetes 1.27 for kubectl_manifest resources

Both resources "kubectl_manifest.karpenter_default_ec2_node_class" and "kubectl_manifest.karpenter_default_node_pool" can not created properly by terraform. This leads to an unfinished state while using this blueprints.

Used EKS version: 1.27

Regardless of whether the k8s resources already exist or not, this error occurs, see here:

terraform apply -target="kubectl_manifest.karpenter_default_ec2_node_class"

kubectl_manifest.karpenter_default_ec2_node_class: Creating...
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [10s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [20s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [30s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [40s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [50s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [1m0s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [1m10s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [1m20s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [1m30s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [1m40s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [1m50s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [2m0s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [2m10s elapsed]
kubectl_manifest.karpenter_default_ec2_node_class: Still creating... [2m20s elapsed]
...
╷
│ Error: default failed to fetch resource from kubernetes: the server could not find the requested resource
│ 
│   with kubectl_manifest.karpenter_default_ec2_node_class,
│   on karpenter.tf line 3, in resource "kubectl_manifest" "karpenter_default_ec2_node_class":
│    3: resource "kubectl_manifest" "karpenter_default_ec2_node_class" {
│ 

The used provider of user gavinbunny seems abandoned, see here:
gavinbunney/terraform-provider-kubectl#270

Therefore I would propose to switch to alekc/kubectl which also fixes the mentioned bug while using kubectl_manifest resource creation.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Fixes error message "the server could not find the requested resource" on EKS/Kubernetes 1.27 for kubectl_manifest resources
@chrismld chrismld self-requested a review January 8, 2024 13:04
@chrismld chrismld merged commit 43476de into aws-samples:main Jan 8, 2024
@chrismld
Copy link
Contributor

chrismld commented Jan 8, 2024

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants