Skip to content

kompose convert Volume mount on the host isn't supported #1271

Closed
@moluzhui

Description

The project agent image needs to mount docker.sock and then query the host container log using the docker SDK, and mount the data directory to persist portions of data. The kompose convert failed, docker.sock and data directory could not be mounted to the container.

# kompose convert
WARN Volume mount on the host "/var/run/docker.sock" isn't supported - ignoring path on the host 
WARN Volume mount on the host "/root/moluzhui/agent/data/" isn't supported - ignoring path on the host 
INFO Kubernetes file "agent-service.yaml" created 
INFO Kubernetes file "agent-deployment.yaml" created 
INFO Kubernetes file "agent-claim0-persistentvolumeclaim.yaml" created 
INFO Kubernetes file "agent-claim1-persistentvolumeclaim.yaml" created

I executed the kubectl logs command and entered the following error

File "/usr/local/lib/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/docker/transport/unixconn.py", line 43, in connect
    sock.connect(self.unix_socket)
ConnectionRefusedError: [Errno 111] Connection refused

I executed the kubectl exec command into the container to execute docker ps with the following error

bash-5.0# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

How do I mount it to the container I need?

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions