-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Sidecar support #875
Labels
type/design
Issues that are design proposals.
Comments
Milestone
|
This was referenced May 18, 2020
mergify bot
pushed a commit
that referenced
this issue
Jun 8, 2020
<!-- Provide summary of changes --> Partially address #875. With this PR now we can deploy a Copilot service with Firelens as the log driver to deliver logs of the main container to destinations. Users can config Firelens in two ways: 1. Set up configurations in the manifest (unable to sent to multiple destinations though). 2. Configure using fluentbit config file. Note that this requires users to build their own custom fluentbit image and specifying their config file path. Additionally users might need to add permissions to task role if necessary. And they are able to add their own permissions by using Copilot addons feature. Any addons policy will be added to the task role. This PR also adjusts `svc logs` to accommodate Firelens changes. <!-- Issue number, if available. E.g. "Fixes #31", "Addresses #42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
Currently adding sidecar container in
ecs-preview
needs users to runapp package
then modify the generated CloudFormation template, then push their image manually, which is not an easy task. As a result, we consider adding sidecar patterns forecs-preview
to provide a pleasant experience of adding common sidecar containers.Type of Sidecars
A sidecar container is a second container added to the task definition. We can generally categorize sidecar containers into three types: explicit sidecar, implicit sidecar (hidecar), and generic sidecar.
Explicit Sidecar
Explicit sidecar is a type of sidecar container which requires users to customized/configured image and explicitly performs as a sidecar container. To take NGINX as an example, users need to configure nginx.conf file and build their own NGINX image. Most of users are aware of the fact that they have NGINX as a sidecar image for their service.
Implicit Sidecar (Hidecar)
Implicit sidecar, on the contrary, doesn’t require users to have their own sidecar image and most of users do not even know the existence of the sidecar container. For example, currently Firelens as a sidecar container help users to route their app log. However, the images used by the sidecar container are basically the same so that users do not need to configure the image itself. AppMesh can be another example since most of cases the sidecar containers consume the same envoy image.
Generic Sidecar
Generic sidecars are sidecar containers that are not supported as a pattern. For example the sidecar requires adding/modifying other resources and IAM policies. According to our tenet Make difficult simple and make impossible possible, we support generic sidecars by allowing them to add
addons
stack for adding additional resources or policies.Design Proposal
For explicit sidecar containers, we’ll have a “sidecars” field in the manifest and users can configure their explicit sidecar containers. And for implicit sidecar containers it should be case by case. For example, we’ll have a “firelensLog” field for configuring the log for their application, in which users can configure Firelens if they’d like to use fluentbit to route their log elsewhere. For generic sidecars, we’ll introduce how to add them as sidecars in
ecs-preview
.Explicit Sidecar
We’ll take X-ray as an example for adding explicit sidecars. To add an X-ray sidecar container to their application, users need to modify their manifest after running
app init
.Manifest
After configuring the manifest, users can run
app deploy
to deploy their application with sidecar container.Accommodate with Current Commands
app show
app show
requires no changes.app logs
app logs
will includes the log of the sidecar container.app status
app status
requires no changes.Implicit Sidecars
Since for implicit sidecars the setting will be case by case. Here we will start with Firelens.
Manifest
By default, we'll set the destination to be CloudWatch, and users can modify the destination to somewhere else. However, permission file might be required. See more Firelens example in Appendix.
Accommodate with Current Commands
app show
app show
requires no changes.app logs
app logs
will show log of the main container and Firelens sidecar container if destination is set to "cloudwatch". However, it will only show the log of the sidecar container if the main app logs are routed to elsewhere (since it will be difficult for us to get those logs after they are routed to their destinations).app status
app status
requires no changes.Generic Sidecars
For generic sidecars that we don't have a pattern yet, users can add those sidecars with addon stack. However, since addon stack can only add new resources/policies, if their sidecar containers require any main CFN changes, then they need to modify the CFN template generated by
app package
. In the future we might have a flag inapp deploy
that allows them to deploy their modified CFN template generated byapp package
.Appendix
Send to multiple destinations
extra.conf
permissions.json
Send logs to datadog
The text was updated successfully, but these errors were encountered: