Skip to main content
Knowledge Base

Deploying my first app to the Reference Architecture

Answer

I'm trying to deploy my first app, the simple-web-app, and I'm running into problems. I've completed up to and including the section `03-deploy-apps.md#deploying-to-an-eks-cluster`, and to deploy I'm not using a command line terragrunt apply of the section `03-deploy-apps.md#deploying-your-configuration` but I'm making a PR to the infrastructure-live repo, and this is where the problem occurs. Set up job, Run actions/checkout@v2,....,Notify Slack of upcoming deploy all compete without a problem. However, run deploy fails with: ``` ... [ecs-deploy-runner][2022-04-09T10:50:57+0000] │ Error: timed out waiting for the condition [ecs-deploy-runner][2022-04-09T10:50:57+0000] │ [ecs-deploy-runner][2022-04-09T10:50:57+0000] │ with helm_release.application, [ecs-deploy-runner][2022-04-09T10:50:57+0000] │ on [main.tf](http://main.tf/) line 28, in resource "helm_release" "application": [ecs-deploy-runner][2022-04-09T10:50:57+0000] │ 28: resource "helm_release" "application" { [ecs-deploy-runner][2022-04-09T10:50:57+0000] │ [ecs-deploy-runner][2022-04-09T10:50:57+0000] ╵ [ecs-deploy-runner][2022-04-09T10:50:57+0000] time=2022-04-09T10:50:57Z level=error msg=Module /tmp/tmp2nh7tfnm/dev/us-east-1/dev/services/simple-web-app has finished with an error: 1 error occurred: [ecs-deploy-runner][2022-04-09T10:50:57+0000] * exit status 1 [ecs-deploy-runner][2022-04-09T10:50:57+0000] prefix=[/tmp/tmp2nh7tfnm/dev/us-east-1/dev/services/simple-web-app] [ecs-deploy-runner][2022-04-09T10:50:57+0000] time=2022-04-09T10:50:57Z level=error msg=1 error occurred: [ecs-deploy-runner][2022-04-09T10:50:57+0000] * exit status 1 [ecs-deploy-runner][2022-04-09T10:50:57+0000] [INFO] [infrastructure-deploy-script] 2022-04-09 10:50:57 "terragrunt apply-all" exited with code 1 [ecs-deploy-runner][2022-04-09T10:50:57+0000] Error: Could not run "terragrunt apply-all" [ecs-deploy-runner][2022-04-09T10:50:57+0000] exit status 1 [ecs-deploy-runner][2022-04-09T10:50:57+0000] ERROR: exit status 1 ``` Does this ring any bells for common problems?

I think we found part of the problem. The sample-web-app as presented in `03-deploy-apps.md#the-app` exposes itself on port 8080 ``` const express = require('express'); // Constants const PORT = 8080; const HOST = '0.0.0.0'; // App const app = express(); app.get('/simple-web-app', (req, res) => { res.send('Hello world\n'); }); app.listen(PORT, HOST); console.log(`Running on http://${HOST}:${PORT}`); ``` However, the discussion of how to deploy the app in `03-deploy-apps.md#deploying-to-an-eks-cluster` doesn't mention anything about updating the container_port or service_port in k8s-simple-web-app.hcl to 8080 or changing the protocol of the health checks to http instead of https. When we make these changes we can get the app to deploy, which wasn't the case before these changes.