Skip to content

Commit

Permalink
fix: Fargate-serverless pattern (#2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobersa authored Sep 27, 2024
1 parent 55ae774 commit e6c38b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
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

0 comments on commit e6c38b1

Please sign in to comment.