Skip to content

Commit

Permalink
only install sample bookinfo on clusters in the mesh (istio#18950)
Browse files Browse the repository at this point in the history
Update the multicluster sample script to only install bookinfo on the
clusters in the mesh.
  • Loading branch information
ayj authored and istio-testing committed Nov 14, 2019
1 parent db8fc20 commit e95fb00
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions samples/multicluster/setup-bookinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@

set -o errexit

# Keep all generated artificates in a dedicated workspace
: "${WORKDIR:?WORKDIR must be set}"

# Resolve to an absolute path
WORKDIR=$(cd "$(dirname "${WORKDIR}")" && pwd)/$(basename "${WORKDIR}")

# Description of the mesh topology. Includes the list of clusters in the mesh.
MESH_TOPOLOGY_FILENAME="${WORKDIR}/topology.yaml"

mesh_contexts() {
sed -n 's/^ \([^ ]\+\):$/\1/p' "${MESH_TOPOLOGY_FILENAME}" | tr '\n' ' '
}

install() {
for CONTEXT in $(kubectl config get-contexts -o name); do
for CONTEXT in $(mesh_contexts); do
kc() { kubectl --context "${CONTEXT}" "$@"; }

# enable automatic sidecar injection on the default namespace
Expand All @@ -30,7 +43,7 @@ install() {
}

uninstall() {
for CONTEXT in $(kubectl config get-contexts -o name); do
for CONTEXT in $(mesh_contexts); do
kc() { kubectl --context "${CONTEXT}" "$@"; }

# install the bookinfo service and expose it through the ingress gateway
Expand Down

0 comments on commit e95fb00

Please sign in to comment.