Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7400762
  • 博文数量: 1756
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16232
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1756)

文章存档

2024年(2)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: 系统运维

2021-01-11 10:50:27

curl -k -L | sh -
export PATH="$PATH:/root/istio-1.8.1/bin"

使用默认配置档安装 Istio
#istioctl install
istioctl install --set profile=demo -y

kubectl get svc,pod -n istio-system

给命名空间添加标签,指示 Istio 在部署应用的时候,自动的注入 Envoy 边车代理:
kubectl label namespace default istio-injection=enabled

部署 Bookinfo 示例应用:
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml

查看service
kubectl get services
NAME          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
details       ClusterIP   10.0.0.212              9080/TCP   29s
kubernetes    ClusterIP   10.0.0.1                443/TCP    25m
productpage   ClusterIP   10.0.0.57               9080/TCP   28s
ratings       ClusterIP   10.0.0.33               9080/TCP   29s
reviews       ClusterIP   10.0.0.28               9080/TCP   29s

查看POD
kubectl get pod|grep -v webserver
NAME                              READY   STATUS    RESTARTS   AGE
details-v1-558b8b4b76-2llld       2/2     Running   0          2m41s
productpage-v1-6987489c74-lpkgl   2/2     Running   0          2m40s
ratings-v1-7dc98c7588-vzftc       2/2     Running   0          2m41s
reviews-v1-7f99cc4496-gdxfn       2/2     Running   0          2m41s
reviews-v2-7d79d5bd5d-8zzqd       2/2     Running   0          2m41s
reviews-v3-7dbcdcbc56-m8dph       2/2     Running   0          2m41s

验证方方面面均工作无误
kubectl exec "$(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -s productpage:9080/productpage | grep -o ".*"
Simple Bookstore App

对外开放应用程序
把应用关联到 Istio 网关:
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
确保配置文件没有问题:
istioctl analyze
No validation issues found when analyzing namespace: default.

确定入站 IP 和端口
kubectl get svc istio-ingressgateway -n istio-system
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                      AGE
istio-ingressgateway   LoadBalancer   10.43.220.189        15021:32736/TCP,80:31738/TCP,443:30737/TCP,31400:30193/TCP,15443:32134/TCP   38m

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}')
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}')
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
echo "$GATEWAY_URL"

获取外部访问地址
echo ""


仪表板
kubectl apply -f samples/addons  #需要执行两次,第一次一般会有报错
kubectl rollout status deployment/kiali -n istio-system
Waiting for deployment "kiali" rollout to finish: 0 of 1 updated replicas are available...
deployment "kiali" successfully rolled out

kubectl get pod -n istio-system

访问 Kiali 仪表板
#istioctl dashboard kiali
istioctl dashboard kiali --address "0.0.0.0"

Failed to open browser; open in your browser.
打开


阅读(1471) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~