Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors with containerd runtime #140

Open
andrey-gava opened this issue Feb 2, 2021 · 2 comments
Open

Errors with containerd runtime #140

andrey-gava opened this issue Feb 2, 2021 · 2 comments

Comments

@andrey-gava
Copy link

Hello!

Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:59:43Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:51:19Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}

Container runtime - containerd
Kubectl-debug version v0.2.0-rc and v0.1.1

I get this kind of errors in agentless=true and with daemonset agents deployed:

kubectl-debug --agentless -n dev oauth-dev-5c885dfd7f-98j2n
Agent Pod info: [Name:debug-agent-pod-46aa6a04-655a-11eb-a63d-00505696f1d5, Namespace:default, Image:aylei/debug-agent:latest, HostPort:10027, ContainerPort:10027]
Waiting for pod debug-agent-pod-46aa6a04-655a-11eb-a63d-00505696f1d5 to run...
Start deleting agent pod oauth-dev-5c885dfd7f-98j2n 
error execute remote, unable to upgrade connection: Failed to construct RuntimeManager.  Error- failed to dial "/run/containerd/containerd.sock"- context deadline exceeded
error: unable to upgrade connection: Failed to construct RuntimeManager.  Error- failed to dial "/run/containerd/containerd.sock"- context deadline exceeded
kubectl-debug --agentless --port-forward nginx-deployment-668f8b749b-b695l
Agent Pod info: [Name:debug-agent-pod-b8591a5a-655a-11eb-ab03-5254004d77d3, Namespace:default, Image:aylei/debug-agent:latest, HostPort:10027, ContainerPort:10027]
Waiting for pod debug-agent-pod-b8591a5a-655a-11eb-ab03-5254004d77d3 to run...
Forwarding from 127.0.0.1:10027 -> 10027
Forwarding from [::1]:10027 -> 10027
Handling connection for 10027
                             Start deleting agent pod nginx-deployment-668f8b749b-b695l 
error execute remote, Internal error occurred: error attaching to container: failed to mount /tmp/containerd-mount374763324: no such file or directory
error: Internal error occurred: error attaching to container: failed to mount /tmp/containerd-mount374763324: no such file or directory
@lic17
Copy link

lic17 commented Nov 19, 2021

mount hostPath /var/lib/containerd to the agent pod can fix the err.

@JamesTGrant
Copy link
Collaborator

JamesTGrant commented Dec 1, 2021

If you're using agentless (which is good!) then you'll need to rebuild (follow the build from source instructions in the README.md) the project with the following changes in pkg/plugin/cmd.go

Add varlibcontainerd to Volumes: []corev1.Volume section like this:

			{
				Name: "varlibcontainerd",
				VolumeSource: corev1.VolumeSource{
					HostPath: &corev1.HostPathVolumeSource{
						Path: "/var/lib/containerd",
					},
				},
			},	

Add varlibcontainerd to VolumeMounts section like this:

					{
						Name:      "vardata",
						MountPath: "/var/data",
					},
					{
						Name:      "varlibcontainerd",
						MountPath: "/var/lib/containerd",
					},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants