@@ -8,14 +8,14 @@ export CTX_CLUSTER3=${CTX_CLUSTER3:-e2e.cluster3.mongokubernetes.com}
88export VERSION=${VERSION:- 1.12.8}
99
1010IS_KIND=" false"
11- if [[ $CTX_CLUSTER1 = kind* ]]; then
11+ if [[ ${ CTX_CLUSTER1} = kind* ]]; then
1212 IS_KIND=" true"
1313fi
1414
1515source multi_cluster/tools/download_istio.sh
1616
1717#
18- cd istio-${VERSION}
18+ cd " istio-${VERSION} "
1919# # perform cleanup prior to install
2020bin/istioctl x uninstall --context=" ${CTX_CLUSTER1} " --purge --skip-confirmation &
2121bin/istioctl x uninstall --context=" ${CTX_CLUSTER2} " --purge --skip-confirmation &
@@ -40,28 +40,28 @@ kubectl --context="${CTX_CLUSTER1}" delete ns istio-system || true
4040kubectl --context=" ${CTX_CLUSTER1} " create ns istio-system
4141kubectl --context=" ${CTX_CLUSTER1} " label --overwrite ns istio-system pod-security.kubernetes.io/enforce=privileged
4242kubectl --context=" ${CTX_CLUSTER1} " create secret generic cacerts -n istio-system \
43- --from-file=${CTX_CLUSTER1} /ca-cert.pem \
44- --from-file=${CTX_CLUSTER1} /ca-key.pem \
45- --from-file=${CTX_CLUSTER1} /root-cert.pem \
46- --from-file=${CTX_CLUSTER1} /cert-chain.pem
43+ --from-file=" ${CTX_CLUSTER1} /ca-cert.pem" \
44+ --from-file=" ${CTX_CLUSTER1} /ca-key.pem" \
45+ --from-file=" ${CTX_CLUSTER1} /root-cert.pem" \
46+ --from-file=" ${CTX_CLUSTER1} /cert-chain.pem"
4747
4848kubectl --context=" ${CTX_CLUSTER2} " delete ns istio-system || true
4949kubectl --context=" ${CTX_CLUSTER2} " create ns istio-system
5050kubectl --context=" ${CTX_CLUSTER2} " label --overwrite ns istio-system pod-security.kubernetes.io/enforce=privileged
5151kubectl --context=" ${CTX_CLUSTER2} " create secret generic cacerts -n istio-system \
52- --from-file=${CTX_CLUSTER2} /ca-cert.pem \
53- --from-file=${CTX_CLUSTER2} /ca-key.pem \
54- --from-file=${CTX_CLUSTER2} /root-cert.pem \
55- --from-file=${CTX_CLUSTER2} /cert-chain.pem
52+ --from-file=" ${CTX_CLUSTER2} /ca-cert.pem" \
53+ --from-file=" ${CTX_CLUSTER2} /ca-key.pem" \
54+ --from-file=" ${CTX_CLUSTER2} /root-cert.pem" \
55+ --from-file=" ${CTX_CLUSTER2} /cert-chain.pem"
5656
5757kubectl --context=" ${CTX_CLUSTER3} " delete ns istio-system || true
5858kubectl --context=" ${CTX_CLUSTER3} " create ns istio-system
5959kubectl --context=" ${CTX_CLUSTER3} " label --overwrite ns istio-system pod-security.kubernetes.io/enforce=privileged
6060kubectl --context=" ${CTX_CLUSTER3} " create secret generic cacerts -n istio-system \
61- --from-file=${CTX_CLUSTER3} /ca-cert.pem \
62- --from-file=${CTX_CLUSTER3} /ca-key.pem \
63- --from-file=${CTX_CLUSTER3} /root-cert.pem \
64- --from-file=${CTX_CLUSTER3} /cert-chain.pem
61+ --from-file=" ${CTX_CLUSTER3} /ca-cert.pem" \
62+ --from-file=" ${CTX_CLUSTER3} /ca-key.pem" \
63+ --from-file=" ${CTX_CLUSTER3} /root-cert.pem" \
64+ --from-file=" ${CTX_CLUSTER3} /cert-chain.pem"
6565popd
6666
6767# install IstioOperator in clusters
@@ -145,43 +145,49 @@ wait
145145CLUSTER_1_ADDITIONAL_OPTS=" "
146146CLUSTER_2_ADDITIONAL_OPTS=" "
147147CLUSTER_3_ADDITIONAL_OPTS=" "
148- if [[ $IS_KIND == " true" ]]; then
149- CLUSTER_1_ADDITIONAL_OPTS=" --server https://$( kubectl --context=${CTX_CLUSTER1} get node e2e-cluster-1-control-plane -o=jsonpath=' {.status.addresses[?(@.type=="InternalIP")].address}' ) :6443"
150- CLUSTER_2_ADDITIONAL_OPTS=" --server https://$( kubectl --context=${CTX_CLUSTER2} get node e2e-cluster-2-control-plane -o=jsonpath=' {.status.addresses[?(@.type=="InternalIP")].address}' ) :6443"
151- CLUSTER_3_ADDITIONAL_OPTS=" --server https://$( kubectl --context=${CTX_CLUSTER3} get node e2e-cluster-3-control-plane -o=jsonpath=' {.status.addresses[?(@.type=="InternalIP")].address}' ) :6443"
148+ if [[ ${ IS_KIND} == " true" ]]; then
149+ CLUSTER_1_ADDITIONAL_OPTS=" --server https://$( kubectl --context=" ${CTX_CLUSTER1} " get node e2e-cluster-1-control-plane -o=jsonpath=' {.status.addresses[?(@.type=="InternalIP")].address}' ) :6443"
150+ CLUSTER_2_ADDITIONAL_OPTS=" --server https://$( kubectl --context=" ${CTX_CLUSTER2} " get node e2e-cluster-2-control-plane -o=jsonpath=' {.status.addresses[?(@.type=="InternalIP")].address}' ) :6443"
151+ CLUSTER_3_ADDITIONAL_OPTS=" --server https://$( kubectl --context=" ${CTX_CLUSTER3} " get node e2e-cluster-3-control-plane -o=jsonpath=' {.status.addresses[?(@.type=="InternalIP")].address}' ) :6443"
152152fi
153153
154154# enable endpoint discovery
155+ # shellcheck disable=SC2086 # CLUSTER_X_ADDITIONAL_OPTS must not be quoted - empty string breaks istioctl
155156bin/istioctl x create-remote-secret \
156157 --context=" ${CTX_CLUSTER1} " \
157158 -n istio-system \
158159 --name=cluster1 ${CLUSTER_1_ADDITIONAL_OPTS} |
159160 kubectl apply -f - --context=" ${CTX_CLUSTER2} "
160161
162+ # shellcheck disable=SC2086
161163bin/istioctl x create-remote-secret \
162164 --context=" ${CTX_CLUSTER1} " \
163165 -n istio-system \
164166 --name=cluster1 ${CLUSTER_1_ADDITIONAL_OPTS} |
165167 kubectl apply -f - --context=" ${CTX_CLUSTER3} "
166168
169+ # shellcheck disable=SC2086
167170bin/istioctl x create-remote-secret \
168171 --context=" ${CTX_CLUSTER2} " \
169172 -n istio-system \
170173 --name=cluster2 ${CLUSTER_2_ADDITIONAL_OPTS} |
171174 kubectl apply -f - --context=" ${CTX_CLUSTER1} "
172175
176+ # shellcheck disable=SC2086
173177bin/istioctl x create-remote-secret \
174178 --context=" ${CTX_CLUSTER2} " \
175179 -n istio-system \
176180 --name=cluster2 ${CLUSTER_2_ADDITIONAL_OPTS} |
177181 kubectl apply -f - --context=" ${CTX_CLUSTER3} "
178182
183+ # shellcheck disable=SC2086
179184bin/istioctl x create-remote-secret \
180185 --context=" ${CTX_CLUSTER3} " \
181186 -n istio-system \
182187 --name=cluster3 ${CLUSTER_3_ADDITIONAL_OPTS} |
183188 kubectl apply -f - --context=" ${CTX_CLUSTER1} "
184189
190+ # shellcheck disable=SC2086
185191bin/istioctl x create-remote-secret \
186192 --context=" ${CTX_CLUSTER3} " \
187193 -n istio-system \
0 commit comments