简体   繁体   English

用于微服务应用程序的kubernetes架构-建议

[英]kubernetes architecture for microservices application - suggestions

I have been asked to create a system which has different functionalities. 我被要求创建一个具有不同功能的系统。 Assume service 1, service 2 and service 3. I need to run these services per hour to do something. 假定服务1,服务2和服务3。我需要每小时运行这些服务以执行某些操作。 To make the system of those services I need: database, web interface for seeing the result of the process, caching and etc. This is what I have thought about so far: 为了使这些服务成为系统,我需要:数据库,用于查看处理结果的Web界面,缓存等。到目前为止,这是我一直在想的事情:

  • I need kubernetes to orchestrate my services which are packaged as docker containers. 我需要Kubernetes来整理打包为Docker容器的服务。 I will deploy mySql to save my data and I can use Redis cache for caching. 我将部署mySql保存数据,并且可以使用Redis缓存进行缓存。

  • My service are written by python scripts and Java and need to interact with each other through APIs. 我的服务由python脚本和Java编写,并且需要通过API相互交互。

  • I think I can use AWS EKS for my kubernetes cluster 我认为我可以对Kubernetes集群使用AWS EKS


this is what I need to know: 这是我需要知道的:

  • how to deploy python or Java applications and connect them to each other and also connect them to a database service 如何部署python或Java应用程序并将它们彼此连接以及将它们连接到数据库服务
  • I also need to know how to schedule the application to run per hour so I can see the results in the web interface. 我还需要知道如何安排应用程序每小时运行一次,以便可以在Web界面中查看结果。

Please shoot any ideas or questions you have . 请提出您的任何想法或问题

Any help would be appreciated. 任何帮助,将不胜感激。

For python/java applications, create docker images for both applications. 对于python / java应用程序,为两个应用程序创建docker映像。 If these application run forever to serve traffic then deploy them as deployments .If you need to have only cron like functionality, deploy as Job in kubernetes. 如果这些应用程序永远运行以提供流量,则将它们作为deployments 。如果只需要具有cron之类的功能,则在kubernetes中作为Job进行部署。

To make services accessible, create services as selector for applications, so these services can route traffic to specific applications. 为了使服务可访问,请创建服务作为应用程序的selector ,以便这些服务可以将流量路由到特定的应用程序。

Database or cache should be exposed as service endpoints so your applications are environment independent. 数据库或缓存应作为service endpoints公开,因此您的应用程序与环境无关。

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

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