Logging integration doesn't work if Docker Root is not default /var/lib/docker

Follow
Table of Contents

Issue

As of the time of this writing, Rancher Logging is broken when the Docker root is configured to something other than /var/lib/docker.

This issue is tracked in GitHub issue #21112.

Pre-requisites

  • Rancher 2.x managed/imported cluster with logging enabled.
  • Docker root configured to something other than /var/lib/docker on the nodes (confirmed with docker info | grep Root).

Workaround

These steps will assume you have the Docker data root set to /other-docker-root. Change /other-docker-root to whatever your custom path is:

  1. Rancher UI -> Cluster -> System Project -> Workloads -> cattle-logging Namespace

  2. Find workload rancher-logging-fluentd-linux

  3. Edit YAML

  4. Edit volume dockerroot

  5. Change "Path on the Node" from /var/lib/docker to /other-docker-root

  6. Add volume (with the following details):

Volume Name: dockerrootcustom
Type: bind-mount
Path on the Node: /other-docker-root
Mount Point: /other-docker-root
  1. Click Save

At this point logging should be working with your non-default Docker root directory. You should be able to verify this on your logging target. Keep in mind it may take a few minutes for logs to show up there as fluentd is configured to clear its buffer every 60 seconds by default.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.