What is Azure Container Instances (ACI)?

Topics Covered

Overview

Azure Container Instances (ACI) is a managed PaaS (Platform as service) service in Microsoft Azure that enables you to deploy and operate containers on the Azure public cloud without the need for virtual machines (VMs). Azure Container Instances (ACI) supports both Linux and Windows containers. You don't need to build underlying infrastructure or use higher-level services to manage containers with Azure Container Instances. ACI provides fundamental features for managing a group of containers on a host computer. For advanced tasks such as coordinated upgrades, service discovery, and automated scaling, it supports the deployment of full container orchestrators such as Kubernetes.

Azure Container Instance Features

Azure Container Instance provides the following features:

  • Public IP connectivity: With a fully qualified domain name and an IP address, a developer can expose containers to the internet.
  • Secure and Isolated: ACI provides isolation between containers and secure network options, ensuring that your applications are protected.
  • Flexible Sizing: You can allocate specific amounts of CPU and memory resources to your containers based on your application's requirements.
  • Serverless Computing: ACI abstracts away the need to manage virtual machines (VMs) or infrastructure, allowing you to concentrate entirely on container deployment and operation.
  • Multiple OS Support: ACI supports both Linux and Windows containers, giving you flexibility in your container choice.
  • Container groups: Developers have the capability to schedule multiple containers to be deployed as a unified group, sharing common resources such as the same host machine, storage, and network. This feature is advantageous when a developer needs to divide a single functional task among several container images. For instance, a container group can consist of an application container alongside a logging or monitoring container.
  • Network Integration: ACI supports integration with Azure Virtual Networks, allowing you to control network access and communication.
  • Init Containers: ACI enables you to employ init containers to execute setup operations before the initialization of your main application container.
  • Pay-as-You-Go Pricing: ACI follows a pay-as-you-go pricing model, allowing you to pay only for the resources you use and reducing cost overhead.
  • Monitoring and Diagnostics: ACI has monitoring and diagnostics support, making it easy to troubleshoot issues and obtain insights into container activity.

Azure Container Instances and Container Orchestrators

When deploying containers on a large scale, it's a common practice to employ container orchestrators such as Kubernetes, Nomad, and Docker Swarm. These tools automate and oversee container interactions, as well as address tasks like resource allocation, networking, and storage management. While Azure Container Instances (ACI) offer essential container management features, it's important to note that ACI is not designed to function as a complete orchestration platform. It provides fundamental container management capabilities without the comprehensive orchestration features offered by tools like Kubernetes.

Traditional orchestrators vs. ACI orchestration

A complete orchestration platform is responsible for automating and managing various tasks, including container scheduling, affinity management, health monitoring, failover handling, auto-scaling, networking, service discovery, and application upgrades and rollbacks.

Azure Container Instances (ACI) follows a layered approach by taking care of all the essential management functions required to operate a single container. On top of these foundational capabilities, orchestrators can oversee multiple container activities.

The orchestrator does not need to worry about finding an appropriate host to execute a single container because Azure maintains the container instance's infrastructure. The cloud's elasticity ensures that hosts are constantly available. Instead, the orchestrator can concentrate on simplifying multi-container activities like scalability, high availability, and upgrades.

Building an Azure container

  1. To create an Azure container instance, firstly log in to the Azure portal with valid Azure login credentials.
  2. Now, search for the Container Instance in the search bar and hit enter. container instance
  3. Click on Create to create a new container instance. new container instance
  4. Fill in and update the details as per your desired requirements, and then click on Review and Create. create container instance
  5. Now finally, click on Create. review and create container instance
  6. Now your container deployment is completed successfully. container deployment

Reviewing a Microsoft tutorial on Azure Container Instances (ACI) is beneficial for understanding the process. After ACI has created the container, a container orchestrator, such as Kubernetes or Docker, takes over the task of provisioning the necessary resources, including application programming interfaces and files. The orchestrator is capable of handling both individual containers as well as groups of multiple containers, streamlining the management of your containerized applications.

When to Use ACI?

Azure Container Instances (ACI) is a versatile service that may be used for a variety of tasks. Here are some situations in which you might wish to consider utilizing ACI:

  • Rapid Development and Testing: ACI enables swift container deployment without the complexities of infrastructure management. It's perfect for agile development and testing environments, facilitating quick iterations and experimentation.
  • Workload Scaling: ACI offers the ability to instantly scale up or down in response to varying workload demands. This makes it valuable for handling peak traffic periods or sudden workload surges, allowing your containerized applications to expand without lengthy resource commitments.
  • Task and Batch Execution: ACI is an excellent choice for running individual tasks or batch jobs without the overhead of managing a full-fledged container orchestration platform. It simplifies the execution of one-time tasks, scheduled jobs, or data processing work.
  • Microservices Deployment: ACI can effectively deploy and manage individual microservices that require isolation and independent scaling. It empowers you to operate distinct microservices as separate container groups, granting fine-grained control over their resource allocation and lifecycles.
  • Event-Driven Workloads: ACI seamlessly integrates with various event-driven architectures and serverless computing models. It can serve as the execution environment for event-driven functions or function as a component within a serverless framework, allowing you to respond to events and triggers using container-based workloads.

