Dash0 acquires Polar Signals
Run AWS-hosted Kubernetes with AWS Fargate for effortless container scaling. Gain visibility into your systems and simplify deployments.
Amazon can operate your Kubernetes clusters for you via its EKS services. It can also offer to run Kubernetes pods on Fargate, which this integration is all about.
EKS with AWS Fargate has several limitations regarding telemetry extraction, but AWS offers a way to extract logs. This guide will teach you how.
You can collect logs from Amazon EKS with AWS Fargate through AWS-maintained Fluent Bit instances. All it takes is the
magical aws-observability Kubernetes Namespace and ConfigMap.
To start, place the following content in a file called config.yaml.
kind: Namespace
apiVersion: v1
metadata:
name: aws-observability
labels:
aws-observability: enabled
---
kind: ConfigMap
apiVersion: v1
metadata:
name: aws-logging
namespace: aws-observability
data:
parsers.conf: |
[PARSER]
Name crio
Format Regex
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>P|F) (?<log>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
filters.conf: |
[FILTER]
Name parser
Match *
Key_name log
Parser crio
[FILTER]
Name kubernetes
Match *
Merge_Log On
Keep_Log Off
Buffer_Size 0
Kube_Meta_Cache_TTL 300s
Annotations Off
Labels Off
[FILTER]
Name nest
Match *
Operation lift
Wildcard kub.*
Nest_under kubernetes
Add_prefix temp_k8s.
[FILTER]
Name modify
Match *
Rename temp_k8s.pod_name k8s.pod.name
Rename temp_k8s.pod_id k8s.pod.uid
Rename temp_k8s.namespace_name k8s.namespace.name
Rename temp_k8s.container_name k8s.container.name
Rename temp_k8s.container_image container.image.id
Rename temp_k8s.container_hash container.image.name
Remove_regex temp_k8s.*
output.conf: |
[OUTPUT]
Name es
Match *
Host {{endpoint_elasticsearch_bulk_hostname}}
Port {{endpoint_elasticsearch_bulk_port}}
TLS on
HTTP_User Bearer
HTTP_Passwd {{token}}
Index {{dataset}}This configuration enables log collection, activates Kubernetes metadata collection, and maps the metadata to OpenTelemetry's semantic conventions through Fluent Bit's filter capabilities.
The output configuration instructs Fluent Bit to send its data to Dash0's Elasticsearch Bulk endpoint.
You can apply those changes to your Amazon EKS cluster with AWS Fargate. The Fargate admission controller will validate the configuration. Once it is applied, you will not see any additional workloads in your Kubernetes cluster as a result of this configuration.
kubectl apply -f config.yamlAn unfortunate reality of Amazon EKS with AWS Fargate is that logging changes only apply to newly scheduled pods. Consequently, we recommend rescheduling a pod to validate that everything works as intended.
To validate that Amazon EKS picks up on the configuration, check the events for the newly scheduled pod, e.g., via
kubectl events or kubectl describe pod -n [namespace] [pod name].
When correctly configured, your pod will have an event similar to the following:
$ kubectl events
LAST SEEN TYPE REASON OBJECT MESSAGE
26s Normal LoggingEnabled Pod/nginx-5cddf7c464-p8kfl Successfully enabled logging for pod