gpg: no valid OpenPGP data found a solution.
To be done. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
In this card to help
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
Because they can not access Google, it will be stuck in the curl this step. Then the solution is of course FQ.
I'm here to install on a server abroad have SS, SS server if there is no direct use ssh tunnel should be possible. Ss, then there is a local need to use ss local. It is recommended to use docker run ss, so exhausted that is deleted, it is convenient.
I use the mirror is: https: //hub.docker.com/r/mritd/shadowsocks/
When you are ready foreign server, the server is installed in the domestic tsocks
1
|
apt install -y tsocks
|
Editor vi /etc/tsocks.conf
1
2
3
|
server = 127.0.0.1
server_type = 5
server_port = 1080
|
Ip is a local server
server_type 5 is meant socks5
server_port local proxy port, like ss_local on the line.
When you're ready ladder, start installing software
1
2
3
4
5
6
7
|
apt-get update && apt-get install -y apt-transport-https
tsocks curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
tsocks apt-get update
tsocks apt-get install -y kubelet kubeadm kubectl
|
One point to note here is that if the country with Ali cloud server, the source might use the network address, so that the implementation of the direct use of tsocks apt update will be out this error below
W: The repository ‘http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates Release’ does not have a Release file.
or
Err:9 http://mirrors.cloud.aliyuncs.com/ubuntu xenial Release
Connection failed
This time vi /etc/apt/source.list.d/source.aliyun.list
All http://mirrors.cloud.aliyuncs.com instead http://mirrors.aliyun.com will be able to use a proxy update, before a change can be backed up, and then run back to the network.
After installing the software, you will be stuck in kubeadm init, using tsocks kubeadm init does not solve the problem.
unable to get URL “https://dl.k8s.io/release/stable-1.9.txt”: Get https://storage.googleapis.com/kubernetes-release/release/stable-1.9.txt: dial tcp 172.217.160.112:443: i/o timeout
Here we specify kubernetes vuersion to skip this,
kubeadm -kubernetes init-version = 1.9.3
If you do not prepare in advance a mirror, usually stuck in here
[init] This might take a minute or longer if the control plane images have to be pulled.
Unfortunately, an error has occurred:Unfortunately, an error has occurred: timed out waiting for the condition
This error is likely caused by: – The kubelet is not running – The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled) – There is no internet connection, so the kubelet cannot pull the following control plane images: – gcr.io/google_containers/kube-apiserver-amd64:v1.9.3 – gcr.io/google_containers/kube-controller-manager-amd64:v1.9.3 – gcr.io/google_containers/kube-scheduler-amd64:v1.9.3
So we need to be ready ahead of the mirror. Way I'm using on that server abroad under the pull mirroring, then push to hub.docker.com, then from hub.docker.com pull to domestic server.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash
ARCH=amd64
version=v1.9.3
username=<username>
#https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file
images=(kube-apiserver-${ARCH}:${version} \
kube-controller-manager-${ARCH}:${version} \
kube-scheduler-${ARCH}:${version} \
kube-proxy-${ARCH}:${version} \
etcd-${ARCH}:3.1.11 \
pause-${ARCH}:3.0 \
k8s-dns-sidecar-${ARCH}:1.14.7 \
k8s-dns-kube-dns-${ARCH}:1.14.7 \
k8s-dns-dnsmasq-nanny-${ARCH}:1.14.7 \
)
docker login -u $username -p <password>
for image in ${images[@]}
do
docker pull k8s.gcr.io/${image}
docker tag k8s.gcr.io/${image} ${username}/${image}
docker push ${username}/${image}
docker rmi k8s.gcr.io/${image}
docker rmi ${username}/${image}
done
unset ARCH version images username
|
This script is written to run on servers abroad, which will be <username> and <password> hub.docker.com into your account password on the line.
In the country and then run the following script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/bin/bash
ARCH=amd64
version=v1.9.3
username=<username>
#https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file
images=(kube-apiserver-${ARCH}:${version} \
kube-controller-manager-${ARCH}:${version} \
kube-scheduler-${ARCH}:${version} \
kube-proxy-${ARCH}:${version} \
etcd-${ARCH}:3.1.11 \
pause-${ARCH}:3.0 \
k8s-dns-sidecar-${ARCH}:1.14.7 \
k8s-dns-kube-dns-${ARCH}:1.14.7 \
k8s-dns-dnsmasq-nanny-${ARCH}:1.14.7 \
)
for image in ${images[@]}
do
docker pull ${username}/${image}
#docker tag ${username}/${image} k8s.gcr.io/${image}
docker tag ${username}/${image} gcr.io/google_containers/${image}
docker rmi ${username}/${image}
done
unset ARCH version images username
|
In this way, the mirror needs to put kubernetes are ready. Then execute init would be no problem.
In addition there is a little trick in the init process, the other to open a terminal and run
journalctl -f -u kubelet.service
可以查看具体是什么愿意卡住了。