RzGold dev docker container aws service creation

main
Yik Teng Hie 4 years ago
parent 6a8db5d3b3
commit ea1f117f05

@ -6,6 +6,25 @@
* Visual Studio Code
* ```json
"configurations": [
{
"type": "node",
"name": "Launch via NPM",
"request": "launch",
"protocol": "inspector",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script", "start"
],
"outputCapture": "std",
"port": 5858 //inspector default port use to server side debug
}]
```
*
* NodeJS
* FortiClient VPN access to connec to dev server
@ -65,4 +84,3 @@
},
```

@ -10,3 +10,50 @@
* AWS WAF
* AWS Shield
## Setup
1. Create `ECR` to store docker image
* `903306222264.dkr.ecr.ap-southeast-1.amazonaws.com/gold-web-api:develop_v5`
* ![](./images/ecr-images.PNG)
2. Create Jenkins
* To build container image and push to `ECR`
* To generate `taskdefinition.json` from `config/taskdef-develop.json`
* ![](./images/jenkins-ecr-script.PNG)
* ![](./images/jenkins-build.PNG)
* ![](./images/jenkins-deploy.PNG)
* *Note* : After delete the ecs instance, seems like script still execute the `aws ecs update-service ...` instead of `aws ecs create-service ...`
3. Create `Target Group`
* `zgd-tg-ecs-gold-web-api`
* To map host port to container port (443)
* Health Check interval `30s`
* Host port is auto assigned when ECS instance started. Eg. `44212`
* ![](./images/target-group.PNG)
4. Create `CloudWatch` log group
* log group `ZGD-gold-web-api` for ECS instance to log
* *Note* : If log group not created, container will not be able to start. Fail code `500`
5. Create ECS
* Cluster : `zdg-ecs-cluster`
* Spin-Up instance : `gold-web-api`
* Goto `Services` -> `gold-web-api` ->` Tasks`, and select the task to view below
* ![](./images/ECS-running.PNG)
6. Setup ALB (Application Load Balancer)
* `zgd-alb-wan-ecs`
* Add Listener Rules for `HTTPS:443`
* ![](./images/alb-rule.PNG)
7. Setup Route 53
* Add `webapi.zgold-dev.com` domain name
* ONLY `Daryl Chew` have rights to do this for QA & Dev
* Production need SRE team
## Troubleshoot
1. Route 53 : Hostname Creation `webapi.zgold-dev.com`
2. ALB (Load Balancer) : `zgd-alb-wan-ecs`
3. Target Group : `zgd-tg-ecs-gold-web-api`
4. ECS : `gold-web-api`
5. Cloudwatch : `ZGD-gold-web-api`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Loading…
Cancel
Save