f3ec851fc32f583f442002be0ae6a4e0d61a5d15
[ealt-edge.git] / mep / mepagent / README.md
1 # mep_agent_lib
2 Agent lib for mep service regsitration API 
3
4
5 ## Introduction
6
7 MEP agent library and sample application is provide for quickly develop applications on MEP platform.
8 Code is devided in 2 part.
9 - SampleApp
10 - Service registration pkg.
11 - config file for setting application configuration 
12 - docker file , build and k8s yaml files
13
14 * SampleApp 
15         - sample application for service regsitration to MEP
16         - contains main function and call service registration function from provided pkg
17         - It has config file for setting application configuration  
18
19 * pkg for service registration
20         - pkg can be used to register developer applications to MEP. 
21         - support http and https connection to MEP
22         - configuration can be enabled/disbaled in config files when start mep agent
23         
24 ## Configuration
25 mainly below configuration supported
26         - MEP GW details
27                 - IP: IP of MEP Gateway 
28                 - HTTPS port:  GW HTTPS proxy port 
29                 - HTTP port:  GW HTTP proxy port
30         - App instance ID 
31         - service registration sample data as per ETSI mp1 interface.
32         
33 ## Usages
34 Developer who develp applications for MEP, can leverage sample application and pkg freamework to support mp1 interface for service registration.
35 In future this library can be extened to support all mp1 interface like discovery, service avaiibilty.
36 MEP support mp1 interfaces as per ETSI compliant.
37         
38 * Steps
39         - configure MEP GW IP and port in path meagent/SampleApp/conf/app_instance_info.yaml
40                 - based on deplyment mode(development/production) provide HTTP/HTTPS port
41                 - kong API GW run as K8s service, check corresponding port and config accordingly
42                 - Kong has admin and proxy port. 
43                 - use proxy port and configure
44         - Build go applicaion with below cmd:
45                 - cd mepagent/SampleApp
46                 - CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' src/main/main.go
47         - Build docker and push to docker
48                 - sudo ./docker-build.sh
49         - Deploy Application
50                 - In mep-k8s.yaml
51                 - enable/disable ssl which is env. variable in k8s yaml file
52                 - APP_SSL_MODE "1" to enable ssl.
53                 - By default app run in normal mode.
54                 - generate k8s secret with ca.crt file which is root CA used by MEP. 
55                 - MEP provide cert-manager and vault to automate it. Plz refer corresponding document.
56                 
57