AWS CloudWatch Logs in Docker

+1 vote

I want to use AWS CloudWatch logs in a Kubernetes cluster, where each pod contains a few Docker containers, each deployment would have a separate Log Group, and each container would have a separate stream.
 I could not find a way to send the logging parameters to the docker containers via Kubernetes create / apply.

How can I send the log-driver and log-opt parameters to a Docker container in a pod / deployment?

Setting an AWS CloudWatch Logs driver in docker is done with log-driver=awslogs and log-opt, for example -

#!/bin/bash

docker run \
    --log-driver=awslogs \
    --log-opt awslogs-region=eu-central-1 \
    --log-opt awslogs-group=whatever-group \
    --log-opt awslogs-stream=whatever-stream \
    --log-opt awslogs-create-group=true \
    wernight/funbox \
        fortune




Can anyone helP?

May 29, 2018 in AWS by Flying geek
• 3,280 points
1,960 views

2 answers to this question.

0 votes

Try using a Helm chart to install Fluentd:

$ helm install --name my-release incubator/fluentd-cloudwatch

Even I tried this from Github, was suggested by an experienced techie, this will help for sure, try this:   https://github.com/kubernetes/charts/tree/master/incubator/fluentd-cloudwatch

answered May 29, 2018 by Cloud gunner
• 4,670 points
0 votes

The awslogs works without using ECS.

you need to configure the AWS credentials (the user should have IAM roles appropriate [cloudwatch logs]).

I used this tutorial, it worked for me: https://wdullaer.com/blog/2016/02/28/pass-credentials-to-the-awslogs-docker-logging-driver-on-ubuntu/

answered Sep 7, 2018 by bug_seeker
• 15,520 points

Related Questions In AWS

+1 vote
2 answers

AWS WAF - Auto Save Web Application Firewall logs in S3.

You can do this through the console ...READ MORE

answered Jul 13, 2018 in AWS by Priyaj
• 58,100 points
1,702 views
0 votes
1 answer

Pass account id of an AWS sub account using a variable as an argument in CloudWatch Alarm Actions with python (boto3)?

Python String and Integer concatenation >>> print("arn:aws:swf:us-east-2:{0}:action/actions/AWS_EC2.InstanceId.Stop/1.0".format(acccnum)) arn:aws:swf:us-east-2:12312312312312:action/actions/AWS_EC2.InstanceId.Stop/1.0 >>> print("arn:aws:swf:us-east-2:" ...READ MORE

answered Oct 5, 2018 in AWS by Priyaj
• 58,100 points
1,536 views
0 votes
0 answers
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
2,651 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,303 views
0 votes
2 answers

Receiving SMS from users and stores in AWS

As far as I know, receiving international ...READ MORE

answered Aug 21, 2018 in AWS by Priyaj
• 58,100 points
1,520 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP