借助同事做的Openshift All in one,现在装istio,也是非常快捷,便利。这里就不记录原理,仅仅是把过程整理一遍。
参考文章
https://www.jianshu.com/p/27163901e01a 同事大作
All in one
要求操作系统selinux打开,我是采用4core,8G内存的虚拟机来安装,基本没问题。
git clone https://gitee.com/xhua/OpenshiftOneClick.git -b 3.11 cd OpenshiftOneClick bash deploy_openshift.sh
你是可以定制你自己的域名,通过修改配置文件 config.yaml,关于Elasticsearch的参数修改,我们已经在脚本实现。
istio 安装部署
下载镜像
可以进入 OpenshiftOneClick/istio/ 目录下,里面有下载镜像的脚本,提前下载镜像,是为了解决安装过程中因为镜像下载速度过慢导致的安装失败。
bash docker-pull-images.sh
配置master-config
使得新建pod自动注入istio-proxy sidecar
cp master-config.patch /etc/origin/master/master-config.patch cd /etc/origin/master/ cp -p master-config.yaml master-config.yaml.prepatch oc ex config patch master-config.yaml.prepatch -p "$(cat master-config.patch)" > master-config.yaml /usr/local/bin/master-restart api && /usr/local/bin/master-restart controllers cd -
Istio Operator
oc new-project istio-operator oc new-app -f istio_product_operator_template.yaml \ --param=OPENSHIFT_ISTIO_MASTER_PUBLIC_URL=https://os311.test.it.example.com:8443
如果你修改了域名,那么https://os311.test.it.example.com,你就需要修改就可以。
部署Istio
镜像在本地,其实部署的过程很快
oc create -f istio-installation.yaml -n istio-operator
Bookinfo Demo
进入 OpenshiftOneClick/istio/bookinfo-sample 目录下,相关配置都在这里
oc new-project bookinfo oc adm policy add-scc-to-user anyuid -z default -n bookinfo oc adm policy add-scc-to-user privileged -z default -n bookinfo oc apply -n bookinfo -f bookinfo.yaml oc apply -n bookinfo -f bookinfo-gateway.yaml
访问
访问相关地址,需要设置本地的hosts文件 C:\Windows\System32\Drivers\etc
139.198.17.101 os311.test.it.example.com 139.198.17.101 registry-console-default.apps.os311.test.it.example.com 139.198.17.101 alertmanager-main-openshift-monitoring.apps.os311.test.it.example.com 139.198.17.101 hawkular-metrics.apps.os311.test.it.example.com 139.198.17.101 console.apps.os311.test.it.example.com 139.198.17.101 jenkins-cicd.apps.os311.test.it.example.com 139.198.17.101 sonarqube-cicd.apps.os311.test.it.example.com 139.198.17.101 gitlab-cicd.apps.os311.test.it.example.com 139.198.17.101 gogs-cicd.apps.os311.test.it.example.com 139.198.17.101 nexus3-cicd.apps.os311.test.it.example.com 139.198.17.101 jeesite-jeesite.apps.os311.test.it.example.com 139.198.17.101 jenkins-jeesite.apps.os311.test.it.example.com 139.198.17.101 prometheus-k8s-openshift-monitoring.apps.os311.test.it.example.com 139.198.17.101 grafana-openshift-monitoring.apps.os311.test.it.example.com 139.198.17.101 etherpad-etherpad.apps.os311.test.it.example.com 139.198.17.101 kubevirt-web-ui.apps.os311.test.it.example.com 139.198.17.101 istio-ingressgateway-istio-system.apps.os311.test.it.example.com 139.198.17.101 kiali-istio-system.apps.os311.test.it.example.com 139.198.17.101 prometheus-istio-system.apps.os311.test.it.example.com 139.198.17.101 grafana-istio-system.apps.os311.test.it.example.com