learn-terraform-deploy-nginx-kubernetes-provider
learn-terraform-deploy-nginx-kubernetes-provider copied to clipboard
Error: Waiting for rollout to finish: 2 replicas wanted; 0 replicas Ready
I keep getting the following error:
╷ │ Error: Waiting for rollout to finish: 2 replicas wanted; 0 replicas Ready │ │ with kubernetes_deployment.nginx1, │ on kubernetes.tf line 33, in resource "kubernetes_deployment" "nginx1": │ 33: resource "kubernetes_deployment" "nginx1" { │ ╵
I'm following the tutorial here for the "kind" tab tutorial:
https://learn.hashicorp.com/tutorials/terraform/kubernetes-provider?in=terraform/use-case
Any ideas why this is happening?
Trying to learn with this tutorial but I have no idea why this keeps happening.
Thanks in advance!
I am also getting the same error!
did you find a solution? thanks:)
are you on WSL2? this fixed it for me. was able to diagnose it by running this command
$ kubectl describe pod scalable-nginx-example-xxxx-xxxx
Name: scalable-nginx-example-9cbcdbf9f-9nx88
Namespace: default
...
Containers:
example:
...
Last State: Terminated
Reason: Error
Exit Code: 139 # <====
Started: Wed, 20 Apr 2022 13:36:49 +0800
Finished: Wed, 20 Apr 2022 13:36:49 +0800
Same issue, how to resolve it.
Hey, were you able to resolve the issue?
Had the same problem. I fixed this by setting the CPU in the limits
to 500m
. Originally it was 0.5
that does not seem right. This is the working deployment:
resource "kubernetes_deployment" "nginx" {
metadata {
name = "scalable-nginx-example"
labels = {
App = "ScalableNginxExample"
}
}
spec {
replicas = 2
selector {
match_labels = {
App = "ScalableNginxExample"
}
}
template {
metadata {
labels = {
App = "ScalableNginxExample"
}
}
spec {
container {
image = "nginx:1.7.8"
name = "example"
port {
container_port = 80
}
resources {
limits = {
cpu = "500m"
memory = "512Mi"
}
requests = {
cpu = "250m"
memory = "50Mi"
}
}
}
}
}
}
}
I face the same issue. @gRizzlyGR I changed the resource limit and still it is showing the same error. Can any one please help me here? Thanks in advance.
@reshmagcp or if anyone is still facing that issue, for me updating the value of nginx to an up-to-date image (for me it was 1.24.0) did work, when otherwise it wouldn't. I also changed the cpu value as suggested by @gRizzlyGR , but at first I still faced the issue. But referencing the up-to-date nginx image worked.
Thanks a lot @gRizzlyGR @l1gh7w34ver , only applying both recommendationed works for me:
- updated CPU to 500m
- set nginx to 1.25.3