-
Notifications
You must be signed in to change notification settings - Fork 63
/
3_install_microservices.sh
executable file
·45 lines (34 loc) · 1.63 KB
/
3_install_microservices.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# https://redhat-developer-demos.github.io/istio-tutorial/istio-tutorial/1.0.0/1setup.html
# https://redhat-developer-demos.github.io/istio-tutorial/istio-tutorial/1.0.0/2deploy-microservices.html
# assumes (kubectl or oc) and istioctl and mvn in the PATH
# assumes the 'docker' tool points to minikube/minishift
# assumes this script is in a directory called 'scripts-istio'
# which is a peer of 'istio-tutorial'
# assumes you have 'kubens tutorial' or 'oc project tutorial'
kubectl create namespace tutorial
# oc adm policy add-scc-to-user privileged -z default -n tutorial
kubens tutorial
# Customer
cd ../istio-tutorial/customer/java/quarkus
mvn clean package -DskipTests
docker build -t example/customer .
kubectl apply -f <(istioctl kube-inject -f ../../kubernetes/Deployment.yml) -n tutorial
kubectl create -f ../../kubernetes/Service.yml -n tutorial
# for minikube, open a NodePort
kubectl patch service/customer -p '{"spec":{"type":"NodePort"}}' -n tutorial
# for minishift, create a Route
# oc expose service customer
# Preference
cd ../../../preference/java/quarkus
mvn clean package -DskipTests
docker build -t example/preference:v1 .
kubectl apply -f <(istioctl kube-inject -f ../../kubernetes/Deployment.yml) -n tutorial
kubectl create -f ../../kubernetes/Service.yml -n tutorial
# Recommendation
cd ../../../recommendation/java/quarkus
mvn clean package -DskipTests
docker build -t example/recommendation:v1 .
kubectl apply -f <(istioctl kube-inject -f ../../kubernetes/Deployment.yml) -n tutorial
kubectl create -f ../../kubernetes/Service.yml -n tutorial
kubectl create -f ../../../customer/kubernetes/Gateway.yml -n tutorial