Kubernetes repository Fail - kubernetes

When I try To deploy Kubernetes cluster on centos 7 server ,i got below error so i try to deploy a different server same error happen ,so kindly help me to fix this issue

Adding Kubernetes repo with the below command in RockyLinux 8 (Like CentOS 8) worked for me!
# adding google kubernetes repository for amd64 (x86_64) architecture
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
Run this command to check yum search kubeadm

Related

Signature could not be verified for kubernetes repo

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
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

microk8s install problem "cni plugin not initialized"

Upgraded to PC to ubuntu 20.04 and having problems re-installing microk8s (1.19 and 1.20 have the same issue on my PC).
starting fresh to demo problem
snap remove microk8s
Following instructions on Install MicroK8s
sudo snap install microk8s --classic --channel=1.19
result:
microk8s (1.19/stable) v1.19.5 from Canonical✓ installed
Step: Join the group
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
su - $USER
Step: Check the status
microk8s status --wait-ready
Result: Hangs forever
Figure out what is going on:
microk8s inspect
The tar files contain lots of
Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized
dial tcp 127.0.0.1:16443: connect: connection refused
Any suggestions would be appreciated.
I had the same issue on a new Ubuntu 20.04.1 Server install and following the same instructions... e.g.
sudo snap install microk8s --classic --channel=1.19
What worked for me was using the 1.18 channel
sudo snap remove microk8s
sudo snap install microk8s --classic --channel=1.18/stable
And then refreshing to 1.19 once microk8s 1.18 became ready...
sudo snap refresh microk8s --classic --channel=1.19/stable
Don't ask me why this worked but it did.
Check your /etc/ hosts file there should be these lines
127.0.0.1 localhost 127.0.1.1 name you servers
It's funny in microk8s 1.18 all works good)

Kops, autoscale policy did not configure the master node correctly?

I have running k8s cluster using kops. the autoscaling policy terminate the master machine and recreated a new one since then every time i try to run kubectl command it returns "The connection to the server refused, did you specify the right host or port". i tried to ssh to the master machine but the did not found any of k8s services so i think the autoscale policy did not configure the master node correctly. so what should i do in this situation ?
update: also i found this log in syslog file:
E: Package 'ebtables' has no installation candidate
Jun 25 12:03:33 ip-172-20-35-193 nodeup[7160]: I0625 12:03:33.389286 7160 executor.go:145] No progress made, sleeping before retrying 2 failed task(s)
the issue was the kops was unable to install ebtables and conntrack so i installed it manually by :
sudo apt-get -o Acquire::Check-Valid-Until=false update
sudo apt-get install -y ebtables --allow-unauthenticated
sudo apt-get install --yes conntrack
and everything is running fine now

How to install kubelet, kubeadm and kubectl RPMs on Centos7/RHEL7?

I am going through the Kubernetes installation docs (https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/) and I am at the point where I am suppose to install the kubelet, kubeadm and kubectl RPMs. I created this yum repo:
[root#stg-003 ~]# cat /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-$basearch
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
Then I execute this yum command:
[root#stg-003 ~]# yum install -y kubelet kubeadm kubectl –disableexcludes=kubernetes
Which gives this output:
Loaded plugins: fastestmirror, langpacks, merge-conf, priorities, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
13024 packages excluded due to repository priority protections
No package kubelet available.
No package kubeadm available.
No package kubectl available.
Error: Nothing to do
I went here https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/Packages and there are no packages!
So how do I install kubelet, kubeadm and kubectl RPMs?
If you check the file repo that's kubernetes.repo you are clearly excluding all the three packages. How will yum find it, if you are to exclude those?
However there's also a failure in the above command.
Yum treats unicode characters as part of package names.
Check for the -- double dash that you missed in above command.
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
There's an open PR for the same on there website.
https://github.com/kubernetes/website/issues/20915
Also the packages are never stored in open, they pick the data from XML files stored in the other folder.
Please try and remove the exclude file from repo file.
A wide list of all repos can be found here. It's the same repo that's in the kubernetes docs.
https://packages.cloud.google.com/yum/repos/

Local Kubernetes on CentOS

I am trying to install Kubernetes locally on my CentOS. I am following this blog http://containertutorials.com/get_started_kubernetes/index.html, with appropriate changes to match CentOS and latest Kubernetes version.
./kube-up.sh script runs and exists with no errors and I don't see the server started on port 8080. Is there a way to know what was the error and if there is any other procedure to follow on CentOS 6.3
The easiest way to install the kubernetes cluster is using kubeadm. The initial post which details the steps of setup is here. And the detailed documentation for the kubeadm can be found here. With this you will get the latest released kubernetes.
If you really want to use the script to bring up the cluster, I did following:
Install the required packages
yum install -y git docker etcd
Start docker process
systemctl enable --now docker
Install golang
Latest go version because default centos golang is old and for kubernetes to compile we need at least go1.7
curl -O https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
Setup GOPATH
export GOPATH=~/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
Download k8s source and other golang dependencies
Note: this might take sometime depending on your internet speed
go get -d k8s.io/kubernetes
go get -u github.com/cloudflare/cfssl/cmd/...
Start cluster
cd $GOPATH/src/k8s.io/kubernetes
./hack/local-up-cluster.sh
In new terminal
alias kubectl=$GOPATH/src/k8s.io/kubernetes/cluster/kubectl.sh
kubectl get nodes