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

failed to get docker runtime info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" #10782

Closed
2694484453 opened this issue Aug 30, 2024 · 2 comments

Comments

@2694484453
Copy link

2694484453 commented Aug 30, 2024

###########################################
docker version

root@iZbp1chs1na7nj4qz70ep1Z:/# docker version
Client:
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.3
 Git commit:        24.0.5-0ubuntu1~20.04.1
 Built:             Mon Aug 21 19:50:14 2023
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.3
  Git commit:       24.0.5-0ubuntu1~20.04.1
  Built:            Mon Aug 21 19:50:14 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.2
  GitCommit:        
 runc:
  Version:          1.1.7-0ubuntu1~20.04.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:      

#################################################
service

 docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-08-30 03:01:10 CST; 7h ago

##################################################
docker-compose.yml

version: "3"
services:
  k3s-node1:
    image: registry.cn-hangzhou.aliyuncs.com/gpg_dev/k3s:v1.24.10-k3s1
    container_name: k3s-1
    privileged: true
    hostname: k3s-node1
    ports:
      - "6443:6443"
      - "19090:19090"
    tmpfs:
      - /run
      - /var/run
    environment:
      - K3S_KUBECONFIG_OUTPUT=/root/.kube/config
      - K3S_KUBECONFIG_MODE=644
    command:
      - server
     # - --disable=traefik  #不需要部署的组件,删除任何已部署的组件 (有效项目:coredns, servicelb, traefik,local-storage, metrics-server)
      - --etcd-expose-metrics=true #将 etcd 指标公开给客户端界面。(默认为 false)
      - --private-registry="/etc/rancher/k3s/registries.yaml" #私有镜像仓库配置文件
      # - --pause-image="docker.io/rancher/pause:3.1"  #针对 containerd 或 Docker 的自定义 pause 镜像
      - --docker #docker代替containerd
    volumes:
      #- ./k3s.yaml:/etc/rancher/k3s/k3s.yaml
      - /root/.kube:/root/.kube
      - ./registries.yaml:/etc/rancher/k3s/registries.yaml
      - ./velero-7.0.1.tgz:/var/lib/rancher/k3s/server/static/charts/velero-7.0.1.tgz
      - ./kubernetes-dashboard-7.5.0.tgz:/var/lib/rancher/k3s/server/static/charts/kubernetes-dashboard-7.5.0.tgz
      - ./velero.yaml:/var/lib/rancher/k3s/server/manifests/velero.yaml
      - ./kubernetes-dashboard.yaml:/var/lib/rancher/k3s/server/manifests/kubernetes-dashboard.yaml

########################################################
failed

level=fatal msg="failed to get docker runtime info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"

image

@brandond
Copy link
Member

  1. K3s is running in docker, but you have not mounted the docker socket into the container so it cannot connect to it.
  2. registries.yaml only works with the bundled containerd, not with docker.

@github-project-automation github-project-automation bot moved this from New to Done Issue in K3s Development Aug 30, 2024
@2694484453
Copy link
Author

i add this,why create so many?
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/cri-dockerd.sock:/var/run/cri-dockerd.sock
- /var/lib/docker:/var/lib/docker

#########################################logs################################
E0902 01:49:10.503250 30 pod_workers.go:1298] "Error syncing pod, skipping" err="failed to "CreatePodSandbox" for "metrics-server-557ff575fb-t57bb_kube-system(b7f7c995-1830-4f15-b17a-e9bf5d38155f)" with CreatePodSandboxError: "Failed to create sandbox for pod \"metrics-server-557ff575fb-t57bb_kube-system(b7f7c995-1830-4f15-b17a-e9bf5d38155f)\": rpc error: code = Unknown desc = failed to set up sandbox container \"35c5989d68ec77717edac177c7973f4d79c707a97cf74603e0f1b978b4c9abf7\" network for pod \"metrics-server-557ff575fb-t57bb\": networkPlugin cni failed to set up pod \"metrics-server-557ff575fb-t57bb_kube-system\" network: plugin type=\"loopback\" failed (add): failed to Statfs \"/proc/948243/ns/net\": no such file or directory"" pod="kube-system/metrics-server-557ff575fb-t57bb" podUID="b7f7c995-1830-4f15-b17a-e9bf5d38155f"
2024-09-02T01:49:10.523388650Z time="2024-09-02T01:49:10Z" level=info msg="Failed to read pod IP from plugin/docker: networkPlugin cni failed on the status hook for pod "metrics-server-557ff575fb-t57bb_kube-system": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container "35c5989d68ec77717edac177c7973f4d79c707a97cf74603e0f1b978b4c9abf7""
2024-09-02T01:49:10.526945918Z I0902 01:49:10.526672 30 pod_container_deletor.go:80] "Container not found in pod's containers" containerID="35c5989d68ec77717edac177c7973f4d79c707a97cf74603e0f1b978b4c9abf7"
2024-09-02T01:49:10.535002128Z time="2024-09-02T01:49:10Z" level=info msg="Failed to read pod IP from plugin/docker: networkPlugin cni failed on the status hook for pod "local-path-provisioner-6795b5f9d8-7dtsr_kube-system": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container "97358583d10bd4b094cf02062c1501fd14252cc3a584b267a986ff74cc6150a3""
2024-09-02T01:49:10.539554547Z I0902 01:49:10.539336 30 pod_container_deletor.go:80] "Container not found in pod's containers" containerID="97358583d10bd4b094cf02062c1501fd14252cc3a584b267a986ff74cc6150a3"
2024-09-02T01:49:10.575244714Z time="2024-09-02T01:49:10Z" level=info msg="Failed to read pod IP from plugin/docker: networkPlugin cni failed on the status hook for pod "helm-install-velero-8z2c8_kube-system": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container "a1ea5b69060118df4b60d5bc76bedb8ffbd873b364728409bdda48d46d393395""
2024-09-02T01:49:10.590975328Z I0902 01:49:10.590777 30 pod_container_deletor.go:80] "Container not found in pod's containers" containerID="a1ea5b69060118df4b60d5bc76bedb8ffbd873b364728409bdda48d46d393395"

################
image

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

No branches or pull requests

2 participants