@@ -105,25 +105,18 @@ data:
105105EOF
106106}
107107
108- # function setup_istio() {
109- # echo "install istio $ISTIO_VERSION"
110- # kubectl get crd gateways.gateway.networking.k8s.io &>/dev/null ||
111- # { kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.1.0" | kubectl apply -f -; }
112-
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
114- # }
115-
116108function setup_istio() {
117109 echo " install istio $ISTIO_VERSION "
118110 kubectl get crd gateways.gateway.networking.k8s.io & > /dev/null ||
119111 { kubectl kustomize " github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.1.0" | kubectl apply -f -; }
120112 # install istio CRD
121113 helm repo add istio https://istio-release.storage.googleapis.com/charts
122114 helm repo update
123- kubectl create namespace istio-system
124- helm install istio-base istio/base -n istio-system
115+ helm install istio-base istio/base -n istio-system --create-namespace
116+
117+ helm install istiod istio/istiod --namespace istio-system --version $ISTIO_VERSION --set pilot.env.PILOT_ENABLE_AMBIENT=true --create-namespace
125118
126- helm install istiod istio/istiod --namespace istio-system --version $ISTIO_VERSION --set pilot.env.PILOT_ENABLE_AMBIENT=true
119+ helm install istio-ingressgateway istio/gateway -n istio-system --create-namespace
127120
128121 while true ; do
129122 pod_info=$( kubectl get pods -n istio-system -l app=istiod -o jsonpath=' {range .items[*]}{.metadata.name}{" "}{.status.phase}{"\n"}{end}' )
@@ -208,55 +201,6 @@ function setup_kmesh() {
208201 done
209202}
210203
211- function set_daemonupgarde_testcase_image() {
212- local TMP_BUILD
213- TMP_BUILD=" $( mktemp -d) "
214- echo " Building in temp dir: $TMP_BUILD "
215-
216- git clone --depth 1 . " $TMP_BUILD " || {
217- echo " git clone failed"
218- rm -rf " $TMP_BUILD "
219- return 1
220- }
221-
222- pushd " $TMP_BUILD " > /dev/null
223-
224- BPF_HEADER_FILE=" ./bpf/include/bpf_common.h"
225- echo " Modifying BPF header file: ${BPF_HEADER_FILE} "
226-
227- sed -i \
228- ' /} kmesh_map64 SEC(".maps");/a\
229- \
230- struct {\
231- __uint(type, BPF_MAP_TYPE_HASH);\
232- __uint(key_size, sizeof(__u32));\
233- __uint(value_size, MAP_VAL_SIZE_64);\
234- __uint(max_entries, MAP_MAX_ENTRIES);\
235- __uint(map_flags, BPF_F_NO_PREALLOC);\
236- } kmesh_map64_bak_for_test SEC(".maps");' \
237- " ${BPF_HEADER_FILE} "
238-
239- local HUB=" localhost:5000"
240- local TARGET=" kmesh"
241- local TAG=" test-upgrade-map-change"
242- local IMAGE=" ${HUB} /${TARGET} :${TAG} "
243-
244- echo " Running 'make docker.push' with custom HUB and TAG in $TMP_BUILD "
245- if ! HUB=${HUB} TARGET=${TARGET} TAG=${TAG} make docker.push; then
246- echo " make docker.push failed"
247- popd > /dev/null
248- rm -rf " $TMP_BUILD "
249- return 1
250- fi
251-
252- export KMESH_UPGRADE_IMAGE=" ${IMAGE} "
253- echo " Built and pushed image: ${IMAGE} "
254-
255- popd > /dev/null
256- # rm -rf "$TMP_BUILD"
257- return 0
258- }
259-
260204function setup_kmesh_log() {
261205 # Set log of each Kmesh pods.
262206 PODS=$( kubectl get pods -n kmesh-system -l app=kmesh -o jsonpath=' {.items[*].metadata.name}' )
@@ -318,26 +262,6 @@ function build_and_push_images() {
318262 HUB=" ${KIND_REGISTRY} " TAG=" latest" make docker.push
319263}
320264
321- function load_prometheus_image_to_kind() {
322- local NAME=" ${1:- kmesh-testing} "
323- local PROMETHEUS_IMAGE=" ${2:- prom/ prometheus: v2.54.1} "
324-
325- echo " Pulling Prometheus image: $PROMETHEUS_IMAGE "
326- if ! docker pull " $PROMETHEUS_IMAGE " ; then
327- echo " Failed to pull Prometheus image: $PROMETHEUS_IMAGE "
328- return 1
329- fi
330-
331- echo " Loading Prometheus image to kind cluster: $NAME "
332- if ! kind load docker-image " $PROMETHEUS_IMAGE " --name " $NAME " ; then
333- echo " Failed to load Prometheus image to kind cluster: $NAME "
334- return 1
335- fi
336-
337- echo " Successfully loaded Prometheus image ($PROMETHEUS_IMAGE ) to kind cluster ($NAME )"
338- return 0
339- }
340-
341265function install_dependencies() {
342266 # 1. Install kind.
343267 if ! which kind & > /dev/null; then
@@ -447,10 +371,6 @@ while (("$#")); do
447371 PARAMS+=(" -istio.test.nocleanup" )
448372 shift
449373 ;;
450- --skip-build-daemonupgarde-image)
451- SKIP_BUILD_UPGARDE=true
452- shift
453- ;;
454374 * )
455375 PARAMS+=(" $1 " )
456376 shift
@@ -472,9 +392,6 @@ if [[ -z ${SKIP_BUILD:-} ]]; then
472392 setup_kind_registry
473393 build_and_push_images
474394 install_kmeshctl
475- if [[ -z ${SKIP_BUILD_UPGARDE:- } ]]; then
476- set_daemonupgarde_testcase_image
477- fi
478395fi
479396
480397kubectl config use-context " kind-$NAME "
488405
489406setup_kmesh_log
490407
491- load_prometheus_image_to_kind
492-
493408capture_pod_logs &
494409
495410cmd=" go test -v -tags=integ $ROOT_DIR /test/e2e/... -istio.test.kube.loadbalancer=false ${PARAMS[*]} "
@@ -513,6 +428,4 @@ if [[ -n ${CLEANUP_REGISTRY} ]]; then
513428 cleanup_docker_registry
514429fi
515430
516- # rm -rf "${TMP}"
517-
518431exit $EXIT_CODE
0 commit comments