简体   繁体   English

如何使用 K8s on demand (GKE) 部署工作负载?

[英]How to deploy workload with K8s on-demand (GKE)?

I need to deploy a GPU intensive task on GCP.我需要在 GCP 上部署 GPU 密集型任务。 I want to use a Node.js Docker image and within that container to run a Node.js server that listens to HTTP requests and runs a Python image processing script on-demand (every time that a new HTTP request is received containing the images to be processed).我想使用 Node.js Docker 映像并在该容器中运行一个 Node.js 服务器,该服务器侦听 HTTP 请求并按需运行 Python 图像处理脚本(每次收到包含图像的新 HTTP 请求时)处理)。 My understanding is that I need to deploy a load balancer in front of the K8s cluster that has a static public IP address which then builds/launches containers every time a new HTTP request comes in?我的理解是,我需要在具有静态公共 IP 地址的 K8s 集群前面部署一个负载均衡器,然后在每次新的 HTTP 请求进来时构建/启动容器? And then destroy the container once processing is completed.然后在处理完成后销毁容器。 Is container re-use not a concern?容器重复使用不是问题吗? I never worked with K8s before and I want to understand how it works and after reading the GKE documentation this is how I imagine the architecture.我以前从未使用过 K8s,我想了解它是如何工作的,在阅读 GKE 文档后,这就是我想象的架构。 What am I missing here?我在这里缺少什么?

runs a Python image processing script on-demand (every time that a new HTTP request is received containing the images to be processed)按需运行 Python 图像处理脚本(每次收到包含要处理的图像的新 HTTP 请求时)

This can be solved on Kubernetes, but it is not a very common kind of workload.可以在 Kubernetes 上解决,但它不是一种很常见的工作负载。

The project that support your problem best is Knative with its per-request auto-scaler.最能支持您的问题的项目是Knative ,它带有每个请求的自动缩放器。 Google Cloud Run is the easiest way to use this. Google Cloud Run是使用它的最简单方法。 But if you want to run this within your own GKE cluster, you can enable it .但是如果你想在你自己的 GKE 集群中运行它,你可以启用它

That said, you can also design your Node.js service to integrate with the Kubernetes API-server to create Jobs - but it is not a good design to have common workload talk to the API-server.也就是说,您可以将 Node.js 服务设计为与 Kubernetes API 服务器集成以创建 作业- 但让通用工作负载与 API 服务器通信并不是一个好的设计。 It is better to use Knative or Google Cloud Run.最好使用 Knative 或 Google Cloud Run。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM