devspace icon indicating copy to clipboard operation
devspace copied to clipboard

Docker compose conversion issues

Open LukasGentele opened this issue 4 years ago • 1 comments

What happened? Running devspace init with a docker-compose.yml present in the repo, there are several issues:

  1. Volumes in docker-compose.yml may contain _ character which is not permitted as Kubernetes name for volumes.
  2. We should not add restartPolicy: Never because it can lead to the error: Error: StatefulSet.apps "xyz" is invalid: spec.template.spec.restartPolicy: Unsupported value: "Never": supported values: "Always"
  3. Images in the deployments section should use DevSpace runtime variables to prevent duplicate use of the same string.
  4. dev section should be using imageSelector and DevSpace runtime variables instead of labelSelector
  5. dev section should use port + 9000 or something similar for localhost ports if ports are using numbers < 1024 because these ports cannot be used without sudo/root which should not be recommended and can lead to other issues.
  6. If a service has 2 port definitions, UDP and TCP, the port-forwarding section should NOT contain 2x the same port because that will cause issues with DevSpace trying to listen to the same port twice which fails.

What did you expect to happen instead? Docker compose conversion to make smarter assumptions that actually work in Kubernetes, i.e. fix above issues.

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

version: ...
...

Local Environment:

  • DevSpace Version: [use devspace --version]
  • Operating System: windows | linux | mac
  • ARCH of the OS: AMD64 | ARM64 | i386 Kubernetes Cluster:
  • Cloud Provider: google | aws | azure | other
  • Kubernetes Version: [use kubectl version]

Anything else we need to know?

/kind bug

LukasGentele avatar Feb 14 '22 07:02 LukasGentele

Hi, any updates on this?

slanka-res avatar Apr 13 '23 06:04 slanka-res