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

demo/scripts: fix bookstore app label and container name #4910

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions demo/deploy-bookstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
containers:
- image: "${CTR_REGISTRY}/bookstore:${CTR_TAG}"
imagePullPolicy: Always
name: $SVC
name: bookstore
ports:
- containerPort: 14001
name: web
Expand Down Expand Up @@ -130,10 +130,10 @@ spec:
- name: $CTR_REGISTRY_CREDS_NAME
EOF

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

for x in $(kubectl get service -n "$BOOKSTORE_NAMESPACE" --selector app="$SVC" --no-headers | awk '{print $1}'); do
for x in $(kubectl get service -n "$BOOKSTORE_NAMESPACE" --selector app=bookstore,version="$VERSION" --no-headers | awk '{print $1}'); do
kubectl get service "$x" -n "$BOOKSTORE_NAMESPACE" -o jsonpath='{.status.loadBalancer.ingress[*].ip}'
done
8 changes: 4 additions & 4 deletions demo/tail-bookstore-envoy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# shellcheck disable=SC1091
source .env

backend="$1"
selector="$1"
thisScript="$(dirname "$0")/$(basename "$0")"

if [ -z "$backend" ]; then
echo "Usage: $thisScript <backend-name>"
if [ -z "$selector" ]; then
echo "Usage: $thisScript <selector>"
exit 1
fi

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

kubectl logs "$POD" -n "$BOOKSTORE_NAMESPACE" -c envoy --tail=100 -f
10 changes: 5 additions & 5 deletions demo/tail-bookstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# shellcheck disable=SC1091
source .env

backend="$1"
selector="$1"
thisScript="$(dirname "$0")/$(basename "$0")"

if [ -z "$backend" ]; then
echo "Usage: $thisScript <backend-name>"
if [ -z "$selector" ]; then
echo "Usage: $thisScript <selector>"
exit 1
fi

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

kubectl logs "$POD" -n "$BOOKSTORE_NAMESPACE" -c "$backend" --tail=100
kubectl logs "$POD" -n "$BOOKSTORE_NAMESPACE" -c bookstore --tail=100
1 change: 1 addition & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- `osm_proxy_xds_request_count`
- Support for Kubernetes 1.20 and 1.21 has been dropped
- Multi-arch installation supported by the Chart Helm by customizing the `affinity` and `nodeSelector` fields
- 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.

## Release v1.1.0

Expand Down
10 changes: 1 addition & 9 deletions scripts/port-forward-bookstore-ui-v1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
# shellcheck disable=SC1091
source .env

backend="${1:-bookstore-v1}"
thisScript="$(dirname "$0")/$(basename "$0")"

if [ -z "$backend" ]; then
echo "Usage: $thisScript <backend-name>"
exit 1
fi

BOOKSTOREv1_LOCAL_PORT="${BOOKSTOREv1_LOCAL_PORT:-8081}"
POD="$(kubectl get pods --selector app="$backend" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
POD="$(kubectl get pods --selector app=bookstore,version=v1 -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"

kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" "$BOOKSTOREv1_LOCAL_PORT":14001
10 changes: 1 addition & 9 deletions scripts/port-forward-bookstore-ui-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
# shellcheck disable=SC1091
source .env

backend="${1:-bookstore-v2}"
thisScript="$(dirname "$0")/$(basename "$0")"

if [ -z "$backend" ]; then
echo "Usage: $thisScript <backend-name>"
exit 1
fi

BOOKSTOREv2_LOCAL_PORT="${BOOKSTOREv2_LOCAL_PORT:-8082}"
POD="$(kubectl get pods --selector app="$backend" -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"
POD="$(kubectl get pods --selector app=bookstore,version=v2 -n "$BOOKSTORE_NAMESPACE" --no-headers | grep 'Running' | awk 'NR==1{print $1}')"

kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" "$BOOKSTOREv2_LOCAL_PORT":14001
8 changes: 4 additions & 4 deletions scripts/port-forward-bookstore-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
# shellcheck disable=SC1091
source .env

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

if [ -z "$backend" ]; then
echo "Usage: $thisScript <backend-name>"
if [ -z "$selector" ]; then
echo "Usage: $thisScript <selector>"
exit 1
fi

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

kubectl port-forward "$POD" -n "$BOOKSTORE_NAMESPACE" "$BOOKSTORE_LOCAL_PORT":14001
8 changes: 4 additions & 4 deletions scripts/port-forward-bookstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# shellcheck disable=SC1091
source .env

backend="$1"
selector="$1"
thisScript="$(dirname "$0")/$(basename "$0")"

if [ -z "$backend" ]; then
echo "Usage: $thisScript <backend-name>"
if [ -z "$selector" ]; then
echo "Usage: $thisScript <selector>"
exit 1
fi

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