5 # Execute in a subshell to prevent local variable override during recursion
7 local total_attempts=$1; shift
10 echo -e "\n[wait_for] Waiting for cmd to return success: ${cmdstr}"
11 # shellcheck disable=SC2034
12 for attempt in $(seq "${total_attempts}"); do
13 echo "[wait_for] Attempt ${attempt}/${total_attempts%.*} for: ${cmdstr}"
14 # shellcheck disable=SC2015
15 eval "${cmdstr}" && echo "[wait_for] OK: ${cmdstr}" && return 0 || true
18 echo "[wait_for] ERROR: Failed after max attempts: ${cmdstr}"
24 for i in Istio/init/crd*yaml; do kubectl apply -f $i; done
26 kubectl apply -f Istio/istio-demo-arm64.yaml
28 # Waiting for Istio ready
29 wait_for 100 'test $(kubectl get pods -n istio-system | grep -ce "Running") -eq 12'
31 #Apply the following ConfigMap to enable injection of Dikastes alongside Envoy.(injection ConfigMap)
32 kubectl apply -f Istio/istio-inject-configmap-1.1.7.yaml
34 #Enable the default namespace auto inject
35 kubectl label namespace default istio-injection=enabled --overwrite
36 kubectl get namespace -L istio-injection