《OpenShift 4.x HOL教程汇总》
说明:本文已经在OpenShift 4.8环境中验证

安装部署

以下安装部署脚本包括OpenShift Service Mesh环境安装脚本,和istio网站推荐的演示程序bookinfo(https://istio.io/latest/docs/examples/bookinfo/)安装脚本。

#install the elastic operator
cat <<EOM | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:name: elasticsearch-operatornamespace: openshift-operators
spec:channel: stableinstallPlanApproval: Automaticname: elasticsearch-operatorsource: redhat-operatorssourceNamespace: openshift-marketplace
EOM#install the Kiali operator
cat <<EOM | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:name: kiali-ossmnamespace: openshift-operators
spec:channel: stableinstallPlanApproval: Automaticname: kiali-ossmsource: redhat-operatorssourceNamespace: openshift-marketplace
EOM#install the Jaeger operator
cat <<EOM | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:name: jaeger-productnamespace: openshift-operators
spec:channel: stableinstallPlanApproval: Automaticname: jaeger-productsource: redhat-operatorssourceNamespace: openshift-marketplace
EOM#install the ServiceMesh operator
cat <<EOM | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:name: servicemeshoperatornamespace: openshift-operators
spec:channel: stableinstallPlanApproval: Automaticname: servicemeshoperatorsource: redhat-operatorssourceNamespace: openshift-marketplace
EOM#wait for crds
for crd in servicemeshcontrolplanes.maistra.io servicemeshmemberrolls.maistra.io kialis.kiali.io jaegers.jaegertracing.io
doecho -n "Waiting for $crd ..."while ! oc get crd $crd > /dev/null 2>&1dosleep 2echo -n '.'doneecho "done."
done#wait for service mesh operator deployment
servicemesh_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep istio)
while [ "${servicemesh_deployment}" == "" ]
dosleep 2servicemesh_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep ist
io)
done#wait for Kiali operator deployment
kiali_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep kiali)
while [ "${kiali_deployment}" == "" ]
dosleep 2kiali_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep kiali)
done#wait for Jaeger operator deployment
jaeger_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep jaeger)
while [ "${jaeger_deployment}" == "" ]
dosleep 2jaeger_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep jaeger)
done#wait for elastic operator deployment
elastic_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep elastic)
while [ "${elastic_deployment}" == "" ]
dosleep 2elastic_deployment=$(oc get deployment -n openshift-operators -o name 2>/dev/null | grep elastic
)
doneecho "Waiting for operator deployments to start..."
for op in ${servicemesh_deployment} ${kiali_deployment} ${jaeger_deployment} ${elastic_deployment}
doecho -n "Waiting for ${op} to be ready..."readyReplicas="0"while [ "$?" != "0" -o "$readyReplicas" == "0" ]dosleep 1echo -n '.'readyReplicas="$(oc get ${op} -n openshift-operators -o jsonpath='{.status.readyReplicas}' 2> /dev/null)"doneecho "done."
doneexport CONTROL_PLANE_NS=use15-istio-system
export BOOKINFO_NS=bookinfo
oc new-project ${CONTROL_PLANE_NS}
oc new-project ${BOOKINFO_NS}echo "Creating the scmp/smmr..."
#create our smcp
cat <<EOM | oc apply -f -
apiVersion: maistra.io/v2
kind: ServiceMeshControlPlane
metadata:namespace: ${CONTROL_PLANE_NS}name: basic
spec:tracing:sampling: 10000type: Jaegerpolicy:type: Istiodaddons:grafana:enabled: truejaeger:install:storage:type: Memorykiali:enabled: trueprometheus:enabled: trueversion: v2.0telemetry:type: Istiod
EOM#create our smmr
cat <<EOM | oc apply -f -
apiVersion: maistra.io/v1
kind: ServiceMeshMemberRoll
metadata:namespace: ${CONTROL_PLANE_NS}name: default
spec:members:
EOM#wait for smcp to fully install
echo -n "Waiting for smcp to fully install (this will take a few moments) ..."
basic_install_smcp=$(oc get smcp -n ${CONTROL_PLANE_NS} basic 2>/dev/null | grep ComponentsReady)
while [ "${basic_install_smcp}" == "" ]
doecho -n '.'sleep 5basic_install_smcp=$(oc get smcp -n ${CONTROL_PLANE_NS} basic 2>/dev/null | grep ComponentsReady)
done
echo "done."# install bookinfo
echo "Success, deploying bookinfo..."
oc patch -n ${CONTROL_PLANE_NS} --type='json' smmr default -p '[{"op": "add", "path": "/spec/members", "value":["'"${BOOKINFO_NS}"'"]}]'
oc apply -n ${BOOKINFO_NS} -f https://raw.githubusercontent.com/Maistra/istio/maistra-2.0/samples/bookinfo/platform/kube/bookinfo.yaml
oc apply -n ${BOOKINFO_NS} -f https://raw.githubusercontent.com/Maistra/istio/maistra-2.0/samples/bookinfo/networking/bookinfo-gateway.yaml
oc apply -n ${BOOKINFO_NS} -f https://raw.githubusercontent.com/Maistra/istio/maistra-2.0/samples/bookinfo/networking/destination-rule-all.yaml
export BOOKINFO_GATEWAY_URL=$(oc get route -n ${CONTROL_PLANE_NS} | grep ${BOOKINFO_NS} | awk -F ' ' '{print $2}')echo "Red Hat OpenShift Service Mesh and bookinfo has been deployed!"
echo "Test the bookinfo application out at: http://${BOOKINFO_GATEWAY_URL}/productpage"

