nwcdheap / kops-cn

AWS中国宁夏区域/北京区域,快速Kops部署K8S集群
Apache License 2.0
121 stars 74 forks source link

我需要k8s.gcr.io的镜像,我需要提交PR吗? #107

Closed pahud closed 5 years ago

pahud commented 5 years ago

集群创建完成了,后续k8s.gcr.io的镜像需求,我需要提交required-images.txt修正吗?

所有k8s.gcr.io的镜像在Docker hub都有对应的mirorr

https://hub.docker.com/u/googlecontainer

因此以这个cluster-autoscaler为例:

https://github.com/kubernetes/autoscaler/blob/8303a2355e55dc7a416a8a80359207b774556d51/cluster-autoscaler/cloudprovider/aws/examples/cluster-autoscaler-one-asg.yaml#L132

如果你需要kubectl apply -f的yaml里面包含k8s.gcr.io的镜像,你可以直接修改yaml的image path成

googlecontainer/IMAGE:TAG

例如

googlecontainer/cluster-autoscaler:v1.12.3

如此kops-cn会透过registry-docker-cn.com的mirror来抓取,速度很快

https://github.com/nwcdlabs/kops-cn/blob/54f7de28cb98f1a912696850fee84f203873bf2d/spec.yml#L8

如此就不需要提交到required-images.txt了。

那什么时候需要提交required-images.txt

在kops-cn 集群create阶段如果有依赖k8s.gcr.io的镜像,因为无法强迫它使用docker hub googlecontainer mirror,因此需要提交required-images.txt修改,此时因为这个配置, kops-cn会强迫使用containerRegistry而不会访问k8s.gcr.io。

https://github.com/nwcdlabs/kops-cn/blob/54f7de28cb98f1a912696850fee84f203873bf2d/spec.yml#L3