How to Send Kubernetes Logs to AWS CloudWatch?

后端 未结 4 1075
北荒
北荒 2020-12-28 16:05

AWS CloudWatch Logs in Docker

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

4条回答
  •  情话喂你
    2020-12-28 16:44

    Sliverfox has a great answer. You don't have to build your own image. Could also directly use fluentd official docker image, fluent/fluentd-kubernetes-daemonset:cloudwatch. The code is on fluentd-kubernetes-daemonset github.

    You could replace the default fluent.conf with the configmap. Like below in the ds.yaml, and write your own fluent.conf in configmap.yaml. For the complete yaml files, you could refer to the example ds.yaml and configmap.yaml that we wrote.

        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: config-volume
          mountPath: /fluentd/etc/
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: config-volume
        configMap:
          name: fluentd-cw-config
    

提交回复
热议问题