@@ -69,41 +69,25 @@ check_for_openshift() {
69
69
70
70
# wait_for_pods looks all Pods running in k8s context $1, and keeps waiting until running count == $2.
71
71
wait_for_pods () {
72
-
73
- set +e
74
-
75
- count=0
76
- while [ true ]
77
- do
78
-
79
- echo " -> Waiting for $1 pods to be running. Expecting $2 running pods."
80
-
81
- kubectl get pods --context=" $1 " -A
82
- RUNNING_PODS=` kubectl get pods --context=" $1 " -A | grep " Running" | wc -l | tr -d ' [:space:]' `
83
-
84
- if [[ " $RUNNING_PODS " == " $2 " ]]; then
85
- break
86
- fi
87
-
88
- count=$(( count+ 1 ))
89
- if [[ $count -eq 60 ]]; then
90
- echo " -> Timed out waiting for pods to be running."
91
- echo " -> Pods:"
92
- kubectl describe pods --context=" $1 " -n argocd
93
- echo " -> Deployments:"
94
- kubectl describe deployments --context=" $1 " -n argocd
95
- echo " -> Stateful Sets:"
96
- kubectl describe statefulsets --context=" $1 " -n argocd
97
- echo " -> Exiting due to timeout waiting for pods to be running."
98
- exit 1
99
- fi
100
-
101
- sleep 10
102
- done
103
-
104
- echo " -> Done waiting for $1 pods."
105
-
106
- set -e
72
+ context=" $1 "
73
+ component=" $2 "
74
+ case " $component " in
75
+ " principal" )
76
+ kubectl --context $context -n argocd rollout status --watch deployments argocd-server
77
+ kubectl --context $context -n argocd rollout status --watch deployments argocd-repo-server
78
+ kubectl --context $context -n argocd rollout status --watch deployments argocd-dex-server
79
+ kubectl --context $context -n argocd rollout status --watch deployments argocd-redis
80
+ ;;
81
+ " agent" )
82
+ kubectl --context $context -n argocd rollout status --watch statefulsets argocd-application-controller
83
+ kubectl --context $context -n argocd rollout status --watch deployments argocd-repo-server
84
+ kubectl --context $context -n argocd rollout status --watch deployments argocd-redis
85
+ ;;
86
+ * )
87
+ echo " Unknown component: $component "
88
+ exit 1
89
+ ;;
90
+ esac
107
91
}
108
92
109
93
@@ -245,9 +229,9 @@ apply() {
245
229
kubectl --context vcluster-agent-managed create ns agent-managed || true
246
230
247
231
echo " -> Waiting for all the Argo CD/vCluster pods to be running on vclusters"
248
- wait_for_pods vcluster-control-plane 5
249
- wait_for_pods vcluster-agent-autonomous 4
250
- wait_for_pods vcluster-agent-managed 4
232
+ wait_for_pods vcluster-control-plane principal
233
+ wait_for_pods vcluster-agent-autonomous agent
234
+ wait_for_pods vcluster-agent-managed agent
251
235
252
236
echo " -> Service configuration on control plane"
253
237
kubectl --context vcluster-control-plane -n argocd get services
0 commit comments