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

Handle docker-compose files containing mounted files #587

Open
chriswalker opened this issue Jun 22, 2021 · 0 comments
Open

Handle docker-compose files containing mounted files #587

chriswalker opened this issue Jun 22, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@chriswalker
Copy link
Contributor

Short issue description

docker-compose files containing file mounts generate warnings when running kev render to generate the k8s manifests. For example, the following compose file is valid and attempts to mount a local prometheus.yml configuration file within the container:

version: '2'
volumes:
  prometheus_data: {}
services:
  prometheus:
    image: prom/prometheus
    volumes:
      - prometheus_data:/prometheus
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
    ports:
      - '9090:9090'

This is fine for docker-compose, but does not translate directly to Kubernetes, hence the warnings when running kev render, leading to the following output:

⠋ Converting service: prometheus warn  Volume mount on the host isn't supported. Ignoring path on the host host=/path/to/config/prometheus.yml project-service=prometheus

Kev version:
OS (Linux/Mac/Windows..): MacOS Bug Sur (11.4)
Docker Compose version: 1.29.2
Kubernetes version: 1.21.1
Kubernetes distribution (e.g. GKE, EKS, ...): as bundled with Docker Desktop

How can we reproduce the issue?

Using the above docker-compose.yaml sample, run kev init ..., followed by kev render.

Suggestions on how to fix the issue (OPTIONAL)

There are a couple of scenarios to consider here. Users may be mounting text files (usually config files, as in the example above), or less common files types such as sockets (mounting the docker socket isn't uncommon). kev could display more helpful information around translating configuration-type files into Kubernetes ConfigMaps, and sensibly error when dealing with files such as Unix sockets.

@chriswalker chriswalker added the bug Something isn't working label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant