Autoscaling for Edgemicro?

Is it possible to 'autoscale' Edgemicro?

Please share your autoscaling methodology

Solved Solved
1 9 674
2 ACCEPTED SOLUTIONS

Hey @Mukundha Madhavan

I was trying to implement autoscaling for Edgemicro with Docker. I need a container management solution to completely implement this. The reason is that there are two commands that must be executed to start Edgemicro: (1) to start the agent and (2) to start Edgemicro.

I used a Docker file and I started the agent from a startup script, which executed when the container started and that kept the container "running." But then I needed to execute the command to start Edgemicro within the running container. I was not able to implement this within the Docker file. So I started reviewing Kubernetes and Docker Cloud to see if I could complete this with one of these solutions. I'm still working on it.

View solution in original post

Not applicable

Hi - i am going to need to do the work you did w/ docker (i havnt had time to yet...) but I do have a potential solution to your issue.

Have you considered using SYSTEMD inside docker to manage the process?

We have had great luck with systemd - as it will kick both processes off.. and kill them both... its super wonderful.

we are planning on making an app that allows generation of key/secrets for distribution. Right now we are just setting these as params in our app.

we have a script that gets the zip file, sets os settings, and generates a /home/<user>/.edgemicro/edgemicro.service file (1.1.2)

This file has all of the data one would need (endpoints, key, secret) set up.

We then dump a file in /etc/systemd/system/edgemicro.service w/ this data in it:

[Unit]
Description=Apigee Edge Micro Service

[Service]
WorkingDirectory=/opt/apigee-edge-micro/agent
ExecStart=/usr/local/bin/npm start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=apigee-edge-micro
User=cloud
Group=cloud
Environment='EDGEMICRO_KEY=mykey'
Environment='EDGEMICRO_SECRET=mysecret'

[Install]
WantedBy=multi-user.target

After which we can successfully run edgemicro with these two commands:

sudo systemctl enable edgemicro 
sudo systemctl start edgemicro

View solution in original post

9 REPLIES 9

Hey @Mukundha Madhavan

I was trying to implement autoscaling for Edgemicro with Docker. I need a container management solution to completely implement this. The reason is that there are two commands that must be executed to start Edgemicro: (1) to start the agent and (2) to start Edgemicro.

I used a Docker file and I started the agent from a startup script, which executed when the container started and that kept the container "running." But then I needed to execute the command to start Edgemicro within the running container. I was not able to implement this within the Docker file. So I started reviewing Kubernetes and Docker Cloud to see if I could complete this with one of these solutions. I'm still working on it.

Thanks @seanwilliams - have you looked at edgemicro 2.0, there is no agent

Thanks, I did not know that. The last version I used was 1.1.2. Version 2.0 makes the container implementation so much easier!

We will be blogging about how to run Microgateway 2.0 docker container this week. Stay tuned. It's lot easier now.

oh thanks.

Not applicable

Hi - i am going to need to do the work you did w/ docker (i havnt had time to yet...) but I do have a potential solution to your issue.

Have you considered using SYSTEMD inside docker to manage the process?

We have had great luck with systemd - as it will kick both processes off.. and kill them both... its super wonderful.

we are planning on making an app that allows generation of key/secrets for distribution. Right now we are just setting these as params in our app.

we have a script that gets the zip file, sets os settings, and generates a /home/<user>/.edgemicro/edgemicro.service file (1.1.2)

This file has all of the data one would need (endpoints, key, secret) set up.

We then dump a file in /etc/systemd/system/edgemicro.service w/ this data in it:

[Unit]
Description=Apigee Edge Micro Service

[Service]
WorkingDirectory=/opt/apigee-edge-micro/agent
ExecStart=/usr/local/bin/npm start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=apigee-edge-micro
User=cloud
Group=cloud
Environment='EDGEMICRO_KEY=mykey'
Environment='EDGEMICRO_SECRET=mysecret'

[Install]
WantedBy=multi-user.target

After which we can successfully run edgemicro with these two commands:

sudo systemctl enable edgemicro 
sudo systemctl start edgemicro

Super cool.

we will be updating our shell and puppet deploys to 2.0 in a week and a half. maybe we can share a "uncustomized" puppet module.

Not applicable

Here is the blog post on running Microgateway 2.0.0 in a Docker container!

http://apigee.com/about/blog/developer/running-apigee-edge-microgateway-docker-container