在 Azure 云上编排按需作业
Orchestration of on-demand jobs on Azure cloud
我面临以下问题:我需要在 Azure VM 上执行按需长期 运行ning worker。这些工人被包裹在 docker 图像中。
所以我查看了 Azure 提供的产品,我似乎有以下两个选择:
使用具有 docker-compose 的虚拟机。这意味着我需要能够以编程方式启动 VM,运行 上面的 docker 图像,然后关闭 VM(我们使用的规格非常昂贵,我们不能让它 运行无限期)。然而,这意味着我们自己编写编排逻辑。有没有我们可以用来让生活更轻松的服务?
正在设置 k8s 集群。但是,我不确定这里的定价是如何运作的。我可以将我们使用的虚拟机类型添加到集群中,然后使用 k8s API 启动按需容器吗?在这种情况下我将如何定价?
如果您只需要工人,那么您还有更多选择。哪种服务最适合取决于您的要求。根据您的问题,我认为以下两个之一可能最合适:
Azure 容器实例
Azure Container Instances offers the fastest and simplest way to run a container in Azure, without having to manage any virtual machines and without having to adopt a higher-level service.
Azure Container Instances is a great solution for any scenario that can operate in isolated containers, including simple applications, task automation, and build jobs.
Azure 容器应用程序(预览版)
Azure Container Apps enables you to run microservices and containerized applications on a serverless platform. Common uses of Azure Container Apps include:
- Deploying API endpoints
- Hosting background processing applications
- Handling event-driven processing
- Running microservices
根据 Azure 的 Container services 页面,您可以选择以下选项:
IF YOU WANT TO
USE THIS
Deploy and scale containers on managed Kubernetes
Azure Kubernetes Service (AKS)
Deploy and scale containers on managed Red Hat OpenShift
Azure Red Hat OpenShift
Build and deploy modern apps and microservices using serverless containers
Azure Container Apps
Execute event-driven, serverless code with an end-to-end development experience
Azure Functions
Run containerized web apps on Windows and Linux
Web App for Containers
Launch containers with hypervisor isolation
Azure Container Instances
Deploy and operate always-on, scalable, distributed apps
Azure Service Fabric
Build, store, secure, and replicate container images and artifacts Azure
Container Registry
编辑:
根据评论
Let's say the only requirement is that I am able to use the resources on-demand, so I only end up spending the amount of money that would take for a certain job to finish execution. What would you use?
如果您拥有的代码不容易迁移到 Azure Functions,答案很可能是容器应用程序。最重要的原因:它们是无服务器的,这意味着它们可以扩展到零,您只需为实际消费付费。除此之外,您必须编写仅限于无编排逻辑,因为容器应用程序可以根据事件源进行扩展。
Enables event-driven application architectures by supporting scale based on traffic and pulling from event sources like queues, including scale to zero.
另一个很好的资源是 Comparing Container Apps with other Azure container options。
我面临以下问题:我需要在 Azure VM 上执行按需长期 运行ning worker。这些工人被包裹在 docker 图像中。
所以我查看了 Azure 提供的产品,我似乎有以下两个选择:
使用具有 docker-compose 的虚拟机。这意味着我需要能够以编程方式启动 VM,运行 上面的 docker 图像,然后关闭 VM(我们使用的规格非常昂贵,我们不能让它 运行无限期)。然而,这意味着我们自己编写编排逻辑。有没有我们可以用来让生活更轻松的服务?
正在设置 k8s 集群。但是,我不确定这里的定价是如何运作的。我可以将我们使用的虚拟机类型添加到集群中,然后使用 k8s API 启动按需容器吗?在这种情况下我将如何定价?
如果您只需要工人,那么您还有更多选择。哪种服务最适合取决于您的要求。根据您的问题,我认为以下两个之一可能最合适:
Azure 容器实例
Azure Container Instances offers the fastest and simplest way to run a container in Azure, without having to manage any virtual machines and without having to adopt a higher-level service.
Azure Container Instances is a great solution for any scenario that can operate in isolated containers, including simple applications, task automation, and build jobs.
Azure 容器应用程序(预览版)
Azure Container Apps enables you to run microservices and containerized applications on a serverless platform. Common uses of Azure Container Apps include:
- Deploying API endpoints
- Hosting background processing applications
- Handling event-driven processing
- Running microservices
根据 Azure 的 Container services 页面,您可以选择以下选项:
IF YOU WANT TO | USE THIS |
---|---|
Deploy and scale containers on managed Kubernetes | Azure Kubernetes Service (AKS) |
Deploy and scale containers on managed Red Hat OpenShift | Azure Red Hat OpenShift |
Build and deploy modern apps and microservices using serverless containers | Azure Container Apps |
Execute event-driven, serverless code with an end-to-end development experience | Azure Functions |
Run containerized web apps on Windows and Linux | Web App for Containers |
Launch containers with hypervisor isolation | Azure Container Instances |
Deploy and operate always-on, scalable, distributed apps | Azure Service Fabric |
Build, store, secure, and replicate container images and artifacts Azure | Container Registry |
编辑:
根据评论
Let's say the only requirement is that I am able to use the resources on-demand, so I only end up spending the amount of money that would take for a certain job to finish execution. What would you use?
如果您拥有的代码不容易迁移到 Azure Functions,答案很可能是容器应用程序。最重要的原因:它们是无服务器的,这意味着它们可以扩展到零,您只需为实际消费付费。除此之外,您必须编写仅限于无编排逻辑,因为容器应用程序可以根据事件源进行扩展。
Enables event-driven application architectures by supporting scale based on traffic and pulling from event sources like queues, including scale to zero.
另一个很好的资源是 Comparing Container Apps with other Azure container options。