From e554714c7123d5f2244456cf9afed652933fe7b2 Mon Sep 17 00:00:00 2001 From: Todd Malsbary Date: Mon, 7 Mar 2022 16:25:58 -0800 Subject: [PATCH] Add chart to deploy IstioOperator resource Signed-off-by: Todd Malsbary Change-Id: Ia1ca6cdc9a69ad47c4a5d2d09a23009522df9f22 --- deploy/istio/.helmignore | 24 ++++ deploy/istio/Chart.yaml | 5 + deploy/istio/istio.sh | 223 +++++++++++++++++++++++++++++ deploy/istio/templates/istio-operator.yaml | 38 +++++ deploy/istio/values.yaml | 0 env/lib/common.sh | 11 ++ 6 files changed, 301 insertions(+) create mode 100644 deploy/istio/.helmignore create mode 100644 deploy/istio/Chart.yaml create mode 100755 deploy/istio/istio.sh create mode 100644 deploy/istio/templates/istio-operator.yaml create mode 100644 deploy/istio/values.yaml diff --git a/deploy/istio/.helmignore b/deploy/istio/.helmignore new file mode 100644 index 0000000..81285a6 --- /dev/null +++ b/deploy/istio/.helmignore @@ -0,0 +1,24 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +istio.sh +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deploy/istio/Chart.yaml b/deploy/istio/Chart.yaml new file mode 100644 index 0000000..0beb1ae --- /dev/null +++ b/deploy/istio/Chart.yaml @@ -0,0 +1,5 @@ +# A simple chart to deploy Istio using the Istio operator. +apiVersion: v2 +name: istio +type: application +version: 0.1.0 diff --git a/deploy/istio/istio.sh b/deploy/istio/istio.sh new file mode 100755 index 0000000..ddac47d --- /dev/null +++ b/deploy/istio/istio.sh @@ -0,0 +1,223 @@ +#!/usr/bin/env bash +set -eEux -o pipefail + +SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))" +LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib" + +source $LIBDIR/common.sh + +BUILDDIR=${SCRIPTDIR/deploy/build} +mkdir -p ${BUILDDIR} + +function test_setup { + clone_istio_repository + + # Create a temporary kubeconfig file for the tests + cluster_name=${CLUSTER_1_NAME:-cluster-1} + local -r cluster_1_kubeconfig="${BUILDDIR}/${cluster_name}.conf" + clusterctl -n metal3 get kubeconfig ${cluster_name} >${cluster_1_kubeconfig} + cluster_name=${CLUSTER_2_NAME:-cluster-2} + local -r cluster_2_kubeconfig="${BUILDDIR}/${cluster_name}.conf" + clusterctl -n metal3 get kubeconfig ${cluster_name} >${cluster_2_kubeconfig} + + # Deploy sleep on cluster-1 + kubectl --kubeconfig=${cluster_1_kubeconfig} create namespace foo + kubectl --kubeconfig=${cluster_1_kubeconfig} label namespace foo istio-injection=enabled + cat <