Signature could not be verified for kubernetes repo

Viewed 7651

Tring to install kubernetes cluster with kubeadm, and faced issue with installing kube packages. I continue getting error:

https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes

Repo config:

    [kubernetes]
    name=Kubernetes
    baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
    exclude=kubelet kubeadm kubectl

Im using centos 7 distro

Linux kube-master 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 18:28:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
1 Answers

You can see very similar issue here.

As a quick workaround, you can simply disable GPG checking by setting repo_gpgcheck=0 in /etc/yum.repos.d/kubernetes.repo but this is obviously not recommended from security perspective.

Additionally you may try the following:

  • re-import the keys as suggested here

    rpm --import https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
    
  • install the following version of GNUPG as suggested here

    sudo yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/gnupg2-2.0.22-5.el7_5.x86_64.rpm
    
Related