Installation of Edge Micro on Amazon ECS

First, prepare the Apigee Edge.

1) Node.js installed (updated with the command \> npm i npm to update)

2) Apigee edgeMicro gateway installed (\> npm install edgemicro -g)

3) The configuration repository is located at (.edgemicro \ default.yaml)

4) Edgemicro started (\> edgemicro init)

5) Configuring edgeMicro (\> edgemicro configure -o organization -e test -u usuario@dominio.com)

6) The secret key is returned for further initialization he following credentials are required to start edge micro key: ab2fab7b secret: b835aae976d561c815

7) It is created automatically in APIGee Cloud, proxy’s starting with the name edgemicro_. This is the pattern created for using edgeMicro apigee. (from there the dependence on the cloud starts).

😎 To start the standAlone service (\> edgemicro start -o organization -e environment -k ab2fab7b0 -s b835aae976d561c815)

9) The default access port is 8000, which can be changed in the configuration file item 3.

10) API-Products was created in the Apigee interface with the product that will be associated with the proxies (edgemicro_)

Generating docker image from DockerFile

1) In the folder that contains the configuration files of the Edgemicro gateway Apigee, we created the Dockerfile as follows:

FROM node: 8-alpine 

MAINTAINER Fabrizio Sales 

RUN npm install edgemicro -g 

RUN edgemicro init COPY default.yaml /root/.edgemicro 

COPY fabriziorodrigues-eval-test-config.yaml /root/.edgemicro 

COPY fabriziorodrigues-eval-test-cache-config.yaml /root/.edgemicro 

RUN mkdir -p / data / logToken / data / token 

VOLUME / data / logToken / data / token 

RUN edgemicro token get -o fabriziorodrigues-eval -e test -i ARyA8NnmvA1SODyMIJ2woAOYhAlOdEI7 -s R021PGP5SHzsSGC5> /data/token/token.txt 

CMD edgemicro start -o fabriziorodrigues-eval -e test -k 213b5e8b342757eb52de9cc650a0acdfef58c2aee8330ac35d9f01a890a745e0 -s 04e1b0b871149206a806425ecdafe7cdfec51343d512e9f9f6f6e6fc

2) $ docker build -t microfabapigee.

3) Make a ps -a docker, to check if the container has gone up and its port to access the server that the edgemicro is running on.

4) Save the image to a compressed file. $ docker save microfabapigee> microfabapigee.zip

5) If it is necessary to upload the created image to another server: $ docker load <microfabapigee.zip>

6) To monitor the use of the docker: $ docker stats

Creating a repository and uploading the image to Amazon ECS

With Amazon ECS, use the Amazon Elastic Container Registry (Amazon ECR) to create an image repository and upload an image to it.

1) Creating a task definition

1.1) Specify a task definition so that Amazon ECS knows which Docker image to use for containers, how many containers to use in the task, and the allocation of resources for each container

1.2) Next step, configure the Amazon ECS service. A service runs and maintains copies of the job definition in its cluster. Do not forget to inform the desired number of tasks.

1.3) Amazon ECS can create an Elastic Load Balancing (ELB) load balancer to distribute traffic between the container instances where your task is being performed.

1.4) Enter the Container Name and the host port.

1.5) Before attaching a load balancer to an Amazon ECS Service, you need to create an Identity and Access Management (IAM) function to be used by your services.

2) Configure your cluster Amazon ECS tasks are run in a cluster, which is a set of container instances running on the container agent.

2.1) Define the cluster name, the EC2 instance type, the number of instances and the key pair.

2.2) Review the task definition.

2.3) Point the browser to the DNS name of the load balancer to verify that the application is running

2.4) Copy the ELB's DNS name.

Final) Paste it in a new browser window and you can access the edge of the apigee from AWS

Version history
Last update:
‎11-26-2020 02:54 PM
Updated by: