Closed vincentmli closed 5 years ago
I have the same issue. Funny enough the k3s server which also includes the agent works just fine.
Are you sure that it is caused by systemd?
I am not sure if it is directly related to systemd, maybe I can add debug level to kubelet and hopefully that could give more clue
I attached the k3s agent node kubelet with log level to 4, it appears kubelet fail to create sandbox for the nignx pod, there are some errors factory.go Factory "systemd", not sure if it is related here is the nginx pod:
root@Office-R220-vli:/home/vincent# kubectl get po -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES nginx-kzbq6 0/1 ContainerCreating 0 24mhome-ubuntu nginx-spws4 1/1 Running 0 24m 10.42.0.23 office-r220-vli
search "nginx-kzbq6" in the debug log attached
systemd service to start k3s agent node
[Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io After=network-online.target [Service] Type=notify ExecStart=/usr/local/bin/k3s agent --kubelet-arg "v=4" -s https://192.168.1.30:6443 -t "K102fcec9c1bd7ecdeb16a471571d2fb3abe6d0a3d49cb69b029d0264ea78a71e3c::node:099ebc33d9626443a5290c3cc146602a" KillMode=process Delegate=yes LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity TasksMax=infinity [Install] WantedBy=multi-user.target
@ibuildthecloud is this issue fixed in 0.6.0-rc2?
version 0.6.0-rc3 suffer from the same problem:
May 29 21:45:08 cubi002 k3s[10211]: time="2019-05-29T21:45:08.124306382Z" level=debug msg="Wrote ping"
May 29 21:45:08 cubi002 k3s[10211]: time="2019-05-29T21:45:08.505468246Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
May 29 21:45:08 cubi002 k3s[10211]: time="2019-05-29T21:45:08.505845147Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
May 29 21:45:13 cubi002 k3s[10211]: time="2019-05-29T21:45:13.124379839Z" level=debug msg="Wrote ping"
May 29 21:45:13 cubi002 k3s[10211]: time="2019-05-29T21:45:13.268668978Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
May 29 21:45:13 cubi002 k3s[10211]: time="2019-05-29T21:45:13.269054802Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
May 29 21:45:18 cubi002 k3s[10211]: time="2019-05-29T21:45:18.124380620Z" level=debug msg="Wrote ping"
May 29 21:45:18 cubi002 k3s[10211]: E0529 21:45:18.237592 10211 remote_runtime.go:186] ListPodSandbox with filter nil from runtime service failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
May 29 21:45:18 cubi002 k3s[10211]: E0529 21:45:18.238211 10211 kuberuntime_sandbox.go:210] ListPodSandbox failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
May 29 21:45:18 cubi002 k3s[10211]: E0529 21:45:18.238270 10211 kubelet.go:1222] Container garbage collection failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
May 29 21:45:18 cubi002 k3s[10211]: time="2019-05-29T21:45:18.515309026Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
May 29 21:45:18 cubi002 k3s[10211]: time="2019-05-29T21:45:18.515686364Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
I am not sure I can reproduce the issue, steps:
curl -sfL https://get.k3s.io | sh -
curl -sfL https://get.k3s.io | K3S_URL=https://x.x.x.x:6443 K3S_TOKEN=xxxxx sh -
Results:
I can see all pods in a running state normally, @vincentmli can you describe the exact steps for reproducing the problem
Are you also running Ubuntu 1804? Maybe it is caused by Ubuntu
I tried following k3s-agent services on centos 7, with v0.5.0, it appears to be working @galal-hussein maybe this is ubuntu 1804 thing?
[root@k3s-agent ~]# cat /etc/systemd/system/k3s-agent.service [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io After=network-online.target [Service] Type=exec Environment="HTTP_PROXY=http://10.3.254.254:3128/" Environment="HTTPS_PROXY=http://10.3.254.254:3128/" EnvironmentFile=/etc/systemd/system/k3s-agent.service.env ExecStartPre=-/sbin/modprobe br_netfilter ExecStartPre=-/sbin/modprobe overlay ExecStart=/usr/local/bin/k3s agent --server https://10.3.72.189:6443 --token-file /usr/local/bin/node-token --flannel-iface ens224 --node-ip 10.169.72.98 KillMode=process Delegate=yes LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity TasksMax=infinity TimeoutStartSec=0 Restart=always [Install] WantedBy=multi-user.target
[root@rancher-k3s home]# kubectl get po -o wide --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES default nginx-7rlzc 1/1 Running 0 3m51s 10.42.0.205 rancher-k3sdefault nginx-pjh5g 1/1 Running 0 3m51s 10.42.4.4 k3s-agent kube-system cc-cluster-574dc9565c-kmkhk 1/1 Running 0 24s 10.169.72.98 k3s-agent kube-system coredns-695688789-sjt4j 1/1 Running 0 15d 10.42.0.196 rancher-k3s
k3s 0.6.1 worker still does not work with ubuntu 18.04:
-- Logs begin at Sun 2019-05-05 10:48:06 UTC, end at Thu 2019-06-20 19:17:33 UTC. --
Jun 20 19:14:53 cubi002 k3s[9214]: time="2019-06-20T19:14:53.539078347Z" level=debug msg="Wrote ping"
Jun 20 19:14:58 cubi002 k3s[9214]: time="2019-06-20T19:14:58.538764045Z" level=debug msg="Wrote ping"
Jun 20 19:14:58 cubi002 k3s[9214]: time="2019-06-20T19:14:58.804203207Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:14:58 cubi002 k3s[9214]: time="2019-06-20T19:14:58.804569265Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:03 cubi002 packetbeat[2053]: 2019-06-20T19:15:03.371Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks
Jun 20 19:15:03 cubi002 k3s[9214]: time="2019-06-20T19:15:03.538706957Z" level=debug msg="Wrote ping"
Jun 20 19:15:08 cubi002 k3s[9214]: time="2019-06-20T19:15:08.539240217Z" level=debug msg="Wrote ping"
Jun 20 19:15:08 cubi002 k3s[9214]: time="2019-06-20T19:15:08.815561269Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:08 cubi002 k3s[9214]: time="2019-06-20T19:15:08.815943936Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:13 cubi002 k3s[9214]: time="2019-06-20T19:15:13.539210588Z" level=debug msg="Wrote ping"
Jun 20 19:15:18 cubi002 k3s[9214]: time="2019-06-20T19:15:18.538836997Z" level=debug msg="Wrote ping"
Jun 20 19:15:18 cubi002 k3s[9214]: time="2019-06-20T19:15:18.842455930Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:18 cubi002 k3s[9214]: time="2019-06-20T19:15:18.842834007Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:23 cubi002 k3s[9214]: time="2019-06-20T19:15:23.539298797Z" level=debug msg="Wrote ping"
Jun 20 19:15:28 cubi002 k3s[9214]: time="2019-06-20T19:15:28.539269539Z" level=debug msg="Wrote ping"
Jun 20 19:15:28 cubi002 k3s[9214]: time="2019-06-20T19:15:28.852027842Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:28 cubi002 k3s[9214]: time="2019-06-20T19:15:28.852409952Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:33 cubi002 packetbeat[2053]: 2019-06-20T19:15:33.371Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks
Jun 20 19:15:33 cubi002 k3s[9214]: time="2019-06-20T19:15:33.539227821Z" level=debug msg="Wrote ping"
Jun 20 19:15:38 cubi002 k3s[9214]: time="2019-06-20T19:15:38.539236051Z" level=debug msg="Wrote ping"
Jun 20 19:15:38 cubi002 k3s[9214]: time="2019-06-20T19:15:38.861383583Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:38 cubi002 k3s[9214]: time="2019-06-20T19:15:38.861630787Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:43 cubi002 k3s[9214]: time="2019-06-20T19:15:43.278527065Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:43 cubi002 k3s[9214]: time="2019-06-20T19:15:43.278666501Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:43 cubi002 k3s[9214]: time="2019-06-20T19:15:43.539058389Z" level=debug msg="Wrote ping"
Jun 20 19:15:48 cubi002 k3s[9214]: time="2019-06-20T19:15:48.539264128Z" level=debug msg="Wrote ping"
Jun 20 19:15:48 cubi002 k3s[9214]: time="2019-06-20T19:15:48.869908084Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:48 cubi002 k3s[9214]: time="2019-06-20T19:15:48.870236424Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:53 cubi002 k3s[9214]: time="2019-06-20T19:15:53.539193016Z" level=debug msg="Wrote ping"
Jun 20 19:15:58 cubi002 k3s[9214]: time="2019-06-20T19:15:58.539327531Z" level=debug msg="Wrote ping"
Jun 20 19:15:58 cubi002 k3s[9214]: E0620 19:15:58.607342 9214 remote_runtime.go:132] StopPodSandbox "4991a8540ecb38dd22d73c4772b0739d476985a795447000bfbefd80f5fe904d" from runtime service failed: rpc error: code = DeadlineEx
Jun 20 19:15:58 cubi002 k3s[9214]: E0620 19:15:58.607436 9214 kuberuntime_gc.go:169] Failed to stop sandbox "4991a8540ecb38dd22d73c4772b0739d476985a795447000bfbefd80f5fe904d" before removing: rpc error: code = DeadlineExceed
Jun 20 19:15:58 cubi002 k3s[9214]: time="2019-06-20T19:15:58.608288404Z" level=error msg="StopPodSandbox for \"4991a8540ecb38dd22d73c4772b0739d476985a795447000bfbefd80f5fe904d\" failed" error="failed to stop sandbox container \
Jun 20 19:15:58 cubi002 k3s[9214]: time="2019-06-20T19:15:58.608288378Z" level=info msg="StopPodSandbox for \"763199d95d098577188715b552436231818bca5291c5a81065d1ca10839a387e\""
Jun 20 19:15:58 cubi002 k3s[9214]: time="2019-06-20T19:15:58.878185278Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:58 cubi002 k3s[9214]: time="2019-06-20T19:15:58.878473980Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:15:59 cubi002 k3s[9214]: E0620 19:15:59.630212 9214 remote_runtime.go:186] ListPodSandbox with filter nil from runtime service failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:15:59 cubi002 k3s[9214]: E0620 19:15:59.630411 9214 kuberuntime_sandbox.go:210] ListPodSandbox failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:15:59 cubi002 k3s[9214]: E0620 19:15:59.630477 9214 generic.go:205] GenericPLEG: Unable to retrieve pods: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:16:00 cubi002 k3s[9214]: E0620 19:16:00.619765 9214 remote_runtime.go:186] ListPodSandbox with filter &PodSandboxFilter{Id:,State:&PodSandboxStateValue{State:SANDBOX_READY,},LabelSelector:map[string]string{},} from
Jun 20 19:16:00 cubi002 k3s[9214]: E0620 19:16:00.619928 9214 kuberuntime_sandbox.go:210] ListPodSandbox failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:16:00 cubi002 k3s[9214]: E0620 19:16:00.619993 9214 kubelet_pods.go:1019] Error listing containers: &status.statusError{Code:4, Message:"context deadline exceeded", Details:[]*any.Any(nil)}
Jun 20 19:16:00 cubi002 k3s[9214]: E0620 19:16:00.620084 9214 kubelet.go:1942] Failed cleaning pods: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:16:00 cubi002 k3s[9214]: E0620 19:16:00.620084 9214 kubelet.go:1942] Failed cleaning pods: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:16:03 cubi002 packetbeat[2053]: 2019-06-20T19:16:03.371Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks
Jun 20 19:16:03 cubi002 k3s[9214]: time="2019-06-20T19:16:03.538701138Z" level=debug msg="Wrote ping"
Jun 20 19:16:08 cubi002 k3s[9214]: time="2019-06-20T19:16:08.538885836Z" level=debug msg="Wrote ping"
Jun 20 19:16:08 cubi002 k3s[9214]: E0620 19:16:08.837936 9214 remote_runtime.go:287] ListContainers with filter &ContainerFilter{Id:,State:nil,PodSandboxId:,LabelSelector:map[string]string{},} from runtime service failed: rp
Jun 20 19:16:08 cubi002 k3s[9214]: E0620 19:16:08.838064 9214 container_log_manager.go:174] Failed to rotate container logs: failed to list containers: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Jun 20 19:16:08 cubi002 k3s[9214]: E0620 19:16:08.880244 9214 remote_runtime.go:287] ListContainers with filter &ContainerFilter{Id:,State:nil,PodSandboxId:,LabelSelector:map[string]string{},} from runtime service failed: rp
Jun 20 19:16:08 cubi002 k3s[9214]: E0620 19:16:08.880415 9214 eviction_manager.go:247] eviction manager: failed to get summary stats: failed to list pod stats: failed to list all containers: rpc error: code = DeadlineExceede
Jun 20 19:16:08 cubi002 k3s[9214]: time="2019-06-20T19:16:08.888992481Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:08 cubi002 k3s[9214]: time="2019-06-20T19:16:08.889273795Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:13 cubi002 k3s[9214]: time="2019-06-20T19:16:13.264587948Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:13 cubi002 k3s[9214]: time="2019-06-20T19:16:13.264972113Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:13 cubi002 k3s[9214]: time="2019-06-20T19:16:13.538931830Z" level=debug msg="Wrote ping"
Jun 20 19:16:18 cubi002 k3s[9214]: time="2019-06-20T19:16:18.539204550Z" level=debug msg="Wrote ping"
Jun 20 19:16:18 cubi002 k3s[9214]: time="2019-06-20T19:16:18.908940504Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:18 cubi002 k3s[9214]: time="2019-06-20T19:16:18.909152112Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:23 cubi002 k3s[9214]: time="2019-06-20T19:16:23.539301693Z" level=debug msg="Wrote ping"
Jun 20 19:16:28 cubi002 k3s[9214]: time="2019-06-20T19:16:28.538747195Z" level=debug msg="Wrote ping"
Jun 20 19:16:28 cubi002 k3s[9214]: time="2019-06-20T19:16:28.917985822Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:28 cubi002 k3s[9214]: time="2019-06-20T19:16:28.918377541Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:33 cubi002 packetbeat[2053]: 2019-06-20T19:16:33.371Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks
Jun 20 19:16:33 cubi002 k3s[9214]: time="2019-06-20T19:16:33.539195113Z" level=debug msg="Wrote ping"
Jun 20 19:16:38 cubi002 k3s[9214]: time="2019-06-20T19:16:38.539254965Z" level=debug msg="Wrote ping"
Jun 20 19:16:38 cubi002 k3s[9214]: time="2019-06-20T19:16:38.927483447Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:38 cubi002 k3s[9214]: time="2019-06-20T19:16:38.927865563Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:43 cubi002 k3s[9214]: time="2019-06-20T19:16:43.263789746Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:43 cubi002 k3s[9214]: time="2019-06-20T19:16:43.264100853Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:43 cubi002 k3s[9214]: time="2019-06-20T19:16:43.539205062Z" level=debug msg="Wrote ping"
Jun 20 19:16:47 cubi002 k3s[9214]: E0620 19:16:47.460167 9214 remote_runtime.go:287] ListContainers with filter &ContainerFilter{Id:,State:nil,PodSandboxId:,LabelSelector:map[string]string{},} from runtime service failed: rp
Jun 20 19:16:47 cubi002 k3s[9214]: E0620 19:16:47.460840 9214 handler.go:314] HTTP InternalServerError serving /stats/summary: Internal Error: failed to list pod stats: failed to list all containers: rpc error: code = Deadli
Jun 20 19:16:48 cubi002 k3s[9214]: time="2019-06-20T19:16:48.539355119Z" level=debug msg="Wrote ping"
Jun 20 19:16:48 cubi002 k3s[9214]: time="2019-06-20T19:16:48.937767536Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:48 cubi002 k3s[9214]: time="2019-06-20T19:16:48.938157692Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:53 cubi002 k3s[9214]: time="2019-06-20T19:16:53.539188607Z" level=debug msg="Wrote ping"
Jun 20 19:16:58 cubi002 k3s[9214]: time="2019-06-20T19:16:58.539234781Z" level=debug msg="Wrote ping"
Jun 20 19:16:58 cubi002 k3s[9214]: time="2019-06-20T19:16:58.946340092Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
Jun 20 19:16:58 cubi002 k3s[9214]: time="2019-06-20T19:16:58.946624154Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
@galal-hussein is there anything (furhter logs or something like that) you need from us in order to fix these kind of issues with ubuntu?
I fixed with network device cleanup
sudo pkill containerd-shim
ip link show | grep veth | awk '{ print $2 }' | cut -d\@ -f1 | sudo xargs -I{} ip link delete {}
sudo ip link delete cni0
sudo ip link delete flannel.1
I've the same problem with my setup. The master+agent node is able to run pods, the node started only in agent mode cannot.
Here is some logs from /var/lib/rancher/k3s/agent/containerd/containerd.log
:
time="2019-07-11T15:28:53.631647734Z" level=error msg="failed to kill shim" error="context deadline exceeded: unknown"
time="2019-07-11T15:28:53.728004105Z" level=error msg="RunPodSandbox for &PodSandboxMetadata{Name:filebeat-rgz6l,Uid:a2c5ce86-a3e9-11e9-9c76-024d0b33c46b,Namespace:kube-system,Attempt:0,} failed, error" error="failed to start sandbox container: failed to create containerd task: context deadline exceeded: unknown"
time="2019-07-11T15:29:08.630744196Z" level=info msg="RunPodsandbox for &PodSandboxMetadata{Name:filebeat-rgz6l,Uid:a2c5ce86-a3e9-11e9-9c76-024d0b33c46b,Namespace:kube-system,Attempt:0,}"
time="2019-07-11T15:29:08.693095679Z" level=info msg="shim containerd-shim started" address=/containerd-shim/k8s.io/edca0aab6c82f1f149911388f1a2377ab57137ea39ea09dd898ebb080b79c1ec/shim.sock debug=false pid=14385
I've updated CentOS 7 to the latest release:
[root@kube-node-1 ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
[root@kube-node-1 ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
[root@kube-node-1 ~]# /usr/local/bin/k3s --version
k3s version v0.7.0-rc5 (dcf28d98)
I'm running the same version on both master and agent. I've installed the latest version of k3s.
I'm seeing this same issue with k3s v0.6.1 on Xenial and Bionic. When I switch from using the example systemd unit file in the git repo to running the command via sudo in an interactive shell, the pods immediately spring to life and I get no "context deadline exceeded" errors.
After looking over the install script, I realized that there's a small difference between the systemd unit files created by the installer script and the example unit file in the root of the github repo. For the server, the installer script uses Type=notify
, but it uses Type=exec
for the agent. When I make this change to the unit file for the agents, everything appears to work normally.
From reading the systemd manual, the only difference between these options is how/when systemd considers the service as started in order to trigger follow-up units. I'm guessing that systemd also performs some other actions that are important for the proper functioning of the agent processes, but it never does them because it's waiting to be notified by the agent process.
That makes sense, thanks for pointing this out @agaffney. We should modify the install script to change the type for agents, or maybe better add some code to send a systemd notification from the agent also.
The install script already does the right thing. The problem is that not everybody uses the installer (I'm not a fan of curlpipes). It would probably be a good idea to update the example systemd unit file in the repo and docs to reflect this difference, but modifying the agent so that there is no difference is also a good idea.
Describe the bug A clear and concise description of what the bug is.
running k3s agent node as systemd service as below cause agent node fail to create pod
start k3s agent service as:
deploy nginx pod and service : kubectl apply -f nginx_cluster_pod_service.yaml
nginx pod in agent node stuck in ContainerCreating
running k3s agent node from command line as below, nginx pod is able to be created
To Reproduce Steps to reproduce the behavior:
download k3s 0.5 and run k3s agent node from systemd service as above example
Expected behavior A clear and concise description of what you expected to happen.
k3s agent node should be able to run from systemd service and able to create pod
Screenshots If applicable, add screenshots to help explain your problem.
k3s agent node startup logs from systemd service
Additional context Add any other context about the problem here.