-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## BookInfo部署 | ||
|
||
#### 创建新的namespace | ||
```shell | ||
kubectl create ns bookinfo | ||
|
||
kubectl label namespace bookinfo istio-injection=enabled | ||
``` | ||
|
||
#### 部署服务 | ||
```shell | ||
# 部署服务 | ||
kubectl apply -f ./bookinfo/platform/kube/bookinfo.yaml -n bookinfo | ||
|
||
# 查看服务 | ||
[frank@node samples]$ kubectl get service -n bookinfo | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
details ClusterIP 10.105.147.235 <none> 9080/TCP 72s | ||
productpage ClusterIP 10.107.73.208 <none> 9080/TCP 72s | ||
ratings ClusterIP 10.106.13.108 <none> 9080/TCP 72s | ||
reviews ClusterIP 10.101.90.80 <none> 9080/TCP 72s | ||
|
||
# 查看pod | ||
[frank@node samples]$ kubectl get pods -n bookinfo | ||
details-v1-558b8b4b76-l56z9 2/2 Running 0 66m | ||
productpage-v1-6987489c74-9lxdh 2/2 Running 0 66m | ||
ratings-v1-7dc98c7588-tq662 2/2 Running 0 66m | ||
reviews-v1-7f99cc4496-6klkl 2/2 Running 0 66m | ||
reviews-v2-7d79d5bd5d-9svct 2/2 Running 0 66m | ||
reviews-v3-7dbcdcbc56-65qg2 2/2 Running 0 66m | ||
``` | ||
|
||
#### 部署Gateway | ||
```shell | ||
kubectl apply -f ./bookinfo/networking/bookinfo-gateway.yaml -n bookinfo | ||
kubectl get gateway -n bookinfo | ||
``` | ||
|
||
#### 设置 | ||
```shell | ||
kubectl get svc istio-ingressgateway -n istio-system | ||
|
||
# for loadbalancer | ||
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}') | ||
# export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}') | ||
# export TCP_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="tcp")].port}') | ||
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT | ||
``` | ||
|
||
|
||
### 参考资料 | ||
+ [《examples/bookinfo》](https://istio.io/latest/docs/examples/bookinfo/) |