Deploy FluentD¶
This guide will walk you through setting up FluentD to send logs to CloudWatch Logs.
Fast Forward
If you already have deployed FluentD, expand this box to fast-forward.
- Proceed to the Verify section.
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing EKS cluster.
- An existing IAM role for FluentD.
Procedure¶
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deploymentsRestore the required context from previous sections:
root@rok-tools:~/ops/deployments# source <(cat deploy/env.{envvars-aws,\ > eks-cluster,fluentd-eks-iam})root@rok-tools:~/ops/deployments# export AWS_DEFAULT_REGION AWS_ACCOUNT_ID \ > EKS_CLUSTER FLUENTD_EKS_IAM_ROLERender the ConfigMap patch template with the variables you have specified:
root@rok-tools:~/ops/deployments# j2 rok/amazon-cloudwatch/overlays/deploy/patches/configmap.yaml.j2 \ > -o rok/amazon-cloudwatch/overlays/deploy/patches/configmap.yamlRender the ServiceAccount patch template with the variables you have specified:
root@rok-tools:~/ops/deployments# j2 rok/amazon-cloudwatch/overlays/deploy/patches/sa.yaml.j2 \ > -o rok/amazon-cloudwatch/overlays/deploy/patches/sa.yamlCommit your changes:
root@rok-tools:~/ops/deployments# git commit -am "Configure FluentD CloudWatch agent"Apply the manifests:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/amazon-cloudwatch/overlays/deploy/
Verify¶
Verify that FluentD DaemonSet is up-and-running. Verify fields READY and UP-TO-DATE are equal to field DESIRED:
root@rok-tools:~/ops/deployments# kubectl get ds -n amazon-cloudwatch NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE fluentd-cloudwatch 2 2 2 2 2 <none> 1mVerify that you have enabled logging for your containers and worker nodes by checking that the corresponding log groups have been created in Amazon CloudWatch Logs:
root@rok-tools:~/ops/deployments# aws logs describe-log-groups \ > --log-group-name-prefix /aws/containerinsights/${EKS_CLUSTER?} \ > --query logGroups[].[logGroupName] --output text /aws/containerinsights/arrikto-cluster/application /aws/containerinsights/arrikto-cluster/dataplane /aws/containerinsights/arrikto-cluster/host
What’s Next¶
Check out the rest of the EKS maintenance operations that you can perform on your cluster.