istio代理容器proxy更改为本地仓库下载

说明: 当我们离线部署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”,

3. 此配置是热加载,更改完成后不用做任何其他事即可生效

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kjkdd

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值