argo-workflows icon indicating copy to clipboard operation
argo-workflows copied to clipboard

Support for modifying container names during deployment

Open harshitasaxena05 opened this issue 2 years ago • 11 comments

Hi team,

Observed that, the below container names are used by default in argo for workflows. There should be a provision to change these names during deployment.

    MainContainerName = "main"
InitContainerName = "init"
WaitContainerName = "wait"

https://github.com/argoproj/argo-workflows/blob/12e1b985c176dee1ea8b70a81e3fe5e3a91bf241/workflow/common/common.go


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

harshitasaxena05 avatar Mar 30 '23 04:03 harshitasaxena05

Why do you want to do this? Can you explain your use case please.

Joibel avatar Mar 30 '23 07:03 Joibel

A small discussion on the topic with another user here: https://cloud-native.slack.com/archives/C01QW9QSSSK/p1679579113172899

They also didn't provide a usecase.

tico24 avatar Mar 30 '23 08:03 tico24

Use Case: Want to have provide user flexibility/control in terms of changing the container name during the deployment as per their needs.

harshitasaxena05 avatar Mar 30 '23 09:03 harshitasaxena05

That's not really a use case.

Can you extrapolate on the need to change this name? What problem does it cause by being fixed?

tico24 avatar Mar 30 '23 09:03 tico24

In case of multi cluster deployment, this will be helpful in differentiating multiple instances of the pod in different namespaces. From central monitoring of these pods perspective, it's also beneficial.

harshitasaxena05 avatar Mar 30 '23 10:03 harshitasaxena05

If you're using a multi cluster deployment, a sensible option would be to have the cluster name embedded in the logs/monitoring. Hacking pod names feels like the wrong solution here.

tico24 avatar Mar 30 '23 10:03 tico24

Thanks for your response. But we can't follow this approach as there are other dependencies. We have deployments across multiple clusters where 1000 pods will be deployed across clusters. Orchestrator can have multiple use cases which requires him to filter containers with some keyword prefixed. In order to support that, we need to provide flexibility to the orchestrator to add their own prefix to the containers during deployment.

harshitasaxena05 avatar Apr 03 '23 06:04 harshitasaxena05

When I run the Container type, the pod will have wait and main container. image

But when I run the Resources type, the name of the wait container is main. image

They are inconsistent.

felixjichao avatar Apr 26 '23 08:04 felixjichao

@felixjichao This feels unrelated to the enhancement request originally raised. Please raise a bug.

tico24 avatar Apr 26 '23 08:04 tico24

use case: we want to name different steps in the dag with different container names so that we can distinguish which is which in the logs.

DaraDadachanji avatar Apr 26 '23 22:04 DaraDadachanji

My use case is I would like to get metrics at container level despite of pod ownership. I'm not interested in metrics by pod with all sidecars.

bainos avatar Jan 18 '24 10:01 bainos