标签:因此 ecif scale spec should back one tool memory
最近折腾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 gcr.azk8s.cn/google-containers |
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
已经使用超过一周,非常稳定。
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.
Since some well known container registries like docker.io
, gcr.io
are 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.61 dockerhub.azk8s.cn/library/nginx:1.15 |
gcr.io | gcr.azk8s.cn | gcr.azk8s.cn/<repo-name>/<image-name>:<version> |
gcr.azk8s.cn/google_containers/hyperkube-amd64:v1.13.5 |
quay.io | quay.azk8s.cn | quay.azk8s.cn/<repo-name>/<image-name>:<version> |
quay.azk8s.cn/deis/go-dev:v1.10.0 |
Note:
k8s.gcr.io
would redirect togcr.io/google-containers
, following image urls are identical:
k8s.gcr.io/pause-amd64:3.1
gcr.io/google_containers/pause-amd64:3.1
Container Registry Proxy Example
specify defaultBackend.image.repository
as gcr.azk8s.cn/google_containers/defaultbackend
in nginx-ingress chart since original k8s.gcr.io
does 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
az aks install-cli
command is used to download kubectl
binary, it works on Azure China from version 2.0.61
or later, another alternative is use following command to download kubectl
if 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/kubectl
run
sudo az aks install-cli
if hit following permission errorConnection error while attempting to download client ([Errno 13] Permission denied: ‘/usr/local/bin/kubectl‘
Follow detailed installation steps here.
# 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/defaultbackend
Note: All kubernetes related binaries on github could be found under https://mirror.azk8s.cn/kubernetes, e.g. helm, charts, etc.
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
Deployment
config ofaks-cluster-autoscaler.yaml
:
use gcr.azk8s.cn/google-containers/cluster-autoscaler:version
instead of gcr.io/google-containers/cluster-autoscaler:version
add following environment variable:
- name: ARM_CLOUD
value: AzureChinaCloud
Here is the complete Deployment
config example.
For production usage:
--node-osdisk-size 128
, original 30GB os disk size is not enough since all images are stored on os disk.标签:因此 ecif scale spec should back one tool memory
原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/11353408.html