Cost, availability, and competition

Azure Container Instances follows a billing model that charges per second, with pricing dependent on the CPU and memory resources utilized by individual containers or container groups.

As of 2023, Azure Container Instances can be accessed in the following Azure public cloud regions: Canada Central, Canada East, Central U.S., East U.S., East U.S. 2, East U.S. 3, North Central U.S., South Central U.S., West Central U.S., West U.S., West U.S. 2 and West U.S. 3.

ACI's main competitor is Amazon Web Services Fargate.

Benefits of containers

Containers offer an efficient solution for medium to large organizations to develop and deploy applications as self-contained units. These containers, along with an embedded operating system, function without the need for server virtual machines (VMs) to handle management tasks. They encapsulate all the necessary code for deploying an application.

Containers possess remarkable portability, allowing developers to create applications in one environment and effortlessly transition them to a different environment, including cloud services.

A single container has the capacity to support multiple applications running independently or in cooperation. Within containers, you'll find all the essential components, including files, databases, and libraries. Thanks to their self-contained operating environment, containers can execute workloads without relying on resources from the underlying platform.

ACI vs AKS

aci vs aks

Price

Azure Container Instances (ACI) charges are calculated based on the runtime of container groups, and the pricing depends on the allocated vCPUs and memory resources. For example, in the Central US region, Linux VMs are priced at 0.0000135 dollars per vCPU per second and 0.0000015 dollars per GB of RAM per second. If a container group utilizes 10 vCPUs and 100 GB of RAM, the memory resources would cost $0.009 per hour, and the vCPUs would cost 0.0081 dollars per hour, resulting in a total cost of 0.0171 dollars per hour.

In contrast, Azure Kubernetes Service (AKS) does not impose any additional charges for managing your Kubernetes environment. Billing is primarily based on the VMs running your worker nodes, as well as the associated storage and networking resources utilized by your clusters. The expenses are aligned with running equivalent VMs without AKS. To accurately estimate costs, factors like VM type, the number of required nodes, and their operational duration need to be taken into account. For the most current pricing details regarding Azure VMs, it is recommended to consult Azure's official documentation.

Security

ACI uses Azure Virtual Networks, which provides a secure networking environment for Azure resources and workloads that are located on-premises. When container groups are deployed within Virtual Networks, ACI facilitates secure communication between ACI containers and various entities. This includes interactions with other container groups in the same subnet, databases residing in the same Virtual Network, and on-premises resources accessible through a VPN gateway or ExpressRoute.

On the other hand, AKS grants access to the robust security features inherent in native Kubernetes, enhanced by Azure's capabilities such as network security groups and orchestrated cluster upgrades. Keeping software components up-to-date is crucial for maintaining security, and AKS automates the process of ensuring that clusters consistently run the latest versions of operating systems and Kubernetes, inclusive of necessary security patches. Additionally, AKS places a strong emphasis on securing sensitive credentials and maintaining secure traffic within pods to ensure protected access to these valuable resources.

Scalability

ACI utilizes container groups to streamline the scaling process, allowing multiple containers to function on the same host while sharing resources, networks, and storage volumes. This arrangement is analogous to a Kubernetes pod, where containers within the group operate with synchronized lifecycles.

On the other hand, AKS relies on Kubernetes for its scaling capabilities. Users have the option to manually scale their AKS pods or take advantage of horizontal pod autoscaling (HPA), a feature that automatically modifies the number of pods in a deployment in response to metrics such as CPU utilization or other user-defined criteria.

Conclusion

  • Azure Container Instances (ACI) is a managed ****PaaS (Platform as service) service in Microsoft Azure that enables you to deploy and operate containers on the Azure public cloud without the need for virtual machines (VMs).
  • Azure Container Instances (ACI) supports both Linux and Windows containers.
  • You can allocate specific amounts of CPU and memory resources to your containers based on your application's requirements.
  • ACI pricing depends on vCPUs and memory, while AKS aligns with VMs; ACI ensures security via Virtual Networks, while AKS leverages Kubernetes security and automated updates, with ACI using container groups and AKS relying on Kubernetes for scaling.