Skip to content

Commit

Permalink
Add Istio ambient to KinD test (#14103)
Browse files Browse the repository at this point in the history
* Add ambient

* Add ambient to kind

* Fix script

* fix typo

* fix script

* Fix ordering
  • Loading branch information
nak3 authored Aug 2, 2023
1 parent e937b62 commit cd98800
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
- kourier
- kourier-tls
- istio
- istio-ambient
- contour
# Disabled due to consistent failures
# - gateway_istio
Expand All @@ -117,6 +118,11 @@ jobs:
- ingress: istio
namespace-resources: virtualservices

- ingress: istio-ambient
namespace-resources: virtualservices
ingress-class: istio
ambient: 1

- ingress: kourier-tls
ingress-class: kourier
enable-tls: 1
Expand All @@ -134,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
Expand Down
24 changes: 24 additions & 0 deletions test/config/ytt/ambient/istio-injection.yaml
Original file line number Diff line number Diff line change
@@ -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: ambient
22 changes: 22 additions & 0 deletions test/config/ytt/ambient/kapp-order.yaml
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export SHORT=0
export ENABLE_HA=0
export ENABLE_TLS=${ENABLE_TLS:-0}
export MESH=0
export AMBIENT=${AMBIENT:-0}
export PERF=0
export KIND=${KIND:-0}
export CLUSTER_DOMAIN=${CLUSTER_DOMAIN:-cluster.local}
Expand Down Expand Up @@ -302,6 +303,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")
Expand Down
6 changes: 5 additions & 1 deletion test/e2e-networking-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd98800

Please sign in to comment.