@@ -47,11 +47,18 @@ var (
47
47
- 'journalctl -xeu kubelet'
48
48
49
49
Additionally, a control plane component may have crashed or exited when started by the container runtime.
50
- To troubleshoot, list all containers using your preferred container runtimes CLI, e.g. docker.
50
+ To troubleshoot, list all containers using your preferred container runtimes CLI.
51
+ {{ if .IsDocker }}
51
52
Here is one example how you may list all Kubernetes containers running in docker:
52
53
- 'docker ps -a | grep kube | grep -v pause'
53
54
Once you have found the failing container, you can inspect its logs with:
54
55
- 'docker logs CONTAINERID'
56
+ {{ else }}
57
+ Here is one example how you may list all Kubernetes containers running in cri-o/containerd using crictl:
58
+ - 'crictl --runtime-endpoint {{ .Socket }} ps -a | grep kube | grep -v pause'
59
+ Once you have found the failing container, you can inspect its logs with:
60
+ - 'crictl --runtime-endpoint {{ .Socket }} logs CONTAINERID'
61
+ {{ end }}
55
62
` )))
56
63
)
57
64
@@ -93,10 +100,17 @@ func runWaitControlPlanePhase(c workflow.RunData) error {
93
100
fmt .Printf ("[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory %q. This can take up to %v\n " , data .ManifestDir (), timeout )
94
101
95
102
if err := waiter .WaitForKubeletAndFunc (waiter .WaitForAPI ); err != nil {
96
- ctx := map [string ]string {
97
- "Error" : fmt .Sprintf ("%v" , err ),
103
+ context := struct {
104
+ Error string
105
+ Socket string
106
+ IsDocker bool
107
+ }{
108
+ Error : fmt .Sprintf ("%v" , err ),
109
+ Socket : data .Cfg ().NodeRegistration .CRISocket ,
110
+ IsDocker : data .Cfg ().NodeRegistration .CRISocket == kubeadmconstants .DefaultDockerCRISocket ,
98
111
}
99
- kubeletFailTempl .Execute (data .OutputWriter (), ctx )
112
+
113
+ kubeletFailTempl .Execute (data .OutputWriter (), context )
100
114
return errors .New ("couldn't initialize a Kubernetes cluster" )
101
115
}
102
116
0 commit comments