Make Argo controller readiness wait configurable and report concise rollout diagnostics
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-11-03 07:53:50 -06:00
parent 23932cd7e1
commit 0530077129
3 changed files with 30 additions and 4 deletions

View File

@ -8,6 +8,12 @@ native Orange Pi target uses `LAB_CLUSTER_PROFILE=k3s` and
complete before `./jeannie apps` runs. The transition command sequences
these stages and stops when a prerequisite fails.
The Argo CD application-controller gate waits for the StatefulSet rollout, not
just a Ready pod that might belong to an older revision. Its default budget is
600 seconds; `LAB_ARGOCD_READY_WAIT_SECONDS` changes that bounded wait. Failure
output shows desired/ready/updated counts, revisions and recent warnings without
dumping the full StatefulSet environment. It does not restart the controller.
Application deployment verifies identity, renders scheduling estimates and
discovers retained registry placement. A one-core VM is allowed when its
reservations and placement permit the rollout; native K3s does not require old

View File

@ -8,6 +8,12 @@ native Orange Pi target uses `LAB_CLUSTER_PROFILE=k3s` and
complete before `./{{ main_script }} apps` runs. The transition command sequences
these stages and stops when a prerequisite fails.
The Argo CD application-controller gate waits for the StatefulSet rollout, not
just a Ready pod that might belong to an older revision. Its default budget is
600 seconds; `LAB_ARGOCD_READY_WAIT_SECONDS` changes that bounded wait. Failure
output shows desired/ready/updated counts, revisions and recent warnings without
dumping the full StatefulSet environment. It does not restart the controller.
Application deployment verifies identity, renders scheduling estimates and
discovers retained registry placement. A one-core VM is allowed when its
reservations and placement permit the rollout; native K3s does not require old

View File

@ -7150,11 +7150,25 @@ require_argocd_application_controller() {
local namespace="${TF_VAR_argocd_namespace:-argocd}"
local expected_resources="10m|1|2Gi"
local actual_resources
local timeout_seconds="${LAB_ARGOCD_READY_WAIT_SECONDS:-600}"
if ! kubectl --kubeconfig "${KUBECONFIG_PATH}" -n "${namespace}" rollout status statefulset/argocd-application-controller --timeout=300s; then
if ! [[ "${timeout_seconds}" =~ ^[1-9][0-9]*$ ]]; then
echo "LAB_ARGOCD_READY_WAIT_SECONDS must be a positive number of seconds." >&2
return 2
fi
echo "Waiting up to ${timeout_seconds}s for the Argo CD application-controller rollout..."
if ! kubectl --kubeconfig "${KUBECONFIG_PATH}" -n "${namespace}" rollout status statefulset/argocd-application-controller --timeout="${timeout_seconds}s"; then
echo "Argo CD application controller did not become ready; refusing to start application deployment." >&2
kubectl --kubeconfig "${KUBECONFIG_PATH}" -n "${namespace}" get pods -o wide >&2 || true
kubectl --kubeconfig "${KUBECONFIG_PATH}" -n "${namespace}" describe statefulset argocd-application-controller >&2 || true
kubectl --kubeconfig "${KUBECONFIG_PATH}" --request-timeout=10s -n "${namespace}" \
get statefulset argocd-application-controller \
-o custom-columns='NAME:.metadata.name,GEN:.metadata.generation,OBSERVED:.status.observedGeneration,DESIRED:.spec.replicas,READY:.status.readyReplicas,UPDATED:.status.updatedReplicas,CURRENT-REV:.status.currentRevision,TARGET-REV:.status.updateRevision' >&2 || true
kubectl --kubeconfig "${KUBECONFIG_PATH}" --request-timeout=10s -n "${namespace}" get pods \
-l app.kubernetes.io/name=argocd-application-controller \
-o custom-columns='NAME:.metadata.name,PHASE:.status.phase,READY:.status.containerStatuses[*].ready,RESTARTS:.status.containerStatuses[*].restartCount,WAITING:.status.containerStatuses[*].state.waiting.reason,REVISION:.metadata.labels.controller-revision-hash' >&2 || true
kubectl --kubeconfig "${KUBECONFIG_PATH}" --request-timeout=10s -n "${namespace}" get events \
--field-selector type=Warning --sort-by=.lastTimestamp \
-o custom-columns='REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message' 2>/dev/null |
tail -6 | cut -c1-280 >&2 || true
exit 1
fi
@ -7903,7 +7917,7 @@ apps() {
ensure_pimox_kubeconfig
cluster_context_require || return 1
require_argocd_application_controller
require_argocd_application_controller || return 1
require_pimox_app_worker_capacity "${app_selector}"
if [[ "${deploy_website}" == "true" || "${deploy_demos}" == "true" || "${deploy_registry}" == "true" ]]; then
reconcile_app_registry_storage || return 1