Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Modules] Update Parameters to create a ContainerGroup with one or more containers #1868

Merged
merged 5 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "<<namePrefix>>-az-acg-x-001"
},
"lock": {
"value": "CanNotDelete"
},
"containers": {
"value": [
{
"name": "<<namePrefix>>-az-aci-x-001",
"properties": {
"command": [],
"image": "mcr.microsoft.com/azuredocs/aci-helloworld",
"ports": [
{
"protocol": "Tcp",
"port": "80"
},
{
"protocol": "Tcp",
"port": "443"
}
],
"resources": {
"requests": {
"cpu": 2,
"memoryInGB": 2
}
},
"environmentVariables": []
}
}
]
},
"ipAddressPorts": {
"value": [
{
"protocol": "Tcp",
"port": "80"
},
{
"protocol": "Tcp",
"port": "443"
}
]
},
"systemAssignedIdentity": {
"value": true
},
"userAssignedIdentities": {
"value": {
"/subscriptions/<<subscriptionId>>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<<namePrefix>>-az-msi-x-001": {}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,55 @@
"lock": {
"value": "CanNotDelete"
},
"containerName": {
"value": "<<namePrefix>>-az-aci-x-001"
},
"image": {
"value": "mcr.microsoft.com/azuredocs/aci-helloworld"
"containers": {
"value": [
{
"name": "<<namePrefix>>-az-aci-x-001",
"properties": {
"command": [],
"image": "mcr.microsoft.com/azuredocs/aci-helloworld",
"ports": [
{
"protocol": "Tcp",
"port": "80"
},
{
"protocol": "Tcp",
"port": "443"
}
],
"resources": {
"requests": {
"cpu": 2,
"memoryInGB": 2
}
},
"environmentVariables": []
}
},
{
"name": "<<namePrefix>>-az-aci-x-002",
"properties": {
"command": [],
"image": "mcr.microsoft.com/azuredocs/aci-helloworld",
"ports": [
{
"protocol": "Tcp",
"port": "8080"
}
],
"resources": {
"requests": {
"cpu": 2,
"memoryInGB": 2
}
},
"environmentVariables": []
}
}
]
},
"ports": {
"ipAddressPorts": {
"value": [
{
"protocol": "Tcp",
Expand All @@ -23,6 +65,10 @@
{
"protocol": "Tcp",
"port": "443"
},
{
"protocol": "Tcp",
"port": "8080"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
@description('Required. Name for the container group.')
param name string

@description('Required. Name for the container.')
param containername string
@description('Required. The containers and their respective config within the container group.')
param containers array

@description('Required. Name of the image.')
param image string

@description('Optional. Port to open on the container and the public IP address.')
param ports array = [
{
protocol: 'TCP'
port: '443'
}
]

@description('Optional. The number of CPU cores to allocate to the container.')
param cpuCores int = 2

@description('Optional. The amount of memory to allocate to the container in gigabytes.')
param memoryInGB int = 2
@description('Optional. Ports to open on the public IP address. Must include all ports assigned on container level.')
param ipAddressPorts array = []

@description('Optional. The operating system type required by the containers in the container group. - Windows or Linux.')
param osType string = 'Linux'
Expand All @@ -33,9 +19,6 @@ param ipAddressType string = 'Public'
@description('Optional. The image registry credentials by which the container group is created from.')
param imageRegistryCredentials array = []

@description('Optional. Environment variables of the container group.')
param environmentVariables array = []

@description('Optional. Location for all Resources.')
param location string = resourceGroup().location

Expand Down Expand Up @@ -84,29 +67,13 @@ resource containergroup 'Microsoft.ContainerInstance/containerGroups@2021-10-01'
identity: identity
tags: tags
properties: {
containers: [
{
name: containername
properties: {
command: []
image: image
ports: ports
resources: {
requests: {
cpu: cpuCores
memoryInGB: memoryInGB
}
}
environmentVariables: environmentVariables
}
}
]
containers: containers
imageRegistryCredentials: imageRegistryCredentials
restartPolicy: restartPolicy
osType: osType
ipAddress: {
type: ipAddressType
ports: ports
ports: ipAddressPorts
}
}
}
Expand Down
Loading