简体   繁体   中英

how to deploy playframework with mongodb on kubernetes

I want to deploy our project built with nginx, playframework,and mongodb etc. to Kubernetes.

However, i couldn't find any tutorials on internet how to do that. Could anyone advise where i can find the steps to integrate playframework, nginx and mongodb on Kubernetes?

In my project i use DockerPlugin to create docker images and to push them to AWS registry (ECR). So every time i want to update a backend image i run sbt and it pushes a new version to docker repository.

To work with mongo i use morphia , it's not reactive, but easy to use. If performance is very important for you i would recommend you to use async driver, but the code will be less easy to read. Here you can see example of how to add morphia to play!.

Once you have your play project built and stored as docker image you can deploy it to kubernetes, for that you will need provide a deployment and service . In service you should open just default port 9000 to your play deployment.

Next step is to deploy nginx, just use standard image from here . Actually, you can use ingress instead, it will wrap nginx version which is more kuberenetess friendly. Once you have nginx you need to add there a route, from port 80 or 443 to your play server to port 9000.

This is very high level description, hope it helps. I don't post here build.sbt, deployment, services and nginx configuration files since they are very long.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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