From 395a586d1cce0f65fb75af75d3ffc49f99713b1e Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Thu, 15 Jun 2023 16:09:01 +0900 Subject: [PATCH 1/6] Add ambient --- test/config/ytt/ambient/istio-injection.yaml | 24 ++++++++++++++++++++ test/e2e-common.sh | 7 ++++++ test/e2e-networking-library.sh | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/config/ytt/ambient/istio-injection.yaml diff --git a/test/config/ytt/ambient/istio-injection.yaml b/test/config/ytt/ambient/istio-injection.yaml new file mode 100644 index 000000000000..2117a27c66a6 --- /dev/null +++ b/test/config/ytt/ambient/istio-injection.yaml @@ -0,0 +1,24 @@ +#@ load("@ytt:overlay", "overlay") +#@ load("@ytt:data", "data") +#@ load("helpers.lib.yaml", "subset") + +#@ def namespaces(): +#@ names = [ +#@ data.values.serving.namespaces.system, +#@ data.values.serving.namespaces.test.default, +#@ data.values.serving.namespaces.test.alternate, +#@ data.values.serving.namespaces.test.tls, +#@ ] +#@ matches = [] +#@ for name in names: +#@ matches.append(subset(name=name, kind="Namespace")) +#@ end +#@ return overlay.or_op(*matches) +#@ end + +#@overlay/match by=namespaces(), expects="1+" +--- +#@overlay/match-child-defaults missing_ok=True +metadata: + labels: + istio.io/dataplane-mode: amabient diff --git a/test/e2e-common.sh b/test/e2e-common.sh index 93c7e90bfd05..9ebddc38b38e 100644 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -128,6 +128,9 @@ function parse_flags() { ;; --no-mesh) readonly MESH=0 + # DO_NOT_SUBMIT: + # Just a demonstration now. Enable AMBIENT on no-mesh. + readonly AMBIENT=1 return 1 ;; --perf) @@ -302,6 +305,10 @@ function install() { YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/mesh") fi + if (( AMBIENT )); then + YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/ambient") + fi + if (( ENABLE_HA )); then YTT_FILES+=("${E2E_YAML_DIR}/test/config/chaosduck/chaosduck.yaml") YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/ha") diff --git a/test/e2e-networking-library.sh b/test/e2e-networking-library.sh index eaa428d1a71e..2f935fc7d587 100644 --- a/test/e2e-networking-library.sh +++ b/test/e2e-networking-library.sh @@ -80,7 +80,7 @@ function download_net_istio_yamls() { echo "Got NET_ISTIO_COMMIT from ${1}: ${sha}" fi - local istio_yaml="$(net_istio_file_url "$sha" istio.yaml)" + local istio_yaml="https://raw.githubusercontent.com/nak3/net-istio/add-ambient-3/third_party/istio-latest/istio-kind-ambient/istio.yaml" local istio_config_yaml="$(net_istio_file_url "$sha" config-istio.yaml)" wget -P "${target_dir}" "${istio_yaml}" \ From 9f1f6e54dcba37b1722fd1e861eae61c60897218 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Wed, 28 Jun 2023 13:35:35 +0900 Subject: [PATCH 2/6] Add ambient to kind --- .github/workflows/kind-e2e.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml index edfa0135e0ce..d8cbd6c3ce4d 100644 --- a/.github/workflows/kind-e2e.yaml +++ b/.github/workflows/kind-e2e.yaml @@ -95,6 +95,7 @@ jobs: - kourier - kourier-tls - istio + - istio-ambient - contour # Disabled due to consistent failures # - gateway_istio @@ -117,6 +118,10 @@ jobs: - ingress: istio namespace-resources: virtualservices + - ingress: istio-ambient + namespace-resources: virtualservices + ingress-class: istio + - ingress: kourier-tls ingress-class: kourier enable-tls: 1 From 4c291c9b0ebd8aed69d912543ac168e28b9daf9d Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Wed, 28 Jun 2023 13:47:14 +0900 Subject: [PATCH 3/6] Fix script --- .github/workflows/kind-e2e.yaml | 2 ++ test/e2e-common.sh | 4 +--- test/e2e-networking-library.sh | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml index d8cbd6c3ce4d..32bb6b2469c0 100644 --- a/.github/workflows/kind-e2e.yaml +++ b/.github/workflows/kind-e2e.yaml @@ -121,6 +121,7 @@ jobs: - ingress: istio-ambient namespace-resources: virtualservices ingress-class: istio + ambient: 1 - ingress: kourier-tls ingress-class: kourier @@ -139,6 +140,7 @@ jobs: KIND: 1 INGRESS_CLASS: ${{ matrix.ingress-class || matrix.ingress }}.ingress.networking.knative.dev ENABLE_TLS: ${{ matrix.enable-tls || 0 }} + AMBIENT: ${{ matrix.ambient || 0 }} steps: - name: Set up Go 1.19.x diff --git a/test/e2e-common.sh b/test/e2e-common.sh index 9ebddc38b38e..7e8ae637a8c0 100644 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -36,6 +36,7 @@ export SHORT=0 export ENABLE_HA=0 export ENABLE_TLS=${ENABLE_TLS:-0} export MESH=0 +export AMBIENT=0 export PERF=0 export KIND=${KIND:-0} export CLUSTER_DOMAIN=${CLUSTER_DOMAIN:-cluster.local} @@ -128,9 +129,6 @@ function parse_flags() { ;; --no-mesh) readonly MESH=0 - # DO_NOT_SUBMIT: - # Just a demonstration now. Enable AMBIENT on no-mesh. - readonly AMBIENT=1 return 1 ;; --perf) diff --git a/test/e2e-networking-library.sh b/test/e2e-networking-library.sh index 2f935fc7d587..39b6f2497263 100644 --- a/test/e2e-networking-library.sh +++ b/test/e2e-networking-library.sh @@ -80,7 +80,7 @@ function download_net_istio_yamls() { echo "Got NET_ISTIO_COMMIT from ${1}: ${sha}" fi - local istio_yaml="https://raw.githubusercontent.com/nak3/net-istio/add-ambient-3/third_party/istio-latest/istio-kind-ambient/istio.yaml" + local istio_yaml="$(net_istio_file_url "$sha" istio.yaml)" local istio_config_yaml="$(net_istio_file_url "$sha" config-istio.yaml)" wget -P "${target_dir}" "${istio_yaml}" \ @@ -103,7 +103,11 @@ function net_istio_file_url() { local profile="istio-ci-no-mesh" if (( KIND )); then - profile="istio-kind-no-mesh" + if (( AMBIENT )); then + profile="istio-kind-ambient" + else + profile="istio-kind-no-mesh" + fi elif (( MESH )); then profile="istio-ci-mesh" fi From 7d7b4b5b47b08afcea0177293728a8dc4b7ed6a9 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Thu, 29 Jun 2023 22:41:46 +0900 Subject: [PATCH 4/6] fix typo --- test/config/ytt/ambient/istio-injection.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/config/ytt/ambient/istio-injection.yaml b/test/config/ytt/ambient/istio-injection.yaml index 2117a27c66a6..e72748bad739 100644 --- a/test/config/ytt/ambient/istio-injection.yaml +++ b/test/config/ytt/ambient/istio-injection.yaml @@ -21,4 +21,4 @@ #@overlay/match-child-defaults missing_ok=True metadata: labels: - istio.io/dataplane-mode: amabient + istio.io/dataplane-mode: ambient From e6f609d2d43b5271445306b1d35622c7ed2f5df1 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Thu, 29 Jun 2023 22:49:30 +0900 Subject: [PATCH 5/6] fix script --- test/e2e-common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e-common.sh b/test/e2e-common.sh index 7e8ae637a8c0..242d984b698d 100644 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -36,7 +36,7 @@ export SHORT=0 export ENABLE_HA=0 export ENABLE_TLS=${ENABLE_TLS:-0} export MESH=0 -export AMBIENT=0 +export AMBIENT=${AMBIENT:-0} export PERF=0 export KIND=${KIND:-0} export CLUSTER_DOMAIN=${CLUSTER_DOMAIN:-cluster.local} @@ -303,7 +303,7 @@ function install() { YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/mesh") fi - if (( AMBIENT )); then + if ((AMBIENT)); then YTT_FILES+=("${REPO_ROOT_DIR}/test/config/ytt/ambient") fi From 4bababcd7c4a9eac683b7fd9370dbc101c877406 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Tue, 1 Aug 2023 12:07:54 +0900 Subject: [PATCH 6/6] Fix ordering --- test/config/ytt/ambient/kapp-order.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/config/ytt/ambient/kapp-order.yaml diff --git a/test/config/ytt/ambient/kapp-order.yaml b/test/config/ytt/ambient/kapp-order.yaml new file mode 100644 index 000000000000..320e5f6f4628 --- /dev/null +++ b/test/config/ytt/ambient/kapp-order.yaml @@ -0,0 +1,22 @@ +#! ztunnel have to be deployed before istio-cni-node. +#! TODO: Remove this ordering if https://github.com/istio/istio/issues/45781 was solved. + +#@ load("@ytt:overlay", "overlay") +#@ load("helpers.lib.yaml", "subset", "label_subset") + +#@overlay/match by=subset(kind="DaemonSet", name="ztunnel"), expects="1+" +--- +metadata: + #@overlay/match missing_ok=True + annotations: + #@overlay/match missing_ok=True + kapp.k14s.io/change-group: "ztunnel" + +#@overlay/match by=subset(kind="DaemonSet", name="istio-cni-node"), expects="1+" +--- +metadata: + #@overlay/match missing_ok=True + #@overlay/match-child-defaults missing_ok=True + annotations: + kapp.k14s.io/change-group: "istio-cni-node" + kapp.k14s.io/change-rule: "upsert after upserting ztunnel"