部署bookinfo

Bookinfo åºç¨

1、设置label

kubectl label namespace default istio-injection=enabled
error: 'istio-injection' already has a value (enabled), and --overwrite is false
2、部署bookinfo

kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
service/details created
deployment.extensions/details-v1 created
service/ratings created
deployment.extensions/ratings-v1 created
service/reviews created
deployment.extensions/reviews-v1 created
deployment.extensions/reviews-v2 created
deployment.extensions/reviews-v3 created
service/productpage created
deployment.extensions/productpage-v1 created

备注:手工Sidecar注入命令:

kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/platform/kube/bookinfo.yaml)

3、定义gateway

kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
gateway.networking.istio.io/bookinfo-gateway created
virtualservice.networking.istio.io/bookinfo created

4、确认

kubectl get svc
NAME          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
details       ClusterIP   10.100.16.52    <none>        9080/TCP   3m
kubernetes    ClusterIP   10.96.0.1       <none>        443/TCP    57m
productpage   ClusterIP   10.109.131.28   <none>        9080/TCP   3m
ratings       ClusterIP   10.99.51.210    <none>        9080/TCP   3m
reviews       ClusterIP   10.103.39.35    <none>        9080/TCP   3m
 

kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE
details-v1-6764bbc7f7-4xn7n      2/2       Running   0          3m
productpage-v1-54b8b9f55-zxffs   2/2       Running   0          3m
ratings-v1-7bc85949-q8lbp        2/2       Running   0          3m
reviews-v1-fdbf674bb-zgsrg       2/2       Running   0          3m
reviews-v2-5bdc5877d6-h5n6t      2/2       Running   0          3m
reviews-v3-dd846cc78-m9pwz       2/2       Running   0          3m

 

kubectl get gateway
NAME               AGE
bookinfo-gateway   1m
5、确认Node Port时ingress IP和端口

export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')

export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')

echo $INGRESS_PORT
31380

echo $SECURE_INGRESS_PORT
31390

6、设置GATEWAY_URL

export GATEWAY_URL=172.16.33.151:$INGRESS_PORT

7、确认运用正常运行中

# curl -o /dev/null -s -w "%{http_code}\n" http://${GATEWAY_URL}/productpage
200

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值