Skip to content
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

[QUERY] How can I set the resource limit property for a container instance using the fluent SDK? #1319

Open
2 tasks done
paynecrl97 opened this issue Jun 10, 2022 · 1 comment

Comments

@paynecrl97
Copy link

Query/Question
How can I set the resource limit property for a container instance using the fluent SDK?

According to the docs, I should be able to set an optional resource limit property when allocating resources to container instances within a container group, as well as setting the mandatory resource request property.

However, the only methods to define resources that I can find the fluent SDK areWithCpuCoreCount() and WithMemorySizeInGB(). I assume that these methods set the resource request property (because this property is mandatory). I can't find an equivalent method (or an overload) to set the resource limit property. e.g.

                IContainerGroup containerGroup = azure.ContainerGroups.Define(aciName)
                    .WithRegion(region)
                    .WithNewResourceGroup(rgName)
                    .WithLinux()
                    .WithPublicImageRegistryOnly()
                    .WithoutVolume()
                    .DefineContainerInstance(aciName + "-1")
                        .WithImage(containerImageName1)
                        .WithExternalTcpPort(80)
                        .WithCpuCoreCount(.5)
                        .WithCpuCoreCountLimit(1) // Something like this
                        .WithMemorySizeInGB(1)
                        .Attach()
                    .DefineContainerInstance(aciName + "-2")
                        .WithImage(containerImageName2)
                        .WithoutPorts()
                        .WithCpuCoreCount(request: .5, limit: 1) // Or maybe like this
                        .WithMemorySizeInGB(1)
                        .Attach()
                    .WithRestartPolicy(ContainerGroupRestartPolicy.Never)
                    .WithDnsPrefix(aciName)
                    .Create();

Why is this not a Bug or a feature Request?
This might be a feature request, but I'm hoping this is already possible and I've overlooked something.

Setup (please complete the following information if applicable):

  • OS: Windows
  • IDE : Visual Studio
  • Microsoft.Azure.Management.ContainerInstance.Fluent v1.38.1

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added
@weidongxu-microsoft
Copy link
Member

Please plan to migrate to https://aka.ms/azsdk/dotnet/mgmt (ACI should release soon)

This lib is in maintenance, and new feature will not be added to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants