Skip to content

Commit 2243e93

Browse files
committed
fix(istio): deploy script fix
1 parent 58fe81a commit 2243e93

File tree

7 files changed

+16
-3
lines changed

7 files changed

+16
-3
lines changed

istio_examples/RouteRule/api/routerule.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ apiVersion: config.istio.io/v1alpha2
44
kind: RouteRule
55
metadata:
66
name: api-v2
7+
labels:
8+
app: api
79
spec:
810
destination:
911
name: api
@@ -20,6 +22,8 @@ apiVersion: config.istio.io/v1alpha2
2022
kind: RouteRule
2123
metadata:
2224
name: api-default
25+
labels:
26+
app: api
2327
spec:
2428
destination:
2529
name: api

istio_examples/RouteRule/api/service.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ kind: Service
22
apiVersion: v1
33
metadata:
44
name: api
5+
labels:
6+
app: api
57
spec:
68
selector:
79
app: api

istio_examples/RouteRule/deploy.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ SERVICE_NAMES=("ui" "api")
66

77
for SERVICE_NAME in "${SERVICE_NAMES[@]}"; do
88
cd $DIR/$SERVICE_NAME/src && npm i && npm run dockerize
9-
kubectl delete service,deployment $SERVICE_NAME
9+
kubectl delete service,deployment -l app=$SERVICE_NAME
1010
kubectl create -f ../deployment.yml
1111
kubectl create -f ../service.yml
1212
done
1313

1414
API_URL=$(minikube service api --url)
1515
kubectl patch deployment ui --patch '{"spec": {"template": {"spec": {"containers": [{"name": "ui", "env":[{"name": "REACT_APP_API_URL", "value": "'$API_URL'"}]}]}}}}'
1616

17-
kubectl create -f api/routerule.yml
17+
kubectl delete routerule -l app=api
18+
kubectl create -f $DIR/api/routerule.yml

istio_examples/RouteRule/ui/service.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ kind: Service
22
apiVersion: v1
33
metadata:
44
name: ui
5+
labels:
6+
app: ui
57
spec:
68
selector:
79
app: ui

services/api/service.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ kind: Service
22
apiVersion: v1
33
metadata:
44
name: api
5+
labels:
6+
app: api
57
spec:
68
selector:
79
app: api

services/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SERVICE_NAMES=("ui" "api" "github")
66

77
for SERVICE_NAME in "${SERVICE_NAMES[@]}"; do
88
cd $DIR/$SERVICE_NAME/src && npm i && npm run dockerize
9-
kubectl delete service,deployment $SERVICE_NAME
9+
kubectl delete service,deployment -l app=$SERVICE_NAME
1010
kubectl create -f ../deployment.yml
1111
kubectl create -f ../service.yml
1212
done

services/ui/service.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ kind: Service
22
apiVersion: v1
33
metadata:
44
name: ui
5+
labels:
6+
app: ui
57
spec:
68
selector:
79
app: ui

0 commit comments

Comments
 (0)