kairen / kubeadm-ansible

Build a Kubernetes cluster using kubeadm via Ansible.
Apache License 2.0
724 stars 379 forks source link

Trying to set up a kubernetes cluster on CentOS 7 but kubeadm init fails #93

Closed tdominguezm closed 4 months ago

tdominguezm commented 2 years ago

Hi.

So I've been trying to use this playbook to set up a kubernetes cluster and I'm not able to make it initialize. Everytime I arrive at the init step I get this error.

Do you have an idea of what could cause this? Thank you very much

Here I leave a paste of the error, all the previous steps went well I think.

fatal: [master]: FAILED! => {
    "changed": true,
    "cmd": "kubeadm init --service-cidr 10.96.0.0/12             --kubernetes-version v1.24.3             --pod-network-cidr 10.244.0.0/16             --token b0f7b8.8d1767876297d85c             --apiserver-advertise-address <master-ip>            --cri-socket=/var/run/containerd/containerd.sock                          \n",
    "delta": "0:00:00.307886",
    "end": "2022-07-27 15:06:55.139508",
    "invocation": {
        "module_args": {
            "_raw_params": "kubeadm init --service-cidr 10.96.0.0/12             --kubernetes-version v1.24.3             --pod-network-cidr 10.244.0.0/16             --token b0f7b8.8d1767876297d85c             --apiserver-advertise-address <master-ip>             --cri-socket=/var/run/containerd/containerd.sock                          \n",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2022-07-27 15:06:54.831622",
    "stderr": "W0727 15:06:54.870709   10495 initconfiguration.go:120] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme \"unix\" to the \"criSocket\" with value \"/var/run/containerd/containerd.sock\". Please update your configuration!\nerror execution phase preflight: [preflight] Some fatal errors occurred:\n\t[ERROR CRI]: container runtime is not running: output: time=\"2022-07-27T15:06:54+02:00\" level=fatal msg=\"unable to determine runtime API version: rpc error: code = Unavailable desc = connection error: desc = \\\"transport: Error while dialing dial unix /var/run/containerd/containerd.sock: connect: no such file or directory\\\"\"\n, error: exit status 1\n[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`\nTo see the stack trace of this error execute with --v=5 or higher",
    "stderr_lines": [
        "W0727 15:06:54.870709   10495 initconfiguration.go:120] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme \"unix\" to the \"criSocket\" with value \"/var/run/containerd/containerd.sock\". Please update your configuration!",
        "error execution phase preflight: [preflight] Some fatal errors occurred:",
        "\t[ERROR CRI]: container runtime is not running: output: time=\"2022-07-27T15:06:54+02:00\" level=fatal msg=\"unable to determine runtime API version: rpc error: code = Unavailable desc = connection error: desc = \\\"transport: Error while dialing dial unix /var/run/containerd/containerd.sock: connect: no such file or directory\\\"\"",
        ", 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"
    ],
    "stdout": "[init] Using Kubernetes version: v1.24.3\n[preflight] Running pre-flight checks",
    "stdout_lines": [
        "[init] Using Kubernetes version: v1.24.3",
        "[preflight] Running pre-flight checks"
    ]
}