Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit e94c48b

Browse files
authored
demo/scripts: fix bookstore app label and container name (#4910)
Updates the scripts to be in sync with the manifests used in the manual demo documented on the website and to be compatible with changes made to the bookstore app labels in 5f54056. Also fixes #4906 and updates the release notes for v1.2. Signed-off-by: Shashank Ram <[email protected]>
1 parent 8030047 commit e94c48b

8 files changed

+24
-39
lines changed

demo/deploy-bookstore.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ spec:
8787
containers:
8888
- image: "${CTR_REGISTRY}/bookstore:${CTR_TAG}"
8989
imagePullPolicy: Always
90-
name: $SVC
90+
name: bookstore
9191
ports:
9292
- containerPort: 14001
9393
name: web
@@ -130,10 +130,10 @@ spec:
130130
- name: $CTR_REGISTRY_CREDS_NAME
131131
EOF
132132

133-
kubectl get pods --no-headers -o wide --selector app="$SVC" -n "$BOOKSTORE_NAMESPACE"
134-
kubectl get endpoints --no-headers -o wide --selector app="$SVC" -n "$BOOKSTORE_NAMESPACE"
133+
kubectl get pods --no-headers -o wide --selector app=bookstore,version="$VERSION" -n "$BOOKSTORE_NAMESPACE"
134+
kubectl get endpoints --no-headers -o wide --selector app=bookstore,version="$VERSION" -n "$BOOKSTORE_NAMESPACE"
135135
kubectl get service -o wide -n "$BOOKSTORE_NAMESPACE"
136136

137-
for x in $(kubectl get service -n "$BOOKSTORE_NAMESPACE" --selector app="$SVC" --no-headers | awk '{print $1}'); do
137+
for x in $(kubectl get service -n "$BOOKSTORE_NAMESPACE" --selector app=bookstore,version="$VERSION" --no-headers | awk '{print $1}'); do
138138
kubectl get service "$x" -n "$BOOKSTORE_NAMESPACE" -o jsonpath='{.status.loadBalancer.ingress[*].ip}'
139139
done

demo/tail-bookstore-envoy.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# shellcheck disable=SC1091
44
source .env
55

6-
backend="$1"
6+
selector="$1"
77
thisScript="$(dirname "$0")/$(basename "$0")"
88

9-
if [ -z "$backend" ]; then
10-
echo "Usage: $thisScript <backend-name>"
9+
if [ -z "$selector" ]; then
10+
echo "Usage: $thisScript <selector>"
1111
exit 1
1212
fi
1313

14-
POD="$(kubectl get pods -n "$BOOKSTORE_NAMESPACE" --show-labels --selector app="$backend" --no-headers | grep -v 'Terminating' | awk '{print $1}' | head -n1)"
14+
POD="$(kubectl get pods -n "$BOOKSTORE_NAMESPACE" --show-labels --selector "$selector" --no-headers | grep -v 'Terminating' | awk '{print $1}' | head -n1)"
1515

1616
kubectl logs "$POD" -n "$BOOKSTORE_NAMESPACE" -c envoy --tail=100 -f

demo/tail-bookstore.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# shellcheck disable=SC1091
44
source .env
55

6-
backend="$1"
6+
selector="$1"
77
thisScript="$(dirname "$0")/$(basename "$0")"
88

9-
if [ -z "$backend" ]; then
10-
echo "Usage: $thisScript <backend-name>"
9+
if [ -z "$selector" ]; then
10+
echo "Usage: $thisScript <selector>"
1111
exit 1
1212
fi
1313

14-
POD="$(kubectl get pods -n "$BOOKSTORE_NAMESPACE" --show-labels --selector app="$backend" --no-headers | grep -v 'Terminating' | awk '{print $1}' | head -n1)"
14+
POD="$(kubectl get pods -n "$BOOKSTORE_NAMESPACE" --show-labels --selector "$selector" --no-headers | grep -v 'Terminating' | awk '{print $1}' | head -n1)"
1515

16-
kubectl logs "$POD" -n "$BOOKSTORE_NAMESPACE" -c "$backend" --tail=100
16+
kubectl logs "$POD" -n "$BOOKSTORE_NAMESPACE" -c bookstore --tail=100

docs/release_notes.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- `osm_proxy_xds_request_count`
2323
- Support for Kubernetes 1.20 and 1.21 has been dropped
2424
- Multi-arch installation supported by the Chart Helm by customizing the `affinity` and `nodeSelector` fields
25+
- Root service in a `TrafficSplit` configuration must have a selector matching the pods backing the leaf services. The legacy behavior where a root service without a selector matching the pods backing the leaf services is able to split traffic, has been removed.
2526

2627
## Release v1.1.0
2728

scripts/port-forward-bookstore-ui-v1.sh

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
# shellcheck disable=SC1091
88
source .env
99

10-
backend="${1:-bookstore-v1}"
11-
thisScript="$(dirname "$0")/$(basename "$0")"
12-
13-
if [ -z "$backend" ]; then
14-
echo "Usage: $thisScript <backend-name>"
15-
exit 1
16-
fi
17-
1810
BOOKSTOREv1_LOCAL_PORT="${BOOKSTOREv1_LOCAL_PORT:-8081}"
19-
POD="$(kubectl get pods --selector app="$backend" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
11+
POD="$(kubectl get pods --selector app=bookstore,version=v1 -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
2012

2113
kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" "$BOOKSTOREv1_LOCAL_PORT":14001

scripts/port-forward-bookstore-ui-v2.sh

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
# shellcheck disable=SC1091
88
source .env
99

10-
backend="${1:-bookstore-v2}"
11-
thisScript="$(dirname "$0")/$(basename "$0")"
12-
13-
if [ -z "$backend" ]; then
14-
echo "Usage: $thisScript <backend-name>"
15-
exit 1
16-
fi
17-
1810
BOOKSTOREv2_LOCAL_PORT="${BOOKSTOREv2_LOCAL_PORT:-8082}"
19-
POD="$(kubectl get pods --selector app="$backend" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
11+
POD="$(kubectl get pods --selector app=bookstore,version=v2 -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
2012

2113
kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" "$BOOKSTOREv2_LOCAL_PORT":14001

scripts/port-forward-bookstore-ui.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
# shellcheck disable=SC1091
88
source .env
99

10-
backend="${1:-bookstore}"
10+
selector="$1"
1111
thisScript="$(dirname "$0")/$(basename "$0")"
1212

13-
if [ -z "$backend" ]; then
14-
echo "Usage: $thisScript <backend-name>"
13+
if [ -z "$selector" ]; then
14+
echo "Usage: $thisScript <selector>"
1515
exit 1
1616
fi
1717

1818
BOOKSTORE_LOCAL_PORT="${BOOKSTORE_LOCAL_PORT:-8084}"
19-
POD="$(kubectl get pods --selector app="$backend" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
19+
POD="$(kubectl get pods --selector "$selector" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
2020

2121
kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" "$BOOKSTORE_LOCAL_PORT":14001

scripts/port-forward-bookstore.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# shellcheck disable=SC1091
33
source .env
44

5-
backend="$1"
5+
selector="$1"
66
thisScript="$(dirname "$0")/$(basename "$0")"
77

8-
if [ -z "$backend" ]; then
9-
echo "Usage: $thisScript <backend-name>"
8+
if [ -z "$selector" ]; then
9+
echo "Usage: $thisScript <selector>"
1010
exit 1
1111
fi
1212

13-
POD="$(kubectl get pods --selector app="$backend" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
13+
POD="$(kubectl get pods --selector "$selector" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
1414
kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" 15000:15000
1515

0 commit comments

Comments
 (0)