tolerate transient k8s api fails
Homelab Main / validate (push) Waiting to run Details
Homelab Main / deploy (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-09-26 09:19:46 -06:00
parent 6967423002
commit 0f37945f51
1 changed files with 12 additions and 4 deletions

View File

@ -445,7 +445,7 @@ resource "null_resource" "kube_system_resource_policy" {
triggers = { triggers = {
kubeconfig_path = var.kubeconfig_path kubeconfig_path = var.kubeconfig_path
resource_policy_version = "2" resource_policy_version = "3"
} }
provisioner "local-exec" { provisioner "local-exec" {
@ -508,11 +508,19 @@ wait_for_apiserver_ready() {
} }
wait_for_apiserver_stable() { wait_for_apiserver_stable() {
wait_for_apiserver_ready stable_checks=0
for _ in $(seq 1 6); do for _ in $(seq 1 120); do
if kubectl --kubeconfig "${self.triggers.kubeconfig_path}" get --raw=/readyz >/dev/null 2>&1; then
stable_checks=$((stable_checks + 1))
if [ "$stable_checks" -ge 6 ]; then
return 0
fi
else
stable_checks=0
fi
sleep 5 sleep 5
kubectl --kubeconfig "${self.triggers.kubeconfig_path}" get --raw=/readyz >/dev/null
done done
kubectl --kubeconfig "${self.triggers.kubeconfig_path}" get --raw=/readyz >/dev/null
} }
patch_static_pod_resources etcd 100m 256Mi 1000m 2Gi patch_static_pod_resources etcd 100m 256Mi 1000m 2Gi