去看k8s配套的istio的版本
https://istio.io/latest/docs/releases/supported-releases/#support-status-of-istio-releases
1. 下载安装包
https://github.com/istio/istio/releases/download
2. 解压
tar xvf istio-1.17.2-linux-amd64.tar.gz
mv istio-1.17.2/bin/istioctl /usr/local/bin
验证:istioctl version
3. 安装isto的operator
istioctl operator init
执行完之后会多两个命名空间 istio-operator和istio-system(无内容)
# 安装
root@k8s-cluster:/data/istio-1.17.2# istioctl operator init Installing operator controller in namespace: istio-operator using image: docker.io/istio/operator:1.17.2 Operator controller will watch namespaces: istio-system ✔ Istio operator installed ✔ Installation complete
#查看 root@k8s-cluster:/data# kubectl get pod -n istio-operator NAME READY STATUS RESTARTS AGE istio-operator-585ff76cb5-f8vxs 1/1 Running 0 35s
4. 安装istio
istioctl manifest apply -f istio-operator.yaml
安装完istio-system 会多两个pod,一个istiod,一个ingress-gateway
apiVersion: install.istio.io/v1alpha1 kind: IstioOperator metadata: namespace: istio-system name: example-istiocontrolplane spec: profile: default components: # 自定义组件配置 ingressGateways: # 自定义 ingressGateway 配置 - name: istio-ingressgateway enabled: true # 开启 ingressGateway k8s: # 自定义 ingressGateway 的 Kubernetes 配置 service: # 将 Service 类型改成 NodePort type: NodePort ports: - port: 15020 nodePort: 30520 name: status-port - port: 80 nodePort: 30080 name: http2 targetPort: 8080 - port: 443 nodePort: 30443 name: https targetPort: 8443
root@k8s-node:~# istioctl manifest apply -f istio-operator.yamlThis will install the Istio 1.18.2 default profile with ["Istio core" "Istiod" "Ingress gateways"] components into the cluster. Proceed? (y/N) y
✔ Istio core installed ✔ Istiod installed Processing resources for Ingress gateways. Waiting for Deployment/istio-system/istio-ingressgateway ✔ Ingress gateways installed ✔ Installation complete
#查看
root@k8s-cluster:/data/image_package# kubectl get pod -n istio-system
NAME READY STATUS RESTARTS AGE
istio-ingressgateway-76498b844c-85699 1/1 Running 0 21m
istiod-7447fd9c6b-dzcqp 1/1 Running 0 26m
Making this installation the default for injection and validation.
安装插件
kubectl create -f samples/addons/kiali.yaml
kubectl edit svc kiali -n istio-system
把ClusterIp改为NodePort
root@k8s-cluster:/data/istio-1.17.2# kubectl create -f samples/addons/kiali.yaml serviceaccount/kiali created configmap/kiali created clusterrole.rbac.authorization.k8s.io/kiali-viewer created clusterrole.rbac.authorization.k8s.io/kiali created clusterrolebinding.rbac.authorization.k8s.io/kiali created role.rbac.authorization.k8s.io/kiali-controlplane created rolebinding.rbac.authorization.k8s.io/kiali-controlplane created service/kiali created deployment.apps/kiali created
kubectl create -f samples/addons/jaeger.yaml