If the second container communicated successfully with the first, output is similar to: Connecting to 10.0.0.4 (10.0.0.4:80) command-line "wget $CONTAINER_GROUP_IP" \Īfter this second container deployment has completed, pull its logs so you can see the output of the wget command it executed: az container logs -resource-group myResourceGroup -name commchecker This second container, commchecker, runs an Alpine Linux-based image and executes wget against the first container group's private subnet IP address. Now, set CONTAINER_GROUP_IP to the IP you retrieved with the az container show command, and execute the following az container create command. The output displays the IP address of the container group in the private subnet. The following example deploys a second container group to the same subnet created previously, and verifies communication between the two container instances.įirst, get the IP address of the first container group you deployed, the appcontainer: az container show -resource-group myResourceGroup \ Network profile name or ID, which you can obtain using az network profile list.Virtual network resource ID and subnet resource ID, which allows using a virtual network from a different resource group. Deploy a container group with az container create and specify one of the following:.Create a subnet within your existing virtual network, use an existing subnet in which a container group is already deployed, or use an existing subnet emptied of all other resources and configuration.To deploy a container group to an existing virtual network: After the initial deployment, additional container group deployments to the same subnet complete more quickly. When you deploy to a new virtual network by using this method, the deployment can take a few minutes while the network resources are created. In the next section, you'll deploy a second container group to the same subnet, and test communication between the two container instances. This command deploys the public Microsoft aci-helloworld container that runs a small Node.js webserver serving a static web page. Provide the name of a resource group that was created in a region where container group deployments in a virtual network are available. The following az container create command specifies settings for a new virtual network and subnet. Because Azure delegates the subnet to Azure Container Instances, you can deploy only container groups to the subnet. Once you've deployed your first container group with this method, you can deploy to the same subnet by specifying the virtual network and subnet names, or the network profile that Azure automatically creates for you. For more information about working with subnets, see Add, change, or delete a virtual network subnet. These values are represented in Classless Inter-Domain Routing (CIDR) notation, for example 10.0.0.0/16. The virtual network and subnet address prefixes specify the address spaces for the virtual network and subnet, respectively.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |