Offline Office Install

业务集群的安装(离线版本) #

前置条件 #

  1. 预备环境准备
  2. 管理集群安装

使用 solar-operator 接管集群 #

初始化 solar-operator #

⚠️ 若集群内存在内部负载均衡(Internal Load Balancer),直接初始化solar-operator即可

solarctl operator init

若集群内没有内部负载均衡(Internal Load Balancer),使用以下命令获取ISTIOD_REMOTE_EP

export ISTIOD_REMOTE_EP=$(kubectl get nodes|awk '{print $1}' |awk 'NR==2'|xargs -n 1 kubectl get nodes  -o jsonpath='{.status.addresses[0].address}')

通过ISTIOD_REMOTE_EP初始化solar-operator

solarctl operator init  --hub $DOCKER_HUB --external-ip $ISTIOD_REMOTE_EP --eastwest-external-ip $ISTIOD_REMOTE_EP 

使用operator安装istio #

创建namespace

kubectl create ns service-mesh

创建 SolarOperator 资源。创建前,请认真查看以下内容:

⚠️istioVersion:istio的版本,需要对应您安装的istio版本,支持 1.9 及以上。

⚠️SolarOperator会默认在monitoring下安装prometheus,若集群中相应位置存在prometheus,请参考 solaroperator 配置详解 关掉prometheus安装。

kubectl apply -f - <<EOF
apiVersion: install.solar.io/v1alpha1
kind: SolarOperator
metadata:
  name: cluster01
  namespace: solar-operator 
spec:
  istioVersion: "1.11"  ## 对应您Istio的安装版本
  profile: default
  hub: $DOCKER_HUB # 例 localhost:5000/solarmesh
  addonComponents:
    alertmanager:
      configReloaderImage: $DOCKER_HUB/configmap-reload:v0.0.1 # 例 localhost:5000/solarmesh/configmap-reload:v0.0.1
    prometheusOperator:
      configReloaderImage: $DOCKER_HUB/configmap-reload:v0.0.1
      prometheusConfigReloader: $DOCKER_HUB/prometheus-config-reloader:v0.38.1
EOF

查看 solar-operator 的日志

kubectl logs -f -n solar-operator -l app=solar-operator

如果看到 install solar mesh : ✔ 则代表 SolarMesh 安装完成

2022-08-22T05:41:04.152061Z	info	creating resource: Gateway/istio-system/kiali-gateway
2022-08-22T05:41:04.171095Z	info	creating resource: Gateway/istio-system/prometheus-gateway
2022-08-22T05:41:04.189222Z	info	creating resource: VirtualService/istio-system/kiali-vs
2022-08-22T05:41:04.205080Z	info	creating resource: VirtualService/istio-system/prometheus-vs
2022-08-22T05:41:04.216740Z	info	 solar graph : ✔

2022-08-22T05:41:04.260660Z	info	operator filter ---> :false
2022-08-22T05:41:04.261225Z	info	install solar mesh  : ✔

如何卸载SolarMesh? #

如果需要卸载SolarMesh,请参考solarctl uninstall命令

➜  ~ solarctl uninstall -h
The remove subcommand installs, removes and shows the status of the operator controller.

Usage:
  solarctl uninstall [command]

Available Commands:
  cluster     Commands related to solarmesh manifests
  istio       Uninstall Istio from a cluster
  solarmesh   The manifest command generates and diffs solarmesh manifests.

Flags:
  -h, --help   help for uninstall

Use "solarctl uninstall [command] --help" for more information about a command.

业务集群卸载

卸载SolarMesh的业务服务

solarctl uninstall cluster

卸载Istio

solarctl uninstall istio