Closed luozc5 closed 3 months ago
grep Time /var/log/sys.log
@zhangguanzhang Thank you for your reply. Over the weekend, the cluster was back to normal, and then I restarted the machine again with the same problem. I tried restarting the kube-apiserver pod manually after the problem occurred again, but I still had the same problem.
root@node1:/home/ubuntu# grep Time /var/log/syslog
Feb 26 02:54:57 node1 systemd[3932970]: Reached target Timers.
Feb 26 02:55:43 node1 systemd[1]: Stopped target Timer Units.
Feb 26 10:03:35 node1 kernel: [ 0.091679] ACPI: PM-Timer IO Port: 0x1008
Feb 26 10:03:35 node1 systemd[1]: Starting Network Time Synchronization...
Feb 26 10:03:35 node1 systemd[1]: Started Network Time Synchronization.
Feb 26 10:03:35 node1 systemd[1]: Reached target System Time Set.
Feb 26 10:03:35 node1 systemd[1]: Condition check resulted in Timer to automatically fetch and run repair assertions being skipped.
Feb 26 10:03:35 node1 systemd[1]: Condition check resulted in Ubuntu Pro Timer for running repeated jobs being skipped.
Feb 26 10:03:35 node1 systemd[1]: Reached target Timer Units.
Feb 26 10:03:37 node1 systemd[885]: Reached target Timers.
Feb 26 10:03:41 node1 cri-dockerd[1106]: time="2024-02-26T10:03:41Z" level=info msg="Docker Info: &{ID:BENZ:JLAQ:ZS2L:YKAH:IOE6:C7IG:APYH:SX42:EEQF:QQLK:XCYH:7MKM Containers:43 ContainersRunning:0 ContainersPaused:0 ContainersStopped:43 Images:16 Driver:overlay2 DriverStatus:[[Backing Filesystem extfs] [Supports d_type true] [Native Overlay Diff true] [userxattr false]] SystemStatus:[] Plugins:{Volume:[local] Network:[bridge host ipvlan macvlan null overlay] Authorization:[] Log:[awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog]} MemoryLimit:true SwapLimit:true KernelMemory:false KernelMemoryTCP:false CPUCfsPeriod:true CPUCfsQuota:true CPUShares:true CPUSet:true PidsLimit:true IPv4Forwarding:true BridgeNfIptables:true BridgeNfIP6tables:true Debug:false NFd:25 OomKillDisable:false NGoroutines:34 SystemTime:2024-02-26T10:03:41.429680742Z LoggingDriver:json-file CgroupDriver:systemd CgroupVersion:2 NEventsListener:0 KernelVersion:5.15.0-97-generic OperatingSystem:Ubuntu 22.04.3 LTS OSVersion:22.04 OSType:linux Architecture:x86_64 IndexServerAddress:https://index.docker.io/v1/ RegistryConfig:0xc0004cf260 NCPU:1 MemTotal:33653272576 GenericResources:[] DockerRootDir:/var/lib/docker HTTPProxy: HTTPSProxy: NoProxy: Name:node1 Labels:[] ExperimentalBuild:false ServerVersion:20.10.20 ClusterStore: ClusterAdvertise: Runtimes:map[io.containerd.runc.v2:{Path:runc Args:[] Shim:
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
I have the same issue with K8 v1.27.7 (3 master nodes). After restart of any nodes pods in kube-system are starting during 0.5 hour. And there are an errors in kube-api-server logs E0812 06:45:53.245948 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]"
I checked ntp credentials, time on all 3 nodes - it's equal. Tested disks - it's working fine.
/reopen
@smilena2012: You can't reopen an issue/PR unless you authored it or you are a collaborator.
What happened?
I used kubesparay (tag 2.24.0) to deploy a single-node k8s cluster and everything worked fine. But when I restarted the machine, the entire k8s cluster was out of order.
root@node1:/home/ubuntu# kubectl get pods -A -o wide NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES ingress-nginx ingress-nginx-controller-9wqqw 0/1 CrashLoopBackOff 14 (3m47s ago) 16h 10.233.102.144 node1
kube-system calico-kube-controllers-648dffd99-8qk84 0/1 CrashLoopBackOff 13 (89s ago) 16h 10.233.102.142 node1
kube-system calico-node-d7s5k 0/1 Completed 0 16h 172.18.6.107 node1
kube-system coredns-77f7cc69db-bq7gq 0/1 Running 2 (84m ago) 16h 10.233.102.141 node1
kube-system dns-autoscaler-595558c478-rhnw5 1/1 Running 2 (84m ago) 16h 10.233.102.146 node1
kube-system kube-apiserver-node1 0/1 Running 3 (84m ago) 16h 172.18.6.107 node1
kube-system kube-controller-manager-node1 0/1 Running 4 (84m ago) 16h 172.18.6.107 node1
kube-system kube-proxy-w5527 1/1 Running 2 (84m ago) 16h 172.18.6.107 node1
kube-system kube-scheduler-node1 0/1 Running 4 (84m ago) 16h 172.18.6.107 node1
kube-system metrics-server-bd6df7764-tl6cm 0/1 CrashLoopBackOff 13 (4m12s ago) 16h 10.233.102.143 node1
local-path-storage local-path-provisioner-f78b6cbbc-gfwk8 0/1 CrashLoopBackOff 14 (4m46s ago) 16h 10.233.102.145 node1
When I looked at apiserver's log, I found that it was frantically printing the following logs:
E0223 03:00:36.836614 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:37.036443 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:37.241868 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:37.435932 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:37.636295 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:37.835913 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:38.037226 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:38.235701 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:38.436108 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]" E0223 03:00:38.637042 1 authentication.go:73] "Unable to authenticate the request" err="[invalid bearer token, service account token is not valid yet]"
What is the reason? Thanks.
What did you expect to happen?
After the machine restarts, the k8s cluster runs normally
How can we reproduce it (as minimally and precisely as possible)?
Restart the machine
OS
Linux 5.15.0-94-generic x86_64 PRETTY_NAME="Ubuntu 22.04.3 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.3 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy
Version of Ansible
ansible [core 2.15.9] config file = /home/ubuntu/kubespray-2.24.0/ansible.cfg configured module search path = ['/home/ubuntu/kubespray-2.24.0/library'] ansible python module location = /home/ubuntu/kubespray-venv/lib/python3.10/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /home/ubuntu/kubespray-venv/bin/ansible python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/home/ubuntu/kubespray-venv/bin/python3) jinja version = 3.1.2 libyaml = True
Version of Python
Python 3.10.12
Version of Kubespray (commit)
tag 2.24.0
Network plugin used
calico
Full inventory with variables
(kubespray-venv) root@node1:/home/ubuntu/kubespray-2.24.0# ansible -i inventory/mycluster/hosts.yaml all -m debug -a "var=hostvars[node1]" [WARNING]: Skipping callback plugin 'ara_default', unable to load node1 | SUCCESS => { "hostvars[node1]": "VARIABLE IS NOT DEFINED!" }
Command used to invoke ansible
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root cluster.yml -vvv
Output of ansible run
TASK [network_plugin/calico : Check if inventory match current cluster configuration] **** task path: /home/ubuntu/kubespray-2.24.0/roles/network_plugin/calico/tasks/check.yml:168 ok: [node1] => { "changed": false, "msg": "All assertions passed" } Thursday 22 February 2024 10:52:24 +0000 (0:00:00.115) 0:45:58.431 Thursday 22 February 2024 10:52:24 +0000 (0:00:00.086) 0:45:58.517 Thursday 22 February 2024 10:52:24 +0000 (0:00:00.076) 0:45:58.594 *****
PLAY RECAP *** localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 node1 : ok=776 changed=150 unreachable=0 failed=0 skipped=1168 rescued=0 ignored=6
Thursday 22 February 2024 10:52:24 +0000 (0:00:00.162) 0:45:58.757 *****
container-engine/crictl : Download_file | Download item ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1653.88s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_file | Download item --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 58.88s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_file | Download item --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 44.42s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- container-engine/docker : Ensure docker packages are installed ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 36.50s /home/ubuntu/kubespray-2.24.0/roles/container-engine/docker/tasks/main.yml:105 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_file | Download item --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 35.33s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_file | Download item --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 34.87s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- network_plugin/calico : Check if calico ready ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 32.24s /home/ubuntu/kubespray-2.24.0/roles/network_plugin/calico/tasks/check.yml:53 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_file | Download item --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 29.65s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 28.33s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 27.08s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_file | Download item --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 25.58s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 21.33s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 20.14s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 19.47s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- container-engine/cri-dockerd : Download_file | Download item ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 19.37s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_file.yml:88 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 18.91s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- kubernetes/control-plane : Kubeadm | Initialize first master ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 17.17s /home/ubuntu/kubespray-2.24.0/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml:178 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 16.57s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- download : Download_container | Download image if required --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 14.90s /home/ubuntu/kubespray-2.24.0/roles/download/tasks/download_container.yml:57 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- etcdctl_etcdutl : Copy etcdctl and etcdutl binary from docker container -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 13.74s /home/ubuntu/kubespray-2.24.0/roles/etcdctl_etcdutl/tasks/main.yml:2 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ (kubespray-venv) root@ubuntu:/home/ubuntu/kubespray-2.24.0#
Anything else we need to know
No response