@@ -109,8 +109,33 @@ function setup_istio() {
109109 echo " install istio $ISTIO_VERSION "
110110 kubectl get crd gateways.gateway.networking.k8s.io & > /dev/null ||
111111 { kubectl kustomize " github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.1.0" | kubectl apply -f -; }
112+ # install istio CRD
113+ helm repo add istio https://istio-release.storage.googleapis.com/charts
114+ helm repo update
115+ helm install istio-base istio/base -n istio-system --create-namespace
112116
113- istioctl install --set profile=ambient --set meshConfig.accessLogFile=" /dev/stdout" --set components.ingressGateways[0].enabled=true --set components.ingressGateways[0].name=istio-ingressgateway --skip-confirmation
117+ helm install istiod istio/istiod --namespace istio-system --version $ISTIO_VERSION --set pilot.env.PILOT_ENABLE_AMBIENT=true --create-namespace
118+
119+ helm install istio-ingressgateway istio/gateway -n istio-system --create-namespace
120+
121+ while true ; do
122+ pod_info=$( kubectl get pods -n istio-system -l app=istiod -o jsonpath=' {range .items[*]}{.metadata.name}{" "}{.status.phase}{"\n"}{end}' )
123+
124+ if [ -z " $pod_info " ]; then
125+ echo " No istiod pod found yet, waiting..."
126+ sleep 1
127+ continue
128+ fi
129+
130+ read -r pod_name pod_status <<< " $pod_info"
131+ if [ " $pod_status " = " Running" ]; then
132+ echo " Istiod pod $pod_name is in Running state."
133+ break
134+ fi
135+
136+ echo " Waiting for pods of Kmesh daemon to enter Running state..."
137+ sleep 1
138+ done
114139}
115140
116141function setup_kmesh() {
@@ -176,55 +201,6 @@ function setup_kmesh() {
176201 done
177202}
178203
179- function set_daemonupgarde_testcase_image() {
180- local TMP_BUILD
181- TMP_BUILD=" $( mktemp -d) "
182- echo " Building in temp dir: $TMP_BUILD "
183-
184- git clone --depth 1 . " $TMP_BUILD " || {
185- echo " git clone failed"
186- rm -rf " $TMP_BUILD "
187- return 1
188- }
189-
190- pushd " $TMP_BUILD " > /dev/null
191-
192- BPF_HEADER_FILE=" ./bpf/include/bpf_common.h"
193- echo " Modifying BPF header file: ${BPF_HEADER_FILE} "
194-
195- sed -i \
196- ' /} kmesh_map64 SEC(".maps");/a\
197- \
198- struct {\
199- __uint(type, BPF_MAP_TYPE_HASH);\
200- __uint(key_size, sizeof(__u32));\
201- __uint(value_size, MAP_VAL_SIZE_64);\
202- __uint(max_entries, MAP_MAX_ENTRIES);\
203- __uint(map_flags, BPF_F_NO_PREALLOC);\
204- } kmesh_map64_bak_for_test SEC(".maps");' \
205- " ${BPF_HEADER_FILE} "
206-
207- local HUB=" localhost:5000"
208- local TARGET=" kmesh"
209- local TAG=" test-upgrade-map-change"
210- local IMAGE=" ${HUB} /${TARGET} :${TAG} "
211-
212- echo " Running 'make docker.push' with custom HUB and TAG in $TMP_BUILD "
213- if ! HUB=${HUB} TARGET=${TARGET} TAG=${TAG} make docker.push; then
214- echo " make docker.push failed"
215- popd > /dev/null
216- rm -rf " $TMP_BUILD "
217- return 1
218- fi
219-
220- export KMESH_UPGRADE_IMAGE=" ${IMAGE} "
221- echo " Built and pushed image: ${IMAGE} "
222-
223- popd > /dev/null
224- # rm -rf "$TMP_BUILD"
225- return 0
226- }
227-
228204function setup_kmesh_log() {
229205 # Set log of each Kmesh pods.
230206 PODS=$( kubectl get pods -n kmesh-system -l app=kmesh -o jsonpath=' {.items[*].metadata.name}' )
@@ -395,10 +371,6 @@ while (("$#")); do
395371 PARAMS+=(" -istio.test.nocleanup" )
396372 shift
397373 ;;
398- --skip-build-daemonupgarde-image)
399- SKIP_BUILD_UPGARDE=true
400- shift
401- ;;
402374 * )
403375 PARAMS+=(" $1 " )
404376 shift
@@ -420,9 +392,6 @@ if [[ -z ${SKIP_BUILD:-} ]]; then
420392 setup_kind_registry
421393 build_and_push_images
422394 install_kmeshctl
423- if [[ -z ${SKIP_BUILD_UPGARDE:- } ]]; then
424- set_daemonupgarde_testcase_image
425- fi
426395fi
427396
428397kubectl config use-context " kind-$NAME "
@@ -459,6 +428,4 @@ if [[ -n ${CLEANUP_REGISTRY} ]]; then
459428 cleanup_docker_registry
460429fi
461430
462- # rm -rf "${TMP}"
463-
464431exit $EXIT_CODE
0 commit comments