[英]If I have a React frontend and a microservices backend, can I have two deployment targets (S3 for frontend, EKS for backend)?
Having built a static frontend, my thought was to deploy this to a static assets server like S3, while deploying my microservices backend using kubernetes to a compute service like EC2 or EKS.构建了 static 前端后,我的想法是将其部署到 static 资产服务器(如 S3),同时使用 kubernetes 将我的微服务后端部署到计算服务(如 EC2 或 EKS.
However, my research has only turned up one approach: building the frontend as a service in my kubernetes cluster.然而,我的研究只发现了一种方法:在我的 kubernetes 集群中构建前端作为服务。
My questions:我的问题:
For additional context, my frontend is a React app built through create-react-app, and I've already extracted by production build.对于其他上下文,我的前端是通过 create-react-app 构建的 React 应用程序,并且我已经通过生产构建提取了。 My backend comprises of several NodeJS microservices.我的后端包含几个 NodeJS 微服务。
Is it possible to have two deployment targets like my thought above?是否有可能像我上面的想法一样有两个部署目标?
Yes, it is possible.对的,这是可能的。
If possible, what are the pros/cons to doing so (in particular, will communication between frontend & backend be tricky?)如果可能的话,这样做的利弊是什么(特别是前端和后端之间的通信会很棘手吗?)
In the case of a static frontend, the browser (client) talks to the backend, as long as the user is able to communicate with the backend, everything should be fine.在 static 前端的情况下,浏览器(客户端)与后端通信,只要用户能够与后端通信,一切都应该没问题。
Are there any other deployment approaches to consider besides these two?除了这两种之外,还有其他需要考虑的部署方法吗?
You can deploy your frontend anywhere, you can check out other options like https://www.netlify.com/ and https://vercel.com/您可以在任何地方部署您的前端,您可以查看其他选项,例如https://www.netlify.com/和https://vercel.com/
This article should give you a better understanding of Kubernetes with similar architecture https://www.freecodecamp.org/news/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-orchestrating-containers-114ff420e882/这篇文章应该可以让你更好地了解 Kubernetes 架构类似https://www.freecodecamp.org/news/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-420A1C4B6A7110B50D807BADE5Z /
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.