[转帖]k8s国内镜像
k8s国内镜像
最近折腾k8s,使用kubeadm部署集群,遇到镜像下载的问题
$ kubeadm config images list
k8s.gcr.io/kube-apiserver:v1.14.1
k8s.gcr.io/kube-controller-manager:v1.14.1
k8s.gcr.io/kube-scheduler:v1.14.1
k8s.gcr.io/kube-proxy:v1.14.1
k8s.gcr.io/pause:3.1
k8s.gcr.io/etcd:3.3.10
k8s.gcr.io/coredns:1.3.1
由于一些众所周知的原因,国内是不太容易下载k8s.gcr.io站点的镜像的,偶然发现微软做了一个k8s的镜像站点,真香
| global | proxy in China |
|---|---|
| dockerhub (docker.io) | dockerhub.azk8s.cn |
| gcr.io
k8s.gcr.io |
gcr.azk8s.cn
|
| quay.io | quay.azk8s.cn |
注意,因为k8s.gcr.io会重定向到gcr.io/google-containers,因此比如安装k8s所必须的镜像如 k8s.gcr.io/pause:3.1
需要替换成 gcr.azk8s.cn/google-containers/pause:3.1
已经使用超过一周,非常稳定。
- https://github.com/Azure/container-service-for-azure-china/blob/master/aks/README.md
- 官网介绍
Container Registry
2.1 Azure Container Registry(ACR)
Azure Container Registry(ACR) provides storage of private Docker container images, enabling fast, scalable retrieval, and network-close deployment of container workloads on Azure.
ACR does not provide public anonymous access functionality on Azure China, this feature is in public preview on global Azure.
AKS has good integration with ACR, container image stored in ACR could be pulled in AKS after Configure ACR authentication.
2.2 Container Registry Proxy
Since some well known container registries like
docker.io,gcr.ioare not accessible or very slow in China, we have set up container registry proxies on Azure China for public anonymous access:The first docker pull of new image will be still slow, and then image would be cached, would be much faster in the next docker pull action.
global proxy in China format example dockerhub(docker.io) dockerhub.azk8s.cn dockerhub.azk8s.cn/<repo-name>/<image-name>:<version>dockerhub.azk8s.cn/microsoft/azure-cli:2.0.61dockerhub.azk8s.cn/library/nginx:1.15gcr.io gcr.azk8s.cn gcr.azk8s.cn/<repo-name>/<image-name>:<version>gcr.azk8s.cn/google_containers/hyperkube-amd64:v1.13.5quay.io quay.azk8s.cn quay.azk8s.cn/<repo-name>/<image-name>:<version>quay.azk8s.cn/deis/go-dev:v1.10.0Note:
k8s.gcr.iowould redirect togcr.io/google-containers, following image urls are identical:k8s.gcr.io/pause-amd64:3.1 gcr.io/google_containers/pause-amd64:3.1Container Registry Proxy Example
specify
defaultBackend.image.repositoryasgcr.azk8s.cn/google_containers/defaultbackendin nginx-ingress chart since originalk8s.gcr.iodoes not work in Azure China:helm install stable/nginx-ingress --set defaultBackend.image.repository=gcr.azk8s.cn/google_containers/defaultbackend --set defaultBackend.image.tag=1.4
3. Install kubectl
az aks install-clicommand is used to downloadkubectlbinary, it works on Azure China from version2.0.61or later, another alternative is use following command to downloadkubectlif don't have azure-cli:# docker run -v ${HOME}:/root -v /usr/local/bin/:/kube -it dockerhub.azk8s.cn/microsoft/azure-cli:2.0.61 root@09feb993f352:/# az cloud set --name AzureChinaCloud root@09feb993f352:/# az aks install-cli --install-location /kube/kubectlrun
sudo az aks install-cliif hit following permission errorConnection error while attempting to download client ([Errno 13] Permission denied: '/usr/local/bin/kubectl'4. Install helm
Follow detailed installation steps here.
- Example:
# Install wordpress helm repo add bitnami https://charts.bitnami.com/bitnami helm install bitnami/wordpress --set global.imageRegistry=dockerhub.azk8s.cn # Install nginx-ingress helm repo add stable https://mirror.azure.cn/kubernetes/charts/ helm install stable/nginx-ingress --set defaultBackend.image.repository=gcr.azk8s.cn/google_containers/defaultbackendNote: All kubernetes related binaries on github could be found under https://mirror.azk8s.cn/kubernetes, e.g. helm, charts, etc.
5. Cluster autoscaler
Note: AKS integrated Cluster-autoscaler is not availalbe on Azure China now since it's still in Preview on Global Azure, instead following autoscaler is supported on Azure China now, it supports both VMAS and VMSS: Follow detailed steps in Cluster Autoscaler on Azure and in
Deploymentconfig ofaks-cluster-autoscaler.yaml:use
gcr.azk8s.cn/google-containers/cluster-autoscaler:versioninstead ofgcr.io/google-containers/cluster-autoscaler:versionadd following environment variable:
- name: ARM_CLOUD value: AzureChinaCloudHere is the complete
Deploymentconfig example.
Hands on
Known issues
- RBAC related issues(RABC is enabled on AKS cluster): https://github.com/andyzhangx/demo/blob/master/issues/rbac-issues.md
Tips
For production usage:
- agent VM size should have at least 8 CPU cores(e.g. D4_v2) since k8s components would also occupy CPU, memory resources on the node, details about AKS resource reservation.
- it's better set a bigger os disk size on agent VM in AKS cluster creation, e.g. set
--node-osdisk-size 128, original 30GB os disk size is not enough since all images are stored on os disk.
Links
[转帖]k8s国内镜像的更多相关文章
- google gcr.io、k8s.gcr.io 国内镜像
1.首先添加docker官方的国内镜像 sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ...
- K8S学习笔记之将Google的gcr.io、k8s.gcr.io 换为国内镜像
0x00 添加docker官方的国内镜像 sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ...
- [K8S]kubeadm国内镜像安装方式
使用国内镜像站 sudo apt-get update && sudo apt-get install -y apt-transport-https curl sudo curl -s ...
- docker学习(2) mac中docker-machine使用vmware fusion以及配置国内镜像加速
一.前言 先回顾下上一节创建docker-machine的过程,默认情况下docker toolbox中的docker-machine使用virtual box创建虚拟机,KI首次启动时创建虚拟机的过 ...
- 同步、更新、下载Android Source & SDK from 国内镜像站(转载)
同步.更新.下载Android Source & SDK from 国内镜像站 转自: 同步.更新.下载Android Source & SDK from 国内镜像站 Download ...
- Docker - Docker国内镜像的配置及使用
Docker国内镜像 DaoCloud - Docker加速器 阿里云 - 开发者平台 微镜像 - 希云cSphere 镜像广场 - 时速云 灵雀云 网易蜂巢 阿里云的Docker加速器 阿里云 - ...
- 使用国内镜像加速下载Android SDK
本文转自:http://blog.kuoruan.com/24.html.感谢原作者. 什么是Android SDK SDK:(software development kit)软件开发工具包.被软件 ...
- 腾讯bugly团队提供的android国内镜像
腾讯bugly团队提供的国内镜像 如果使用Android SDK Manager下载比较慢或者打不开,可以使用国内镜像 使用说明 http://android-mirror.bugly.qq.co ...
- eclipse使用国内镜像站点安装插件
把eclipse 4.x的界面改为经典样式 打开eclipse,菜单栏>windows>preference>general>appearance>theme>cl ...
随机推荐
- Luogu P1951 收费站_NOI导刊2009提高(2) 二分 最短路
思路:二分+最短路 提交:1次 题解: 二分最后的答案. $ck()$: 对于每次的答案$md$跑$s,t$的最短路,但是不让$c[u]>md$的点去松弛别的边,即保证最短路不经过这个点.最后$ ...
- no suitable method found to override
no suitable method found to override http://bbs.csdn.net/topics/200001058
- 图论小专题B
2 树 2.1 树的定义 一个只有\(N-1\)条边,且任意两个点连通的图叫做树.通过这样定义的树往往是一棵无根树,而我们通常会任意选定一个根节点使其变成有根树.有根树可以定义"父亲和儿子& ...
- Django从Models 10分钟建立一套RestfulApi
目录 Django从Models 10分钟建立一套RestfulApi Django从Models 10分钟定制一个Admin后台 简介 Django是一套完善而强大的web开发框架, 结合Djang ...
- Vue小实例
最近刚学习Vue的官方文档,了解了指令.模板.组件.数据双向绑定等有关Vue的知识点.因此估摸着做点实例出来练练手. 下面介绍一个简单的例子,模拟购物车自动统计金额,效果图如下: 代码如下: < ...
- Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee Linux上tomcat无法正常启动
上传了个tomcat7的压缩包上linux服务器,解压后,想直接启动,发现报错: Cannot find ./catalina.sh The file is absent or does not ha ...
- 21.栈的压入、弹出序列 Java
题目描述 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压 ...
- react-redux学习初步总结
1.index.js文件中需要引入 a.React(把jsx编译到js需要调用一个函数, 这个函数在React叫React.createElement. 解答地址:https://segmentfau ...
- 浅谈WebView在新窗口浏览网页(setSupportMultipleWindows()与onCreateWindow()关系)
一,写在前面 我们平常使用电脑浏览器浏览网页可能会有三种方式: 1.新窗口 2.当前窗口种的新选项卡 3.当前选项卡或者窗口 我们知道在电脑系统中同一时间可以开启多个相同的进程,就像你可以同时登陆2个 ...
- centos7修改默认启动模式(图形/命令行)
centos7以后是这样的,7以前就是别的版本了 1.systemctl get-default命令获取当前模式 2.systemctl set-default graphical.target 修改 ...