Skip to main content

Container Management Overview

Multi-Cloud Manager provides unified container management across Azure Container Instances (ACI) and Google Cloud Platform Cloud Run. Deploy, monitor, and manage containerized applications with consistent APIs and interfaces.

Supported Platforms

Azure Container Instances

Deploy and manage Linux containers on Azure with public IP addresses and custom resource configurations

GCP Cloud Run

Serverless container platform with automatic scaling and built-in load balancing

Key Features

Container Lifecycle Management

  • Create containers with custom resource allocations (CPU, memory)
  • List all containers across subscriptions and projects
  • Restart running containers
  • Delete containers and cleanup resources

Multi-Registry Support

  • Public container registries (Docker Hub, GCR, etc.)
  • Private registries with authentication
  • Azure Container Registry integration
  • Google Artifact Registry support

Network Configuration

  • Public IP addresses with port mapping
  • Custom port configurations
  • TCP/UDP protocol support
  • Ingress traffic control

Resource Management

  • CPU allocation (cores)
  • Memory limits (GB)
  • Instance count control
  • Auto-scaling policies (GCP Cloud Run)

Container Operations

Azure Container Instances

from azure.mgmt.containerinstance import ContainerInstanceManagementClient
from azure.mgmt.containerinstance.models import (
    ContainerGroup,
    Container,
    ResourceRequests,
    ResourceRequirements,
    OperatingSystemTypes,
    IpAddress,
    Port,
    ContainerPort,
    ContainerGroupNetworkProtocol
)

# Create container instance
container_resource_requests = ResourceRequests(cpu=1.0, memory_in_gb=1.5)
container_resource_requirements = ResourceRequirements(
    requests=container_resource_requests
)

container = Container(
    name="my-container",
    image="nginx:latest",
    resources=container_resource_requirements,
    ports=[ContainerPort(port=80)]
)

ip_address = IpAddress(
    ports=[Port(protocol=ContainerGroupNetworkProtocol.TCP, port=80)],
    type="Public"
)

group = ContainerGroup(
    location="westeurope",
    containers=[container],
    os_type=OperatingSystemTypes.LINUX,
    restart_policy="Always",
    ip_address=ip_address
)

GCP Cloud Run

from google.cloud import run_v2

# Create Cloud Run service
service_config = run_v2.Service(
    template=run_v2.RevisionTemplate(
        containers=[
            run_v2.Container(
                image="us-docker.pkg.dev/cloudrun/container/hello",
                ports=[run_v2.ContainerPort(container_port=8080)],
            )
        ],
        scaling=run_v2.RevisionScaling(
            min_instance_count=0,
            max_instance_count=1
        ),
    ),
    ingress=run_v2.IngressTraffic.INGRESS_TRAFFIC_ALL
)

Monitoring and Observability

Comprehensive monitoring capabilities are available for both platforms:

Container Monitoring

Real-time metrics, log analytics, and performance tracking

Alerts

Configure alerts for CPU, memory, request latency, and custom metrics

Available Metrics

Azure Container Instances:
  • CPU Usage
  • Memory Usage
  • Container state and status
GCP Cloud Run:
  • Request count
  • Request latencies (P95)
  • Instance count
  • CPU and memory utilization

Authentication

All container operations require proper authentication:
  • Azure: OAuth 2.0 access token in session
  • GCP: OAuth 2.0 refresh token with Cloud Run API enabled
Ensure that the service principal (Azure) or service account (GCP) has the appropriate IAM roles:
  • Azure: Contributor or Container Instances Contributor
  • GCP: Cloud Run Admin or Cloud Run Developer

API Endpoints

Azure Container Instances

OperationEndpointMethod
List containers/api/azure/containersGET
Create container/api/azure/containersPOST
Restart container/api/azure/containers/restartPOST
Delete container/api/azure/containersDELETE

GCP Cloud Run

OperationEndpointMethod
List services/api/gcp/containersGET
Create service/api/gcp/containersPOST
Delete service/api/gcp/containersDELETE

Next Steps

Azure Containers

Learn about Azure Container Instances management

GCP Containers

Explore GCP Cloud Run deployment options

Monitoring

Set up container monitoring and log analytics

Alerts

Configure alerting for container metrics

Build docs developers (and LLMs) love