安装velero时k8s无法拉取私有仓库镜像http: server gave HTTP response to HTTPS client
,因为docker拉取找的https,本地仓库是http,而且daemon.json中已经添加过私有镜像仓库地址,
清除下缓存试试。清除之前记得备份一下。
【以下回答由 GPT 生成】
回答:
这个问题通常是由于k8s节点缺少对私有仓库的证书或者认证凭据引起的。下面是解决该问题的一些步骤和建议。
/etc/docker/daemon.json
文件中配置了私有镜像仓库的地址,并且地址正确。{
"insecure-registries": ["your.private.registry"]
}
sudo systemctl restart docker
kubectl create secret docker-registry <secret-name> --docker-server=<your-registry-server> --docker-username=<username> --docker-password=<password> --docker-email=<your-email>
确保替换<secret-name>
,<your-registry-server>
,<username>
,<password>
和<your-email>
为正确的值。
在velero的安装配置中添加对私有仓库的认证凭据:在安装velero时,你需要在命令行参数或配置文件中添加私有仓库的认证凭据。这可以通过以下方式实现。
如果你使用命令行参数安装velero,可以在--plugins
参数中添加认证凭据。
bash velero install \ --provider aws \ --bucket <your-bucket> \ --secret-file <path-to-credentials-file> \ --plugins https://github.com/vmware-tanzu/velero-plugin-for-aws/releases/latest/download/velero-plugin-for-aws.tar.gz \ --use-restic
确保替换<path-to-credentials-file>
为你的私有仓库认证凭据的路径。
yaml apiVersion: velero.io/v1 kind: BackupStorageLocation metadata: name: default spec: provider: aws config: region: <your-region> bucket: <your-bucket> credentials: name: <your-secret-name>
确保替换<your-secret-name>
为你在步骤3中创建的Secret对象的名称。
如果按照上述步骤操作后问题仍然存在,请确保检查网络连接是否正常,以及私有仓库是否可以通过其他方式访问。如果问题仍未解决,请参考k8s和velero的官方文档,或寻求进一步的技术支持。
协议不匹配,要么统一协议,要么忽略https
Docker向私有仓库拉取/推送镜像报错(http: server gave HTTP response to HTTPS client)解决方法
编辑/etc/docker/daemon.json文件,如下所示。
vim /etc/docker/daemon.json
在文件中添加如下配置。
"insecure-registries":["192.168.175.101:1180"]
如果 /etc/docker/daemon.json文件中已经存在insecure-registries配置,我们可以在后面追加相应的配置即可,例如追加后的效果如下所示。
"insecure-registries":["192.168.175.101:1180", "192.168.175.102:1180"]
可以参考:
K8S如何以http方式拉取私有镜像仓库:https://download.csdn.net/blog/column/10867427/124445591
或者这个:
k8s 从私有仓库拉取镜像:https://www.jianshu.com/p/3f24bbee72ad