centOS7 安装istio

一、安装Istio
下载:Istio 1.9.0
https://gh.con.sh/https://github.com/istio/istio/releases/download/1.9.0/istio-1.9.0-linux-amd64.tar.gz
cd /application
tar -xzvf istio-1.9.0-linux-amd64.tar.gz
cd /application/istio-1.9.0
export PATH=$PWD/bin:$PATH
istioctl install --set profile=demo -y #(安装教程:https://istio.io/latest/docs/setup/getting-started/)
kubectl label namespace default istio-injection=enabled
kubectl -n istio-system get deploy



#############################beginsample###########################

#Deploy the sample application
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml 
#The application will start. As each pod becomes ready, the Istio sidecar will be deployed along with it.
kubectl get services
kubectl get pods
#Verify everything is working correctly up to this point. Run this command to see if the app is running inside the cluster and serving HTML pages by checking for the page title in the response:
kubectl exec "$(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"

#Associate this application with the Istio gateway:
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
#Ensure that there are no issues with the configuration:
istioctl analyze

########################endsample###############################

#Determining the ingress IP and ports
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}')
#Ensure a port was successfully assigned to each environment variable:
echo "$INGRESS_PORT" #通过istio网关访问地址:http://istio.egressgateway.com:31468/productpage (本地机器配置host: 192.168.1.107 istio.egressgateway.com)
echo "$SECURE_INGRESS_PORT" 


#Set GATEWAY_URL:
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
#Ensure an IP address and port were successfully assigned to the environment variable:
echo "$GATEWAY_URL"

#Verify external access (sample)
#Run the following command to retrieve the external address of the Bookinfo application.
echo "http://$GATEWAY_URL/productpage"



============================安装kiali======================
https://kiali.io/documentation/latest/quick-start/

#View the dashboard
#Install Kiali and the other addons and wait for them to be deployed.
kubectl apply -f samples/addons
kubectl rollout status deployment/kiali -n istio-system

#修改kialiNode暴露端口
kubectl apply -f /application/istio-1.9.0/samples/addons/kiali.yaml
##################################修改的部分内容############################
spec:
  ports:
  - name: http
    protocol: TCP
    port: 20001
    nodePort: 30100
  - name: http-metrics
    protocol: TCP
    port: 9090
    nodePort: 30101
  type: "NodePort"
  selector:
    app.kubernetes.io/name: kiali
    app.kubernetes.io/instance: kiali-server
######################################################################

kubectl get svc -n istio-system
#Access the Kiali dashboard.
cd /application/istio-1.9.0
export PATH=$PWD/bin:$PATH
istioctl dashboard kiali
#输出:
http://localhost:20001/kiali

#允许防火墙端口
firewall-cmd --zone=public --add-port=20002/tcp --permanent
firewall-cmd --reload
浏览器访问:
http://192.168.1.111:30100/kiali

运行效果:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值