farmer icon indicating copy to clipboard operation
farmer copied to clipboard

Allocate resources automatically to containers in a container app

Open isaacabraham opened this issue 3 years ago • 2 comments

The changes in this PR are as follows:

  • Adds support for allocating resources to a container app and equally sharing across all containers.

I have read the contributing guidelines and have completed the following:

  • [x] Tested my code end-to-end against a live Azure subscription.
  • [x] Updated the documentation in the docs folder for the affected changes.
  • [x] Written unit tests against the modified code that I have made.
  • [x] Updated the release notes with a new entry for this PR.
  • [x] Checked the coding standards outlined in the contributions guide and ensured my code adheres to them.

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

containerEnvironment {
    add_containers [
        containerApp {
            allocate_resources ResourceLevels.``CPUs = 1.75, RAM = 3.5`` // resources shared equally between containers.
            add_containers [
                container {
                    name "aspnetsample"
                    public_docker_image "mcr.microsoft.com/dotnet/samples" "aspnetapp"
                }
                container {
                    name "queuereaderapp"
                    public_docker_image "mcr.microsoft.com/azuredocs/containerapps-queuereader" null
                }
            ]
        }
    ]
}

isaacabraham avatar Dec 21 '21 12:12 isaacabraham

@isaacabraham is it worth merging and shipping this one and iterating on it to come up with more allocation strategies?

ninjarobot avatar Jan 14 '22 11:01 ninjarobot

@isaacabraham attempted to merge master into this pull request. Need some input on the addition of EphemeralStorage the has been added to Builders.ContainerApp.fs

martinbryant avatar Aug 18 '23 11:08 martinbryant