Azure / Azure/azure-libraries-for-java

Does not seem possible to Create a ContainerGroup with multiple Container Instances

Open
#661 0 comments 0 reactions 0 assignees View on GitHub
Container Instances
Dominant language
Java
Stars
97
Forks
102
PR merge metrics
No merged PRs in 30d

Description

The current Fluent API works well if you know ahead of time what containers so you can hard code the deployment.

I am trying to do:

var containerGroup = azure.containerGroups().define(groupName)
.withRegion(region)
.withExistingResourceGroup(resourceGroupName)
.withLinux()
.withPrivateImageRegistry(registryAddress, username, password)
.withoutVolume()

requests.forEach {
val thing = containerGroup.defineContainerInstance(it.instanceName)
.withImage(it.remoteImageName)
.withExternalTcpPorts(*it.portsToOpen.toIntArray())
.withEnvironmentVariables(it.env)
.attach().withRestartPolicy(ContainerGroupRestartPolicy.ON_FAILURE)
.withDnsPrefix("${it.instanceName}-$networkName")
}

where a loop will add a container instance to the group.

This does not seem possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.