Deploying Failure Flags on AWS ECS
This document will walk you through setting up Failure-Flags-Sidecar for your ECS Tasks. Failure-Flags-Sidecar runs alongside your application and is responsible for managing Chaos Engineering experiments and reliability tests.
Adding Failure-Flags-Sidecar to your ECS Tasks
Failure-Flags-Sidecar container images are available via DockerHub and support both AMD64/x86_64 and ARM64 architectures. These container images include a LICENSE file and a single binary program built for Linux. Alternatively, you can download archives directly: arm64, x86_64.
All versions are listed in a file at: https://assets.gremlin.com/packages/failure-flags-sidecar/VERSIONS.
Setting required environment variables
You can add Failure-Flags-Sidecar to any Task without impacting your application availability or performance. But you do need to add configuration to your environment variables before Failure-Flags-Sidecar will add any value. Configuration comes in via environment variables and or configuration files.
Get started quickly with environment variables only:
- <span class="code-class-custom">GREMLIN_SIDECAR_ENABLED</span> must be set to either <span class="code-class-custom">true</span> or <span class="code-class-custom">yes</span> or <span class="code-class-custom">1</span> to enable Failure-Flags-Sidecar. If unset or set to any other value Failure-Flags-Sidecar will operate in NOOP mode.
- <span class="code-class-custom">GREMLIN_TEAM_ID</span> must be set to your Gremlin Team ID. This and other credential material is available through the Gremlin UI.
- <span class="code-class-custom">GREMLIN_TEAM_CERTIFICATE</span> must be set to your Gremlin Team certificate. Newlines may be preserved using the <span class="code-class-custom">\n</span> escape characters or omited entirely. This and other credential material is available through the Gremlin UI.
- <span class="code-class-custom">GREMLIN_TEAM_PRIVATE_KEY</span> must be set to your Gremlin Team private key. Newlines may be preserved using the <span class="code-class-custom">\n</span> escape characters or omited entirely. This and other credential material is available through the Gremlin UI.
Setting Targeting Environment Variables
You will want to set custom targeting labels to uniquely identify deployments of your software. Setting custom labels is done through environment variables with a prefix, <span class="code-class-custom">GREMLIN_LABEL_</span>. Any environment variable set on the sidecar with that prefix will be included as labels on the service. For example:
Individual Configuration Values from Files or ARNs
You can configure individual configuration values like <span class="code-class-custom">GREMLIN_TEAM_CERTIFICATE</span>, <span class="code-class-custom">GREMLIN_TEAM_PRIVATE_KEY</span>, and <span class="code-class-custom">GREMLIN_CUSTOM_ROOT_CERTIFICATE</span> to retrieve values from files in the sidecar container or from AWS services using their ARNs. Instead of setting those environment values directly, use their <span class="code-class-custom">_FILE</span> or <span class="code-class-custom">_ARN</span> counterparts. Files must be fully qualified paths from the filesystem root. This project currently supports <span class="code-class-custom">secretsmanager</span> secret and <span class="code-class-custom">ssm</span> paramter ARNs.
When you add the Failure-Flags-Sidecar container to your ECS Task and configure the environment variables correctly, your service will be able to consult that extension for Gremlin experiment configuration. You will be able to find your service in the Gremlin UI under Failure Flags > Services after you launch your app with the layer configured and you exercise the integration.
Once you've added Failure-Flags-Sidecar to your project you can use the Failure Flags library (Node, Python, Java, Go) from your code!
Example Pod Spec with Failure Flags Sidecar
Adding the sidecar means including an additional task in any ECS application where you want to use Failure Flags.