azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az containerapp update - support for init containers

Open klemmchr opened this issue 2 years ago • 6 comments
trafficstars

Related command az containerapp update

Is your feature request related to a problem? Please describe. Currently we can update containers in an app by specifying --container-name. This does not work for init containers, instead it will create a new app container using the specified name.

Describe the solution you'd like Add the possibility to update an init container alongside with updating an app.

Additional context When creating a new deployment it is a common scenario to have a init container doing tasks like migrations. Ideally this init container have versioned labels to ensure consistency in deployment. This means that it is needed to update the image for both, the app and the init container at the same time.

klemmchr avatar Oct 07 '23 02:10 klemmchr

Thank you for opening this issue, we will look into it.

yonzhan avatar Oct 07 '23 02:10 yonzhan

any update on this?

brecht-vermeersch avatar Nov 08 '23 09:11 brecht-vermeersch

Any update on this?

arj-196 avatar Feb 20 '24 12:02 arj-196

I guess the workaround would be to use one off tasks instead of init containers: https://learn.microsoft.com/en-us/cli/azure/containerapp/job?view=azure-cli-latest#az-containerapp-job-create(containerapp)-examples

Ivaylo-Bachvarov avatar May 20 '24 19:05 Ivaylo-Bachvarov

I guess the workaround would be to use one off tasks instead of init containers: https://learn.microsoft.com/en-us/cli/azure/containerapp/job?view=azure-cli-latest#az-containerapp-job-create(containerapp)-examples

Exactly, this is what I do at the moment. Having a container app job with a manual trigger that is being executed using Azure CLI. Also has the benefit of dedicated identity which init containers are missing.

klemmchr avatar May 20 '24 20:05 klemmchr

Are there any plans to get this assigned to a milestone? We are making use of init containers for migrations, however our CD pipelines are having to jump through hoops to get them updated.

To work around this we're currently doing:

# fetch existing container app yaml definition
az container app show -o yaml

# update image + init container image(s) with yq, e.g.:
yq eval ...initContainers[0].image = initImage ...

# apply update
az containerapp update --yaml

This feels a lot more error-prone and harder to grok than a single command, and might start to fall down for more complex manipulations. We've also considered using CA jobs for migrations, but that is only suitable for some use cases and also comes with additional steps to monitor / tear down etc.

We're quite heavily invested in container apps at this stage, and this lack of tooling is making it harder for our teams to take real advantage of all the features via CD. If there are other methods/tooling we should be using in tandem with container apps to improve this experience then we're very open to them.

Tim-Hodge avatar Jun 26 '24 07:06 Tim-Hodge

We have run into this issue too. Revisions are fantastic but we're sorely lacking a clean solution to manage init-container updates

robovinnie avatar Aug 08 '24 04:08 robovinnie