Kubernetes in lxc is not starting
ukreddy-erwin opened this issue · 0 comments
Describe the bug
Kubernetes not connecting after restart, how to fix that?
How To Reproduce
Install lxc containers in ubuntu 20 machine, and the lxc image also ubuntu 20.
Restart the host machine(VM where lxc running)
Expected behavior
Should work correctly but not starting
Environment (please complete the following information):
osboxes@osboxes:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy
Additional context
Add any other context about the problem here.
I am running kubernetes on lxc containers for testing the services. I deployed it using these steps.
It worked fine but after restart of the ubuntu machine(host of the lxc containers). I am getting this error in ubuntu machine and also on the kubernetes master.
root@kmaster:~# kubectl cluster-info
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server 10.199.242.17:6443 was refused - did you specify the right host or port?
Any suggestion on how to fix that? I tried multiple steps provided in many posts like restarting the kubelet, copying the config file again. Restarting the containerd service. running swap off command. Someone suggested to check docker service but the kubernetes 1.21 is using containerd.
journalctl -xeu kubelet
--
-- The job identifier is 4815 and the job result is done.
Jul 14 13:04:52 kmaster systemd[1]: Started kubelet: The Kubernetes Node Agent.
-- Subject: A start job for unit kubelet.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit kubelet.service has finished successfully.
--
-- The job identifier is 4815.
Jul 14 13:04:52 kmaster kubelet[1903]: Flag --fail-swap-on has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/>
Jul 14 13:04:52 kmaster kubelet[1903]: I0714 13:04:52.555232 1903 server.go:197] "Warning: For remote container runtime, --pod-infra-container-image is ignored in kubelet, which should be set in that remot>
Jul 14 13:04:52 kmaster kubelet[1903]: Flag --fail-swap-on has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/>
Jul 14 13:04:52 kmaster kubelet[1903]: I0714 13:04:52.565056 1903 server.go:440] "Kubelet version" kubeletVersion="v1.21.0"
Jul 14 13:04:52 kmaster kubelet[1903]: I0714 13:04:52.565288 1903 server.go:851] "Client rotation is on, will bootstrap in background"
Jul 14 13:04:52 kmaster kubelet[1903]: I0714 13:04:52.566362 1903 certificate_store.go:130] Loading cert/key pair from "/var/lib/kubelet/pki/kubelet-client-current.pem".
Jul 14 13:04:52 kmaster kubelet[1903]: I0714 13:04:52.567322 1903 dynamic_cafile_content.go:167] Starting client-ca-bundle::/etc/kubernetes/pki/ca.crt
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.574623 1903 server.go:660] "--cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /"
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575134 1903 container_manager_linux.go:278] "Container manager verified user specified cgroup-root exists" cgroupRoot=[]
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575272 1903 container_manager_linux.go:283] "Creating Container Manager object based on Node Config" nodeConfig={RuntimeCgroupsName: SystemCgroupsName:>
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575392 1903 topology_manager.go:120] "Creating topology manager with policy per scope" topologyPolicyName="none" topologyScopeName="container"
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575459 1903 container_manager_linux.go:314] "Initializing Topology Manager" policy="none" scope="container"
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575523 1903 container_manager_linux.go:319] "Creating device plugin manager" devicePluginEnabled=true
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575671 1903 util_unix.go:103] "Using this format as endpoint is deprecated, please consider using full url format." deprecatedFormat="/run/containerd/c>
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575764 1903 remote_runtime.go:62] parsed scheme: ""
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575822 1903 remote_runtime.go:62] scheme "" not registered, fallback to default scheme
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575916 1903 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{/run/containerd/containerd.sock <nil> 0 <nil>}] <nil> <nil>}
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.575979 1903 clientconn.go:948] ClientConn switching balancer to "pick_first"
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.576062 1903 util_unix.go:103] "Using this format as endpoint is deprecated, please consider using full url format." deprecatedFormat="/run/containerd/c>
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.576138 1903 remote_image.go:50] parsed scheme: ""
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.576199 1903 remote_image.go:50] scheme "" not registered, fallback to default scheme
Jul 14 13:04:57 kmaster kubelet[1903]: I0714 13:04:57.576259 1903 passthrough.go:4