-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
podman play kube fails when a container has a containerPort set and replicas > 1 #16765
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Comments
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 7, 2022
podman play kube creates a pod per replica and tries to bind all of them to the same host port. That however can only work when there is one replica as otherwise multiple pods get bound to the same port on the host. This fixes containers#16765
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 7, 2022
podman play kube creates a pod per replica and tries to bind all of them to the same host port. That however can only work when there is one replica as otherwise multiple pods get bound to the same port on the host. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 7, 2022
podman play kube creates a pod per replica and tries to bind all of them to the same host port. That however can only work when there is one replica as otherwise multiple pods get bound to the same port on the host. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 7, 2022
podman play kube creates a pod per replica and tries to bind all of them to the same host port. That however can only work when there is one replica as otherwise multiple pods get bound to the same port on the host. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 7, 2022
podman play kube creates a pod per replica and tries to bind all of them to the same host port. That however can only work when there is one replica as otherwise multiple pods get bound to the same port on the host. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 8, 2022
Kubernetes deployments and pods allow to specify ports for each container in the spec. Podman was by default exposing these ports on the host, but this causes issues when multiple replicas are involved, as then podman would bind multiple containers to the same port. This commit adds the new flag `--expose` to `podman play kube` which explicitly tells podman to publish ports on the host (off by default). Additionally, if multiple replicas are involved, then podman will override the hostPort and pick a random port on the host to avoid clashes. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 8, 2022
Kubernetes deployments and pods allow to specify ports for each container in the spec. Podman was by default exposing these ports on the host, but this causes issues when multiple replicas are involved, as then podman would bind multiple containers to the same port. This commit adds the new flag `--expose` to `podman play kube` which explicitly tells podman to publish ports on the host (off by default). Additionally, if multiple replicas are involved, then podman will override the hostPort and pick a random port on the host to avoid clashes. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 8, 2022
Kubernetes deployments and pods allow to specify ports for each container in the spec. Podman was by default exposing these ports on the host, but this causes issues when multiple replicas are involved, as then podman would bind multiple containers to the same port. This commit adds the new flag `--expose` to `podman play kube` which explicitly tells podman to publish ports on the host (off by default). Additionally, if multiple replicas are involved, then podman will override the hostPort and pick a random port on the host to avoid clashes. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 8, 2022
Kubernetes deployments and pods allow to specify ports for each container in the spec. Podman was by default exposing these ports on the host, but this causes issues when multiple replicas are involved, as then podman would bind multiple containers to the same port. This commit adds the new flag `--expose` to `podman play kube` which explicitly tells podman to publish ports on the host (off by default). Additionally, if multiple replicas are involved, then podman will override the hostPort and pick a random port on the host to avoid clashes. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 12, 2022
Kubernetes deployments and pods allow to specify ports for each container in the spec. Podman was by default exposing these ports on the host, but this causes issues when multiple replicas are involved, as then podman would bind multiple containers to the same port. This commit adds the new flag `--expose` to `podman play kube` which explicitly tells podman to publish ports on the host (off by default). Additionally, if multiple replicas are involved, then podman will override the hostPort and pick a random port on the host to avoid clashes. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 12, 2022
Kubernetes deployments and pods allow to specify ports for each container in the spec. Podman was by default exposing these ports on the host, but this causes issues when multiple replicas are involved, as then podman would bind multiple containers to the same port. This commit adds the new flag `--expose` to `podman play kube` which explicitly tells podman to publish ports on the host (off by default). Additionally, if multiple replicas are involved, then podman will override the hostPort and pick a random port on the host to avoid clashes. This fixes containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 15, 2022
podman play kube started to expose the port of containers in k8s deployments on the same port on the host with containers#15946. However, that breaks once replicas are involved, as they would then bind to the same port on the host. With this commit, we change the default behavior so that podman will pick a random port for the container instead of using `containerPort`, but only if no `hostPort` is set. This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 15, 2022
podman play kube started to expose the port of containers in k8s deployments on the same port on the host with containers#15946. However, that breaks once replicas are involved, as they would then bind to the same port on the host. With this commit, we change the default behavior so that podman will pick a random port for the container instead of using `containerPort`, but only if no `hostPort` is set. This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 15, 2022
podman play kube started to expose the port of containers in k8s deployments on the same port on the host with containers#15946. However, that breaks once replicas are involved, as they would then bind to the same port on the host. With this commit, we change the default behavior so that podman will pick a random port for the container instead of using `containerPort`, but only if no `hostPort` is set. This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 16, 2022
podman play kube started to expose the port of containers in k8s deployments on the same port on the host with containers#15946. However, that breaks once replicas are involved, as they would then bind to the same port on the host. With this commit, we change the default behavior so that podman will pick a random port for the container instead of using `containerPort`, but only if no `hostPort` is set. This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Dec 20, 2022
podman play kube started to expose the port of containers in k8s deployments on the same port on the host with containers#15946. However, that breaks once replicas are involved, as they would then bind to the same port on the host. With this commit, we change the default behavior so that podman will pick a random port for the container instead of using `containerPort`, but only if no `hostPort` is set. This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Jan 2, 2023
podman play kube started to expose the port of containers in k8s deployments on the same port on the host with containers#15946. However, that breaks once replicas are involved, as they would then bind to the same port on the host. With this commit, we change the default behavior so that podman will pick a random port for the container instead of using `containerPort`, but only if no `hostPort` is set. This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
A friendly reminder that this issue had no activity for 30 days. |
This was referenced Jan 11, 2023
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Jan 12, 2023
This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Jan 12, 2023
This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Jan 12, 2023
This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
dcermak
added a commit
to dcermak/podman
that referenced
this issue
Jan 12, 2023
This fixes: containers#16765 Signed-off-by: Dan Čermák <dcermak@suse.com>
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Sep 4, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
With podman > 4.2
podman play kube
will bind the created pods to the same port & network, which causes the pods to fail to start.Steps to reproduce the issue:
hello-kubic.yaml
file:podman play kube hello-kubic.yaml
Describe the results you received:
The pods fails to start:
Describe the results you expected:
The pods should have been started
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
I think this is actually a regression introduced by #15946. I have reverted that commit on
main
and the yaml manifests can be played without issues.The text was updated successfully, but these errors were encountered: