You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm using podman-compose to migrate docker-composite solutions to kubernetes via:
podman kube generate <podId>
podman-compose uses the _ character as a delimiter when generating volume and container names.
For example, when starting a service stack hello-python in POD:
# cd examples/hello-python
# podman-compose --in-pod hello-python up -d
we get a pod with container names hello-python_redis_1,``hello-python_web_1:
# podman pod ls --ctr-names
POD ID NAME STATUS CREATED INFRA ID NAMES
6bc55962dc29 pod_hello-python Running 2 minutes ago hello-python_redis_1,hello-python_web_1
and volume name hello-python_redis
# podman volume ls | grep hello-python
hello-python_redis
The Pod "podhello-python" is invalid:
* spec.volumes[1].name: Invalid value: "hello-python_redis-pvc": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
* spec.containers[0].volumeMounts[0].name: Not found: "hello-python_redis-pvc"
...
Describe the solution you'd like
I created a pull request Support for migrating docker-compose solutions to kubernetes that solves this problem. This pull request supports the --kubecompat flag, which when specified uses the - separator character when generating names of containers and volumes.
When podman-compose called with a flag --kubecompat
podman-compose --kubecompat --in-pod hello-python up -d
we get a pod with container names hello-python-redis-1, hello-python-web-1:
# podman pod ls --ctr-names
POD ID NAME STATUS CREATED INFRA ID NAMES
87c28523698a pod_hello-python Running 59 minutes ago hello-python-redis-1,hello-python-web-1
and volume name hello-python-redis
# podman volume ls | grep hello-python
hello-python-redis
# kubectl apply -f ./kube.yml
pod/podhello-python created
# kubectl get pod/podhello-python -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
podhello-python 2/2 Running 0 47s 10.88.0.21 host-8
Describe alternatives you've considered The reason for using the _ character as a delimiter is not obvious to me.
Maybe it's worth using the - character as a default separator?
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm using
podman-compose
to migrate docker-composite solutions tokubernetes
via:podman-compose uses the
_
character as a delimiter when generating volume and container names.For example, when starting a service stack
hello-python in POD:
we get a pod with container names
hello-python_redis_1,``hello-python_web_1
:and volume name
hello-python_redis
After generating the kube- manifest
and trying to run it,
we receive an error message:
Describe the solution you'd like
I created a pull request Support for migrating docker-compose solutions to kubernetes that solves this problem.
This pull request supports the
--kubecompat
flag, which when specified uses the-
separator character when generating names of containers and volumes.When
podman-compose
called with a flag--kubecompat
we get a pod with container names hello-python-redis-1, hello-python-web-1:
and volume name hello-python-redis
After generating the kube- manifest
and trying to run it,
we get a correctly deployed pod:
Describe alternatives you've considered
The reason for using the
_
character as a delimiter is not obvious to me.Maybe it's worth using the
-
character as a default separator?Additional context
The text was updated successfully, but these errors were encountered: