cloud-config не может установить хранилище Debian в Kubernetes
У меня есть базовый скрипт пользовательских данных в облачной конфигурации, который просто устанавливает репозитории Kubernetes на raspbian (hypriot), однако apt-get update
кажется, сбой из-за проблем с сертификатом.
Меня поразило то, что после завершения cloud-init я запустил ssh в Raspberry Pi, и он смог apt-get update
хорошо. Ниже приведены журналы и команды, которые я пробовал.
Мои данные пользователя:
apt_preserve_sources_list: true
apt_update: true
apt_upgrade: true
package_upgrade: true
packages:
# todo apt-mark hold docker-ce
# todo apt-mark hold kube*
# todo upgrade kubernetes
# - [dirmngr]
- [nfs-common]
- [apt-transport-https]
- [ca-certificates]
# - [nfs-kernel-server]
- [kubeadm, 1.10.2-00]
- [kubelet, 1.10.2-00]
- [kubectl, 1.10.2-00]
- [docker-ce, "17.03.2~ce-0~ubuntu-xenial"]
apt:
sources_list: |
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
conf: |
APT {
Get {
Assume-Yes "true";
Fix-Broken "true";
};
};
sources:
docker.list:
source: "deb [arch=armhf] https://download.docker.com/linux/ubuntu xenial stable"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
<clipped for brevity>
-----END PGP PUBLIC KEY BLOCK-----
kubernetes.list:
source: "deb http://apt.kubernetes.io/ kubernetes-xenial main"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
<clipped for brevity>
-----END PGP PUBLIC KEY BLOCK-----
Ошибки:
Get:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
<clipped for brevity>
Get:8 http://archive.raspberrypi.org/debian stretch/main armhf Packages [159 kB]
Ign:7 https://packages.cloud.google.com/apt kubernetes-xenial Release
<clipped for brevity>
Ign:10 https://packages.cloud.google.com/apt kubernetes-xenial/main all Packages
Get:18 https://download.docker.com/linux/ubuntu xenial/stable armhf Packages [3,657 B]
Get:9 https://packagecloud.io/Hypriot/rpi/debian stretch InRelease [23.2 kB]
Ign:12 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages
Ign:15 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en_US
Get:19 https://packagecloud.io/Hypriot/rpi/debian stretch/main armhf Packages [2,729 B]
Ign:16 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en
Ign:10 https://packages.cloud.google.com/apt kubernetes-xenial/main all Packages
Ign:12 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages
Ign:15 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en_US
Ign:16 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en
Ign:10 https://packages.cloud.google.com/apt kubernetes-xenial/main all Packages
Ign:12 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages
Ign:15 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en_US
Ign:16 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en
Ign:10 https://packages.cloud.google.com/apt kubernetes-xenial/main all Packages
Ign:12 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages
Ign:15 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en_US
Ign:16 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en
Ign:10 https://packages.cloud.google.com/apt kubernetes-xenial/main all Packages
Ign:12 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages
Ign:15 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en_US
Ign:16 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en
Ign:10 https://packages.cloud.google.com/apt kubernetes-xenial/main all Packages
Err:12 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Ign:15 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en_US
Ign:16 https://packages.cloud.google.com/apt kubernetes-xenial/main Translation-en
Fetched 12.1 MB in 19s (607 kB/s)
Reading package lists...
W: The repository 'http://apt.kubernetes.io kubernetes-xenial Release' does not have a Release file.
E: Failed to fetch https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-armhf/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
E: Some index files failed to download. They have been ignored, or old ones used instead.
Cloud-init v. 0.7.9 running 'modules:config' at Sat, 28 Apr 2018 18:57:29 +0000. Up 41.04 seconds.
И ниже меня sshing в пи и работает apt-get update
вручную:
$ ssh -o ConnectTimeout=2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa_pi hosh@192.168.100.199
Warning: Permanently added '192.168.100.199' (ECDSA) to the list of known hosts.
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
HypriotOS (Debian GNU/Linux 9)
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
$ sudo apt-get install kubeadm
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package kubeadm
$ sudo apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Hit:4 https://download.docker.com/linux/raspbian stretch InRelease
Hit:5 https://download.docker.com/linux/ubuntu xenial InRelease
Get:3 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8993 B]
Hit:6 https://packagecloud.io/Hypriot/rpi/debian stretch InRelease
Get:7 https://packages.cloud.google.com/apt kubernetes-xenial/main armhf Packages [15.5 kB]
Fetched 24.5 kB in 4s (5671 B/s)
Reading package lists... Done
$ sudo apt-get install kubectl kubeadm kubelet
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ebtables ethtool kubectl kubelet kubernetes-cni socat
The following NEW packages will be installed:
ebtables ethtool kubeadm kubectl kubelet kubernetes-cni socat
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 50.3 MB/50.8 MB of archives.
After this operation, 359 MB of additional disk space will be used.