0

部署 azure 容器组(“Microsoft.ContainerInstance/containerGroups”)时,以后可以只替换其中一个容器吗?

或者 container_group 的创建是否必须在创建(容器组的)时拥有所有容器?

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-multi-container-group

  "resources": [
    {
      "name": "[parameters('resourceGroupName')]",
      "type": "Microsoft.ContainerInstance/containerGroups",
      "apiVersion": "2018-06-01",
      "location": "[resourceGroup().location]",
      "properties": {
        "containers": [
          {
            "name": "[parameters('loggingContainerName')]",
            "properties": {
              "image": "[parameters('loggingContainerImage')]",
              "resources": {
                "requests": {
                  "cpu": 1,
                  "memoryInGb": 1
                }
              },
              "volumeMounts": [
                {
                  "name": "[parameters('volumeName')]",
                  "mountPath": "/aci/logs/"
                }
              ],
              "ports": [
                {
                  "port": 8080
                }
              ]
            }
          },
          {
            "name": "[parameters('jobGeneratorContainerName')]",
            "properties": {
              "image": "[parameters('jobGeneratorContainerImage')]",
              "resources": {
                "requests": {
                  "cpu": 1,
                  "memoryInGb": 1
                }
              },
              "ports": [
                {
                  "port": 80
                }
              ],
              "volumeMounts": [
                {
                  "name": "[parameters('volumeName')]",
                  "mountPath": "/aci/logs/"
                }
              ],
              "environmentVariables": [
                {
                  "name": "ServiceBusConnectionString",
                  "value": "[parameters('serviceBusConnectionStringSend')]"
                },
                {
                  "name": "LoggingServiceUrl",
                  "value": "[parameters('loggingServiceUrl')]"
                }
              ]
            }
          },
          {
            "name": "[parameters('jobProcessingContainerName')]",
            "properties": {
              "image": "[parameters('jobProcessingContainerImage')]",
              "resources": {
                "requests": {
                  "cpu": 1,
                  "memoryInGb": 1
                }
              },
              "ports": [
                {
                  "port": 8000
                }
              ],
              "environmentVariables": [
                {
                  "name": "ServiceBusConnectionString",
                  "value": "[parameters('serviceBusConnectionStringListen')]"
                },
                {
                  "name": "LoggingServiceUrl",
                  "value": "[parameters('loggingServiceUrl')]"
                }
              ]
            }
          }
        ],
        "osType": "Linux",
        "ipAddress": {
          "type": "Public",
          "ports": [
            {
              "protocol": "tcp",
              "port": "80"
            },
            {
              "protocol": "TCP",
              "port": 443
            }
          ],
          "dnsNameLabel": "[uniqueString( resourceGroup().id )]"
        },
4

1 回答 1

1

据我所知,你说的是对的。Azure 容器实例的顶层是容器组。无论您想在一个容器组中创建一个或多个容器实例,您都应该一次创建一个或多个容器实例。

如果创建了容器组,则无法对其进行更改,例如添加容器或更改容器镜像。如果你真的想要,你可以创建一个新的。

顺便说一下,多容器组只支持 Linux 容器。

于 2018-08-06T08:19:13.163 回答