演示

https://itnext.io/openshift-service-mesh-essentials-part-iv-features-routing-3189dae64615

OpenShift 4 - Service Mesh环境和BookInfo应用安装脚本相关推荐

  1. OpenShift 4 之通过命令创建Service Mesh环境

    <OpenShift 4.x HOL教程汇总> 本文使用命令行方式在OpenShift 4上创建Service Mesh运行环境,然后进行验证. 图形化方式创建Service Mesh运行 ...

  2. OpenShift 4 - Service Mesh使用入门

    <OpenShift 4.x HOL教程汇总> 说明:本文已经在OpenShift 4.10环境中验证 文章目录 部署Istio微服务,并验证访问 Istio 动态路由.灰度发布.流量镜像 ...

  3. OpenShift 4 - 创建Service Mesh运行环境

    <OpenShift 4.x HOL教程汇总> 说明:本文已经在OpenShift 4.10环境中验证 文章目录 安装 OpenShift Service Mesh 和相关依赖 Opera ...

  4. OpenShift 4 之运行Istio的BookInfo微服务应用

    <OpenShift 4.x HOL教程汇总> 本文部署Istio的实例BookInfo应用并配置访问路由等功能.在进行操作前,需先完成<OpenShift 4 之通过命令创建Ser ...

  5. 服务迁移之路 | Spring Cloud向Service Mesh转变 | 技术干货

    戳蓝字"CSDN云计算"关注我们哦! 技术头条:干货.简洁.多维全面.更多云计算精华知识尽在眼前,get要点.solve难题,统统不在话下! 作者: 李宁 转自:博云技术社区 Sp ...

  6. 干货 | 携程 SOA 的 Service Mesh 架构落地

    作者简介 本文作者 Dozer.Bender.vio-lin 来自携程 SOA 团队.目前主要负责 SOA 系统的研发工作和 Service Mesh 架构的演进.落地工作,同时也关注服务治理.JVM ...

  7. OpenShift 4 之Service Mesh教程(1)- 创建ServiceMesh环境,部署Istio的微服务

    <OpenShift 4.x HOL教程汇总> 说明:本文已经在OpenShift 4.8环境中验证 文章目录 创建ServiceMesh环境 部署Istio的微服务 参考 创建Servi ...

  8. OpenShift 4 之Service Mesh教程(5)- 断路器Circuit Breaker

    <OpenShift 4.x HOL教程汇总> 说明:本文已经在OpenShift 4.8环境中验证 本文将模拟一个运行了backend-v1的Pod出问题,并在发给backend-v1微 ...

  9. OpenShift 4 之Service Mesh教程(6)- 根据Header路由请求

    <OpenShift 4.x HOL教程汇总> 说明:本文已经在OpenShift 4.8环境中验证 文章目录 场景一 用 VirtualService 访问 Frontend 应用 用 ...

最新文章

  1. 最先进的目标检测器竟对大象“视而不见”
  2. 第一行代码读书笔记1+常见错误分析
  3. Linux服务部署常用命令--top、free、df、scp
  4. 模拟3个人排除买票,每人买1张票。售货员只有1张五元的钱,电影票5元一张
  5. java子类和父类实例_java中父类与子类之间的转换示例
  6. 项目review会议的步骤_进行完美的30分钟会议的6个步骤
  7. 机器视觉系统设计难点有哪些?
  8. maven项目的pom文件中常用的简单的标签理解
  9. 中国经济蓝皮书发布 该死的房价下降成定局
  10. CTF——9款网站目录扫描工具推荐——附下载链接与相关字典
  11. python transforms_2.2 图像预处理——transforms(笔记)
  12. java声卡录音_win10下程序无法录音或使用麦克风
  13. 同时连接多个以及如何配置?
  14. ACM/ICPC简介
  15. 停止对初创企业的限制
  16. matlab中rand(‘seed‘,任意符号)是干什么的?
  17. JSON 字符串是如何被解析的?JsonParser 了解一下
  18. 2020开年最火css效果实现
  19. OpenGL-立方体贴图之天空盒
  20. 2020.11.01 使用OpenCV进行图像形态学操作(开、闭、梯度)【OpenCV C++】

热门文章

  1. mysql抽屉图标_React Native自定义组件实现抽屉菜单控件效果
  2. prometheus命令_Prometheus+Grafana 基础及简单搭建
  3. 子类重写方法aop切不到_SpringBoot源码之旅——AOP
  4. 设计师必备|年年都能借鉴的新年Banner设计
  5. 中国红+金牛|传统农历年新年新春海报稳妥设计方案!
  6. 极简主义2020UI设计正流行,欣赏下可临摹的案例模板!
  7. 超时尚的UI电子商务PSD分层模板,临摹学习必备
  8. mysql 5.7 源码编译安装_mysql-5.7.*源码编译安装
  9. plc和pc串口通讯接线_PC与PLC的串口通信及编程实现
  10. python能够处理图像的第三方库_基于图像预处理的几个库