Offline Istio Addon Install

安装istio、addon #

本文介绍离线安装istio、kiali等addon。

设置环境变量

# 镜像仓库地址
$ export DOCKER_HUB=localhost:5000/solarmesh
# solarmesh版本
$ export TAG=v1.11.2
# istio版本
$ export ISTIO_TAG=1.11.5

Istio离线安装 #

下载 istioctl

wget http://release.solarmesh.cn/istio/istioctl/istioctl-1.11.5.tar.gz
tar -xvf istioctl-1.11.5.tar.gz

初始化 istio-operator

istioctl operator init --hub $DOCKER_HUB --tag $ISTIO_TAG

安装 istio相关组件

kubectl apply -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
  name: example-istiocontrolplane
spec:
  hub: $DOCKER_HUB
  tag: $ISTIO_TAG
  profile: demo
  meshConfig:
    accessLogFile: /dev/stdout
    enableTracing: true
    defaultConfig:
      proxyMetadata:
        ISTIO_META_DNS_CAPTURE: "true"
        ISTIO_META_DNS_AUTO_ALLOCATE: "true"  
  values:
    global:  ## 注意:以下配置在安装solarmesh的时候也会出现
      meshID: mesh01
      multiCluster:
        clusterName: cluster01
      network: network1
  components:
    ingressGateways:
      - name: istio-ingressgateway
        enabled: true
        k8s: 
          service:
            ports:
              - name: status-port
                port: 15021
                protocol: TCP
                targetPort: 15021
              - name: http2
                port: 80
                protocol: TCP
                targetPort: 8080
              - name: https
                port: 443
                protocol: TCP
                targetPort: 8443
              - name: tcp
                port: 31400
                protocol: TCP
                targetPort: 31400
              - name: tls
                port: 15443
                protocol: TCP
                targetPort: 15443
              - name: promethues ## 以下是支撑 solarmesh的配置
                port: 9090
                protocol: TCP
                targetPort: 9090
              - name: kiali
                port: 20001
                protocol: TCP
                targetPort: 20001
              - name: networking-agent
                port: 7575
                protocol: TCP
                targetPort: 7575
              - name: grafana
                port: 3000
                protocol: TCP
                targetPort: 3000
              - name: jaeger
                port: 16686
                protocol: TCP
                targetPort: 16686  
EOF

验证 #

~ kubectl get po -A
NAME                                                                 READY   STATUS    RESTARTS   AGE
istio-operator       istio-operator-74b5cbf55f-b6f2s                 1/1     Running   0          4m27s
istio-system         istio-egressgateway-7f599d85f5-bt9jh            1/1     Running   0          3m30s
istio-system         istio-ingressgateway-7c9b74fbc-k99f5            1/1     Running   0          3m30s
istio-system         istiod-88c94d9dc-xcvhx                          1/1     Running   0          3m39s

如上所示,istio 已经安装完成 .

安装kiali #

solarctl install kiali --hub $DOCKER_HUB

日志如下:

2022-08-26T06:23:19.820480Z	info	creating resource: ServiceAccount/istio-system/kiali
2022-08-26T06:23:19.844228Z	info	creating resource: ClusterRole//kiali
2022-08-26T06:23:19.857449Z	info	creating resource: ClusterRole//kiali-viewer
2022-08-26T06:23:19.869761Z	info	creating resource: ClusterRoleBinding//kiali
2022-08-26T06:23:19.882474Z	info	creating resource: ConfigMap/istio-system/kiali
2022-08-26T06:23:19.904289Z	info	creating resource: Deployment/istio-system/kiali
2022-08-26T06:23:19.920653Z	info	creating resource: Role/istio-system/kiali-controlplane
2022-08-26T06:23:19.932220Z	info	creating resource: RoleBinding/istio-system/kiali-controlplane
2022-08-26T06:23:19.945632Z	info	creating resource: Service/istio-system/kiali
2022-08-26T06:23:20.027450Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:22.046694Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:24.048258Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:26.058880Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:28.050378Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:30.051705Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:32.054021Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:34.053791Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:36.068453Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:38.052713Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:40.052228Z	info	installer	not ready :[Deployment/istio-system/kiali Pod/istio-system/kiali-8679df7b97-gkrh2]
2022-08-26T06:23:42.076641Z	info	installer	install Kiali : ✔

kiali安装成功。

安装grafana(可选) #

solarctl install grafana --hub $DOCKER_HUB

安装jaeger(可选) #

solarctl install jaeger --hub $DOCKER_HUB