Skip to content

feat(stack): add general sidecar deployment support#978

Merged
mergify[bot] merged 6 commits intoaws:masterfrom
iamhopaul123:deploy/stack/sidecar-support
Jun 2, 2020
Merged

feat(stack): add general sidecar deployment support#978
mergify[bot] merged 6 commits intoaws:masterfrom
iamhopaul123:deploy/stack/sidecar-support

Conversation

@iamhopaul123
Copy link
Copy Markdown
Contributor

Add general sidecar support for svc deployment. With this change now users can configure sidecar in their manifest then do svc deploy to deploy their service with sidecar containers.

Manual test pass (deployed a service with nginx as a sidecar container).

Next step is to add Firelens deployment and lastly add e2e tests for this feature.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@iamhopaul123 iamhopaul123 changed the title feat(stack): add general sidecar support feat(stack): add general sidecar deployment support May 29, 2020
@iamhopaul123
Copy link
Copy Markdown
Contributor Author

Example manifest file to deploy a service with nginx as a sidecar container (traffic will be routed to nginx):

# The manifest for the "app" service.
# Read the full specification for the "Load Balanced Web Service" type at:
#  https://github.com/aws/amazon-ecs-cli-v2/wiki/Manifests#load-balanced-web-svc

# Your service name will be used in naming your resources like log groups, ECS services, etc.
name: app
# The "architecture" of the service you're running.
type: Load Balanced Web Service

image:
  # Path to your service's Dockerfile.
  build: app/Dockerfile
  # Port exposed through your container to route traffic to it.
  port: 3000

http:
  # Requests to this path will be forwarded to your service. 
  # To match all requests you can use the "/" path. 
  path: 'api'
  # You can specify a custom health check path. The default is "/"
  healthcheck: '/api/health-check'
  targetContainer: 'nginx'

# Number of CPU units for the task.
cpu: 256
# Amount of memory in MiB used by the task.
memory: 512
# Number of tasks that should be running in your service.
count: 1

sidecars:
  nginx:
    port: 80
    image: 403971813171.dkr.ecr.us-west-2.amazonaws.com/reverse-proxy:revision_1    # Image URL for sidecar container. Local images and images in the Docker Hub registry and ECR repository are supported.
    # credentialParameter: # ARN of the secret containing the private repository credentials.

# Optional fields for more advanced use-cases.
#
#variables:                    # Pass environment variables as key value pairs.
#  LOG_LEVEL: info
#
#secrets:                      # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
#  GITHUB_TOKEN: GITHUB_TOKEN  # The key is the name of the environment variable, the value is the name of the SSM parameter.

# You can override any of the values defined above by environment.
#environments:
#  test:
#    count: 2               # Number of tasks to run for the "test" environment.

@iamhopaul123 iamhopaul123 force-pushed the deploy/stack/sidecar-support branch from 6e29242 to b688d89 Compare May 29, 2020 17:02
Comment thread internal/pkg/deploy/cloudformation/stack/lb_web_svc.go
Copy link
Copy Markdown
Contributor

@kohidave kohidave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome. Just a small suggestion.

Comment thread internal/pkg/manifest/svc.go Outdated
Comment thread internal/pkg/template/service.go Outdated
@iamhopaul123 iamhopaul123 force-pushed the deploy/stack/sidecar-support branch from b688d89 to 08778a4 Compare June 1, 2020 21:33
Comment thread internal/pkg/deploy/cloudformation/stack/lb_web_svc.go
Comment thread internal/pkg/deploy/cloudformation/stack/lb_web_svc.go
Comment thread internal/pkg/manifest/svc.go
Comment thread internal/pkg/manifest/svc.go Outdated
Comment thread internal/pkg/deploy/cloudformation/stack/lb_web_svc.go Outdated
Comment thread internal/pkg/deploy/cloudformation/stack/lb_web_svc.go Outdated
@mergify mergify bot merged commit dd65a89 into aws:master Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants