Standard K8s Installation failed - Centos7

Can anybody help me out please.
I started with the simple installation of the master node on Centos7 and I am facing issue to initiate kubernetes.
Any recommendation ?
thank you
Petr

Error

[root@master-node ~]# sudo kubeadm init
[init] Using Kubernetes version: v1.24.3
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR FileAvailable–etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
[ERROR FileAvailable–etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
[ERROR FileAvailable–etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
[ERROR FileAvailable–etc-kubernetes-manifests-etcd.yaml]: /etc/kubernetes/manifests/etcd.yaml already exists
[ERROR CRI]: container runtime is not running: output: E0719 14:22:41.951572 12007 remote_runtime.go:925] “Status from runtime service failed” err=“rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”
time=“2022-07-19T14:22:41+01:00” level=fatal msg=“getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher

[root@master-node ~]# kubectl config view
apiVersion: v1
clusters:

  • cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://192.168.72.150:6443
    name: kubernetes
    contexts:
  • context:
    cluster: kubernetes
    user: kubernetes-admin
    name: kubernetes-admin@kubernetes
    current-context: kubernetes-admin@kubernetes
    kind: Config
    preferences: {}
    users:
  • name: kubernetes-admin
    user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
    [root@master-node ~]#

Cluster information:

Kubernetes version: v1.24.3
Cloud being used: (put bare-metal if not on a public cloud)
Installation method: native centos
Host OS: Centos 7 CentOS Linux release 7.4.1708 (Core)
CNI and version:
CRI and version:

It doesn’t look like you have a Container Runtime installed or it hasn’t been configured to work with Kubernetes.

I have followed all steps in this guide below

then I diasbled all FW and the problem persist to connect to localhost:8080

[root@master-node ~]# kubectl get nodes -o wide
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[root@master-node ~]#

Those guides are terribly out of date. Only the upstream ones on kubernetes.io are kept up to date with every release.

The problem is still what I said it was in the earlier reply, you need a container runtime.

Thank you for the help. To me it is not clear how to achieve to be CR runtime on the main node running.
I did all steps from th guide Install and Set Up kubectl on Linux | Kubernetes but still I am facing this error

[root@master-node ~]# kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.24.3
Kustomize Version: v4.5.4
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[root@master-node ~]#

kubectl is the cli client tool you use to access kubernetes, not part of the server install itself. IMO I would start with the intro docs on kubernetes.io to learn a bit about how the concepts and how the different components integrate with each other before moving forward with an install. There are multiple dependencies and configurations that are not directly handed by k8s itself and it won’t install or function without them.

In the links below, you will see the definition of CRI and available options to install.

I really appreciate your help. I read all articles and still I was not able to make kubeadm running.
kubeadm init always fails

[init] Using Kubernetes version: v1.24.3
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: E0726 08:03:37.552679 30902 remote_runtime.go:925] “Status from runtime service failed” err=“rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”
time=“2022-07-26T08:03:37+01:00” level=fatal msg=“getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher

So I found the solution

1) deploy GitHub - Mirantis/cri-dockerd
2) remove prevous created yaml files
3) Navigate kubeadm to a cri

kubeadm init --apiserver-advertise-address=192.168.72.150 --pod-network-cidr 192.168.0.0/16 --cri-socket=unix:///var/run/cri-dockerd.sock