-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Fix Terraform error caused by unavailable metrics.k8s.io/v1beta1 #1827
Conversation
command = <<-EOT | ||
kubectl wait --for=condition=AVAILABLE apiservice/v1beta1.metrics.k8s.io --timeout=1200s | ||
kubectl wait --for=condition=ready pods --all -n ${var.namespace} --timeout=1200s | ||
EOT | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of <<-EOT
is documented here.
command = <<-EOT | ||
kubectl wait --for=condition=AVAILABLE apiservice/v1beta1.metrics.k8s.io --timeout=1200s | ||
kubectl wait --for=condition=ready pods --all -n ${var.namespace} --timeout=1200s | ||
EOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previously used --timeout
of -1s
refers to 1 week. Related docs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…gleCloudPlatform#1827) * Improve Terraform's wait_conditions * Update timeouts of kubectl wait
…gleCloudPlatform#1827) * Improve Terraform's wait_conditions * Update timeouts of kubectl wait
Background
terraform apply
errs onkubectl wait
#1813.terraform apply
would successfully deploy a functional Online Boutique, the Terraform output had errors:kubectl wait ... pods ...
is failing because themetrics.k8s.io/v1beta1
resource is not ready.kubectl get apiservices
outputs:v1beta1.metrics.k8s.io
resource is ready beforekubectl wait ... pods ...
.Change Summary
kubectl wait
-ing for Pods, the Terraform nowkubectl wait
s for thev1beta1.metrics.k8s.io
API service.kubectl wait
commands.Testing Procedure
terraform apply
with this change, and it worked!main
branch (to see ifterraform apply
works):Additional info
kubectl get apiservice v1beta1.metrics.k8s.io -o yaml
during the first few minutes after cluster creation outputs: