@@ -71,7 +71,7 @@ func appendK3sServerDiagnostics(ctx context.Context, buf *bytes.Buffer, clusterN
7171 appendCommandOutput (ctx , buf , "docker inspect " + nodeName , "docker" , []string {
7272 "inspect" ,
7373 "--format" ,
74- "Status={{.State.Status}} Health={{if .State.Health}}{{.State.Health.Status}}{{else}}<none>{{end}} Restarting={{.State.Restarting}} ExitCode={{.State.ExitCode}} Error={{.State.Error}}" ,
74+ "Status={{.State.Status}} Health={{if .State.Health}}{{.State.Health.Status}}{{else}}<none>{{end}} Restarting={{.State.Restarting}} ExitCode={{.State.ExitCode}} Error={{.State.Error}} Privileged={{.HostConfig.Privileged}} Cgroupns={{.HostConfig.CgroupnsMode}} " ,
7575 nodeName ,
7676 }, []string {"DOCKER_CONTEXT=" + dockerContext })
7777 appendCommandOutput (ctx , buf , "docker logs " + nodeName , "docker" , []string {"logs" , "--tail" , "80" , nodeName }, []string {"DOCKER_CONTEXT=" + dockerContext })
@@ -81,6 +81,11 @@ func appendK3sServerDiagnostics(ctx context.Context, buf *bytes.Buffer, clusterN
8181 if ! strings .Contains (nodeName , "-server-" ) {
8282 continue
8383 }
84+ appendCommandOutput (ctx , buf , "docker exec " + nodeName + " ps" , "docker" , []string {"exec" , nodeName , "sh" , "-c" , "ps auxww" }, []string {"DOCKER_CONTEXT=" + dockerContext })
85+ appendCommandOutput (ctx , buf , "docker exec " + nodeName + " ss" , "docker" , []string {"exec" , nodeName , "sh" , "-c" , "ss -lntp || netstat -lntp" }, []string {"DOCKER_CONTEXT=" + dockerContext })
86+ appendCommandOutput (ctx , buf , "docker exec " + nodeName + " cgroup" , "docker" , []string {"exec" , nodeName , "sh" , "-c" , "cat /proc/1/cgroup && echo && mount | grep cgroup" }, []string {"DOCKER_CONTEXT=" + dockerContext })
87+ appendCommandOutput (ctx , buf , "docker exec " + nodeName + " k3s files" , "docker" , []string {"exec" , nodeName , "sh" , "-c" , "find /var/lib/rancher/k3s -maxdepth 3 -type f 2>/dev/null | sort" }, []string {"DOCKER_CONTEXT=" + dockerContext })
88+ appendCommandOutput (ctx , buf , "docker exec " + nodeName + " k3s logs" , "docker" , []string {"exec" , nodeName , "sh" , "-c" , "for f in /var/log/k3s.log /var/lib/rancher/k3s/agent/containerd/containerd.log /var/lib/rancher/k3s/server/logs/*; do if [ -f \" $f\" ]; then echo \" == $f ==\" ; tail -n 200 \" $f\" ; echo; fi; done" }, []string {"DOCKER_CONTEXT=" + dockerContext })
8489 appendCommandOutput (ctx , buf , "docker exec " + nodeName + " kubectl get pods" , "docker" , []string {"exec" , nodeName , "kubectl" , "get" , "pods" , "-A" , "-o" , "wide" }, []string {"DOCKER_CONTEXT=" + dockerContext })
8590 appendCommandOutput (ctx , buf , "docker exec " + nodeName + " kubectl get events" , "docker" , []string {"exec" , nodeName , "kubectl" , "get" , "events" , "-A" , "--sort-by=.lastTimestamp" }, []string {"DOCKER_CONTEXT=" + dockerContext })
8691 appendCommandOutput (ctx , buf , "docker exec " + nodeName + " kubectl describe pods" , "docker" , []string {"exec" , nodeName , "kubectl" , "describe" , "pods" , "-A" }, []string {"DOCKER_CONTEXT=" + dockerContext })
0 commit comments