Skip to content
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

fix: Fargate-serverless pattern #2021

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 3 additions & 37 deletions patterns/fargate-serverless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,46 +45,12 @@ See [here](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started
3. Validate the `aws-logging` configMap for Fargate Fluentbit was created:

```sh
kubectl -n aws-observability get configmap aws-logging -o yaml
kubectl -n aws-observability get configmap aws-logging
```

```yaml
apiVersion: v1
data:
filters.conf: |
[FILTER]
Name parser
Match *
Key_Name log
Parser regex
Preserve_Key True
Reserve_Data True
flb_log_cw: "true"
output.conf: |
[OUTPUT]
Name cloudwatch_logs
Match *
region us-west-2
log_group_name /fargate-serverless/fargate-fluentbit-logs20230509014113352200000006
log_stream_prefix fargate-logs-
auto_create_group true
parsers.conf: |
[PARSER]
Name regex
Format regex
Regex ^(?<time>[^ ]+) (?<stream>[^ ]+) (?<logtag>[^ ]+) (?<message>.+)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
Time_Keep On
Decode_Field_As json message
immutable: false
kind: ConfigMap
metadata:
creationTimestamp: "2023-05-08T21:14:52Z"
name: aws-logging
namespace: aws-observability
resourceVersion: "1795"
uid: d822bcf5-a441-4996-857e-7fb1357bc07e
NAME DATA AGE
aws-logging 4 20m
```

You can also validate if the CloudWatch LogGroup was created accordingly, and LogStreams were populated:
Expand Down
7 changes: 6 additions & 1 deletion patterns/fargate-serverless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module "eks_blueprints_addons" {
kube-proxy = {}
}

# Enable Fargate logging
# Enable Fargate logging this may generate a large ammount of logs, disable it if not explicitly required
enable_fargate_fluentbit = true
fargate_fluentbit = {
flb_log_cw = true
Expand Down Expand Up @@ -237,6 +237,11 @@ resource "kubernetes_deployment_v1" "this" {
container_port = 80
}
}
toleration {
effect = "NoSchedule"
key = "eks.amazonaws.com/compute-type"
value = "fargate"
}
}
}
}
Expand Down
Loading