micro icon indicating copy to clipboard operation
micro copied to clipboard

How to run in production?

Open pavel-d opened this issue 2 years ago • 6 comments

Hi @asim, I was going to give the framework a try and deploy few simple services to my own dev k8s cluster, but it I can't seem to find any instructions/recommendation on how to do that (neither on Github nor on https://micro.dev). I saw some mentions of k8s runtime but nothing specific in docs.

I'd appreciate if you could point me to the right direction.

pavel-d avatar Jan 21 '23 18:01 pavel-d

There's currently no good deployment doc for kubernetes. There used to be a helm chart but it was deprecated. We have an image that will run on k8s and use it for M3O.com but no guides at this point. You can find the pulumi code in github.com/M3O/M3O. There an image in cmd/micro-platform in this repo.

asim avatar Jan 21 '23 18:01 asim

Thanks for the quick reply. Is there any guidance how to deploy it on prod without k8s then? I'm trying to do something simple:

  • Create service foo and bar
  • Scale service foo to X instances, service bar to Y instances
  • Make sure that services are started after server reboots

It's not clear how to do that via micro server. I've also tried to compile service as a separate binary, but it's not clear how to run it (it just returns Internal Server Error on start)

pavel-d avatar Jan 21 '23 19:01 pavel-d

You can deploy it on digitalocean using this 1-click deployment here. Services should be started back up after micro starts again. There's no instance scaling unless you're running on k8s.

asim avatar Jan 21 '23 19:01 asim

So you are saying that if I start a kubernetes job with an image pulled from dockerhub (micro/micro) there might be some issues while deploying?

I have successfully deployed the microservices but am unable to login to the micro server. I get "Invalid token provided", could it be the wrong image?

incognito-bob avatar Jan 22 '23 20:01 incognito-bob

The docker image on dockerhub is no longer updated. See the readme for GitHub for where the image is now. In all honesty I stopped trying to deploy micro to kubernetes long ago. We'd need new instructions to deploy the platform image which depends on etcd, redis, postgres and other things. The only way we'd get on kubernetes again otherwise is by some simpler version of Micro.

asim avatar Jan 23 '23 06:01 asim

@asim, @pavel-d made really good question. As a person who did not use micro before on production it's really hard to make it stratight to point. I am still strugling how to run it on production server correctly.

felixd avatar Feb 25 '23 13:02 felixd

Point noted, will think about it for the future

asim avatar Jul 12 '24 19:07 asim