Score:0

Unable to initialize Kubernetes cluster upon sudo kubeadm init line command

bg flag

Trying to deploy Kubernetes on AWS EC2 instance. I'm seeing the following errors/warning when running sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=all

Errors:

[WARNING CRI]: container runtime is not running: output: time="2023-06-23T03:15:01Z" level=fatal msg="validate service connection: CRI v1 runtime API is not implemented for endpoint "unix:///var/run/containerd/containerd.sock": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService" , error: exit status 1

[kubelet-check] Initial timeout of 40s passed. [kubelet-check] It seems like the kubelet isn't running or healthy. [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused. [kubelet-check] It seems like the kubelet isn't running or healthy. [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused. [kubelet-check] It seems like the kubelet isn't running or healthy. [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused. [kubelet-check] It seems like the kubelet isn't running or healthy. [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused. [kubelet-check] It seems like the kubelet isn't running or healthy. [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.

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)

If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands: - 'systemctl status kubelet' - 'journalctl -xeu kubelet'

Additionally, a control plane component may have crashed or exited when started by the container runtime. To troubleshoot, list all containers using your preferred container runtimes CLI. Here is one example how you may list all running Kubernetes containers by using crictl: - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock ps -a | grep kube | grep -v pause' Once you have found the failing container, you can inspect its logs with: - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock logs CONTAINERID' error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster

I'm not sure where to begin with, Kubectl version.

    {
  "clientVersion": {
    "major": "1",
    "minor": "27",
    "gitVersion": "v1.27.3",
    "gitCommit": "25b4e43193bcda6c7328a6d147b1fb73a33f1598",
    "gitTreeState": "clean",
    "buildDate": "2023-06-14T09:53:42Z",
    "goVersion": "go1.20.5",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "kustomizeVersion": "v5.0.1"
}

Any suggestions?

Score:1
nl flag

Looks like an issue with the old containerd, execute the steps below with root privileges to solve it:

  1. Remove the old container by executing the command apt remove containerd

  2. Update repository data and install the new containerd by using the commands(apt update and apt install containerd.io):

  3. Remove the installed default config file: rm /etc/containerd/config.toml

  4. Restart containerd with the help of the command : systemctl restart containerd

Refer to mdevitis’s post kubeadm init error: CRI v1 runtime API is not implemented on Linux Foundation Forum.

Note : Specify the correct configuration for the endpoint unix:///var/run/containerd/containerd.sock and enable the plugin which is by default disabled (Docker will start up its own containerd instance rather than using the one bound to /run/containerd/containerd.sock).Go to /etc/containerd/config.toml change disabled_plugin to enabled_plugin.

Veera Nagireddy avatar
nl flag
If still issues persist, try by running the steps mentioned by me in this [SO](https://serverfault.com/questions/1118047), which may help to resolve your issue.
Score:0
cu flag

Check if your EC2 instance has sufficient system resources (CPU, memory) available for running Kubernetes components. Insufficient resources can cause issues with the kubelet and other components. Verify that your EC2 instance meets the recommended system requirements for Kubernetes. Examine the logs of the failing containers and components to gather more information about the specific errors. Use the command crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock logs CONTAINERID to retrieve container logs. Replace CONTAINERID with the actual ID of the failing container.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.