Я пытаюсь запустить кластер Kuberntes в AWS china. Это контекст:
По поводу пункта 4 вот проблемы, которые у меня есть в Amazon Linux. 4.14.138-114.102.amzn2.x86_64
:
[root@k8s-master ~]# cat /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
[root@k8s-master ~]# yum install -y kubelet kubeadm kubectl
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 2.4 kB 00:00:00
amzn2extra-docker | 1.3 kB 00:00:00
docker-ce-stable | 3.0 kB 00:00:00
kubernetes/signature | 454 B 00:00:00
Retrieving key from https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
Importing GPG key 0xA7317B0F:
Userid : "Google Cloud Packages Automatic Signing Key <gc-team@google.com>"
Fingerprint: d0bc 747f d8ca f711 7500 d6fa 3746 c208 a731 7b0f
From : https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
Retrieving key from https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
kubernetes/signature | 1.4 kB 00:00:00 !!!
https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes
Trying other mirror.
One of the configured repositories failed (Kubernetes),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=kubernetes ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable kubernetes
or
subscription-manager repos --disable=kubernetes
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=kubernetes.skip_if_unavailable=true
failure: repodata/repomd.xml from kubernetes: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes
[root@k8s-master ~]#
Затем попробовал с centos 75:
[root@k8s-master ~]# cat <<EOF > /etc/yum.repos.d/kubernetes.repo
> [kubernetes]
> name=Kubernetes
> baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
> enabled=1
> gpgcheck=1
> repo_gpgcheck=1
> gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
> EOF
[root@k8s-master ~]# getenforce
Permissive
[root@k8s-master ~]# yum install -y kubelet kubeadm kubectl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.neusoft.edu.cn
* updates: mirror.jdcloud.com
kubernetes/signature | 454 B 00:00:00
kubernetes/signature | 1.4 kB 00:00:00 !!!
Resolving Dependencies
--> Running transaction check
---> Package kubeadm.x86_64 0:1.16.1-0 will be installed
--> Processing Dependency: kubernetes-cni >= 0.7.5 for package: kubeadm-1.16.1-0.x86_64
---> Package kubectl.x86_64 0:1.16.1-0 will be installed
---> Package kubelet.x86_64 0:1.16.1-0 will be installed
--> Running transaction check
---> Package kubernetes-cni.x86_64 0:0.7.5-0 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================================
Installing:
kubeadm x86_64 1.16.1-0 kubernetes 9.5 M
kubectl x86_64 1.16.1-0 kubernetes 10 M
kubelet x86_64 1.16.1-0 kubernetes 22 M
Installing for dependencies:
kubernetes-cni x86_64 0.7.5-0 kubernetes 10 M
Transaction Summary
==========================================================================================================================================================================================================
Install 3 Packages (+1 Dependent package)
Total download size: 52 M
Installed size: 239 M
Downloading packages:
(1/4): 9c569e36042bf917f770648feb2c515c1ef90cee2de2d599652166593373150c-kubectl-1.16.1-0.x86_64.rpm | 10 MB 00:00:01
(2/4): a137f796adacb1e9e52b1a46faaf5406bfca203314708067c7d0f18076d5f949-kubeadm-1.16.1-0.x86_64.rpm | 9.5 MB 00:00:01
(3/4): 548a0dcd865c16a50980420ddfa5fbccb8b59621179798e6dc905c9bf8af3b34-kubernetes-cni-0.7.5-0.x86_64.rpm | 10 MB 00:00:00
(4/4): 5c2055ea4f698f2cfe8ee777e3fdb27be95161175cea21cd914bd7d28c299e09-kubelet-1.16.1-0.x86_64.rpm | 22 MB 00:00:02
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 15 MB/s | 52 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : kubelet-1.16.1-0.x86_64 1/4
Installing : kubernetes-cni-0.7.5-0.x86_64 2/4
Installing : kubectl-1.16.1-0.x86_64 3/4
Installing : kubeadm-1.16.1-0.x86_64 4/4
Verifying : kubectl-1.16.1-0.x86_64 1/4
Verifying : kubernetes-cni-0.7.5-0.x86_64 2/4
Verifying : kubeadm-1.16.1-0.x86_64 3/4
Verifying : kubelet-1.16.1-0.x86_64 4/4
Installed:
kubeadm.x86_64 0:1.16.1-0 kubectl.x86_64 0:1.16.1-0 kubelet.x86_64 0:1.16.1-0
Dependency Installed:
kubernetes-cni.x86_64 0:0.7.5-0
Complete!
[root@k8s-master ~]# KUBERNETES_RELEASE_VERSION="$(curl -sSL https://dl.k8s.io/release/stable.txt)"
Эта последняя рекомендация не работает, потому что нет доступа к веб-сайту Google или Kubernetes. пошел по этому пути, просто получив версию, которую я хочу установить вручную.
[root@k8s-master ~]# # KUBERNETES_RELEASE_VERSION="$(curl -sSL https://dl.k8s.io/release/stable.txt)"
[root@k8s-master ~]# KUBERNETES_RELEASE_VERSION="v1.16.1"
[root@k8s-master ~]# kubeadm config images list --kubernetes-version=${KUBERNETES_RELEASE_VERSION}
k8s.gcr.io/kube-apiserver:v1.16.1
k8s.gcr.io/kube-controller-manager:v1.16.1
k8s.gcr.io/kube-scheduler:v1.16.1
k8s.gcr.io/kube-proxy:v1.16.1
k8s.gcr.io/pause:3.1
k8s.gcr.io/etcd:3.3.15-0
k8s.gcr.io/coredns:1.6.2
[root@k8s-master ~]# kubeadm config images pull --config init.yml
unable to read config from "init.yml" : open init.yml: no such file or directory
To see the stack trace of this error execute with --v=5 or higher
[root@k8s-master ~]#
Тогда здесь ломается. Не могли бы вы помочь?
Редактировать: В итоге я установил в AWS за пределами Китая, а затем сделал образ диска и медленно скопировал в Китай. Проверять, выписываться эта почта
Я все же предпочел бы иметь какой-нибудь метод для использования внутри Китая, который упростил бы работу и сократил время запуска. Если у вас есть идеи, поделитесь, пожалуйста!