说明: 当我们离线部署istio时,我们的业务pod中将会添加istio的代理容器proxy,此时如果不做更改默认将会从docker.io/istio去下载proxy的镜像,我们可以将默认镜像下载地址更改为本地仓库地址 (我这里使用的是istio-1.15.4) 步骤如下:
1. 查看configMap资源
root@k8s-master:/opt/istio-1.15.4# kubectl get configmaps -n istio-system
NAME DATA AGE
grafana 4 29h
istio 2 21d
istio-ca-root-cert 1 21d
istio-gateway-deployment-leader 0 21d
istio-gateway-status-leader 0 21d
istio-grafana-dashboards 2 29h
istio-leader 0 21d
istio-namespace-controller-election 0 21d
istio-services-grafana-dashboards 4 29h
istio-sidecar-injector 2 21d
kube-root-ca.crt 1 21d
prometheus 5 28h
从上面的可以看出来有一个configMap 叫istio-sidecar-injector
2. 编辑istio-sidecar-injector
kubectl edit configmaps istio-sidecar-injector -n istio-system
// 更改前:
"enabled": true,
"externalIstiod": false,
"hub": "docker.io/istio",
"imagePullPolicy": "",
"imagePullSecrets": [],
"istioNamespace": "istio-system",
"istiod": {
"enableAnalysis": false
},
//更改后:
"enabled": true,
"externalIstiod": false,
"hub": "235-registry:5000/istio",
"imagePullPolicy": "",
"imagePullSecrets": [],
"istioNamespace": "istio-system",
"istiod": {
"enableAnalysis": false
},
上面将"hub": “docker.io/istio”, 改为 “hub”: “235-registry:5000/istio”,