-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Container name inside pod is different then what it is in yaml file #16544
Comments
podman play kube generates the container names by appending the pod name onto the container name. However we do not do this with pod names.
So it can be argued that we should just use the container name within the yaml file and stop appending the two. @umohnani8 @baude @vrothberg WDYT? |
Or, If pod_name == container_name: append pod_name to container_name? |
Yes that seems reasonable. |
i am onboard with that. Would this need to be a Podman 5 thing? |
I don't really see why. If we're really concerned, we can add a network alias for the previously-used name to ensure DNS does not break. |
I’m not advertising for the current behavior. But changing it would break
backwards compatibility. Unless there’s a reason other than preference, we
shouldn’t take the risk of breaking existing deployments.
…On Fri 18 Nov 2022 at 15:28, Matt Heon ***@***.***> wrote:
I don't really see why. If we're really concerned, we can add a network
alias for the previously-used name to ensure DNS does not break.
—
Reply to this email directly, view it on GitHub
<#16544 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZDRA7UNQFPWZN5IEXYRBTWI6G7ZANCNFSM6AAAAAASDZRK6Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Lets examine what could break If we name the container NAME and add an alias POD-NAME that should allow a container that assumed POD-NAME to work over DNS. You already need to do --replace when playing if the NAME container exists or the POD-NAME exists or the POD exists. |
CI would break which uses the current naming behavior by operating on the
containers by name. We cannot determine how many deployments rely on that
on the wild.
…On Fri 18 Nov 2022 at 20:41, Daniel J Walsh ***@***.***> wrote:
Lets examine what could break
If we name the container NAME and add an alias POD-NAME that should allow
a container that assumed POD-NAME to work over DNS.
You already need to do --replace when playing if the NAME container exists
or the POD-NAME exists or the POD exists.
—
Reply to this email directly, view it on GitHub
<#16544 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZDRA3YCFLHG6FF6XJQGWTWI7LVJANCNFSM6AAAAAASDZRK6Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@rhatdan @vrothberg @mheon I am planning on working on this during bug week, so wanted to see if we can come to a consensus on whether this change should happen or not. We could also add the container NAME as an alias to the existing POD-NAME and add a deprecation warning and switch it out in podman 5. |
I am against making a breaking change at this point - even aliasing can break existing deployments. We did not look up why the naming was done the way it is. I assume to namespace but I didn't look up commits/PRs etc. So I think we should do some research before deciding. Maybe this information is lacking in the docs and we can address the issue with a doc change? Switching it entirely for Podman 5 is not an option to me as it would break existing deployments (our CI, Ansible roles, unknown amount of users and customers) and we do not have an urgent reason to break (e.g., a severe security fix). |
I'm a little confused as to how adding an alias would break existing deployments... This is something that can happen in regular usage, apps should be ready to deal with it. |
An alias is an infinite resource. So running one YAML would occupy twice as many names with the second half having been "free" before. |
Or am I misreading/misinterpreting alias? |
Aliases are not exclusive. I can add an alias "db-ctr" to as many containers in the same network as I wish. If 2+ containers have the same alias, we load-balance between them. So while there are probably some odd configurations we will break, where a user aliased a different container with a name that is also used by another container, but that seems like a rare/contrived example to justify not adding an alias (which otherwise seems like an easy usability win). |
Oh that is nice. So +1 from my side on adding an alias to the kube-network 👍 Thanks for correcting, Matt! |
A friendly reminder that this issue had no activity for 30 days. |
@umohnani8 Please follow up on this one? |
A friendly reminder that this issue had no activity for 30 days. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Containers not named correctly inside pods. I am using this yaml file:
Steps to reproduce the issue:
Run yaml file with
podman kube play
Check container name inside pod with
podman pod ps --ctr-names
Describe the results you received:
Container name inside pod is
portainer-pod-portainer
Describe the results you expected:
I expect container name inside pod is
porainer
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? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: