Back to Charts

⚠️ Repo Archive Notice

stable/sumologic-fluentd/README.md

latest12.4 KB
Original Source

⚠️ Repo Archive Notice

As of Nov 13, 2020, charts in this repo will no longer be updated. For more information, see the Helm Charts Deprecation and Archive Notice, and Update.

SumoLogicFluentd

Sumo Logic is a hosted logging platform.

DEPRECATION NOTICE

This chart is deprecated and no longer supported.

Introduction

This chart adds the Sumo Logic FluentD Plugin to all nodes in your cluster as a DaemonSet. The image supports fluentd file and systemd log sources.

After you have installed the chart, each pod, deployment, etc. can be optionally configured to specify its log format, source category, source name, or exclude itself from SumoLogic.

Configure an individual pod

annotations:
  sumologic.com/format: "text"
  sumologic.com/sourceCategory: "mywebsite/nginx"
  sumologic.com/sourceName: "mywebsite_nginx"

Prevent an individual pod from logging

annotations:
  sumologic.com/exclude: "true"

Prerequisites

  • Kubernetes 1.10+ with Beta APIs enabled. However, certain configuration parameters may require a more recent version of Kubernetes. Such parameters will specify the minimum Kubernetes version required in the parameter description.

Installing the Chart

To install the chart with the release name my-release, create your Sumo Logic HTTP Collector and run:

bash
$ helm install --name my-release \
    --set sumologic.collectorUrl=YOUR-URL-HERE stable/sumologic-fluentd

After a few minutes, you should see logs available in Sumo Logic.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

bash
$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the sumologic-fluentd chart and their default values.

ParameterDescriptionDefault
podAnnotationsAnnotations to add to the DaemonSet's Pods{}
daemonsetAnnotationsAnnotations to add to the DaemonSet itself{}
tolerationsList of node taints to tolerate (requires Kubernetes >= 1.6)[]
nodeSelectorNode labels for fluentd pod assignment{}
affinityExpressions for affinity{}
extraEnvList of additional env vars to append to pods[]
updateStrategyOnDelete or RollingUpdate (requires Kubernetes >= 1.6)OnDelete
sumologic.collectorUrlAn HTTP collector in SumoLogic that the container can send logs to via HTTPNil You must provide your own value
sumologic.collectorUrlExistingSecretIf set, use the secret with the name provided instead of creating a new oneNil You must reference an existing secret
sumologic.fluentdSourceThe fluentd input source, file or systemdfile
sumologic.fluentdUserConfigDirA directory of user-defined fluentd configuration files, which must be in the *.conf directory in the container/fluentd/conf.d/user
sumologic.flushIntervalHow frequently to push logs to sumo, in seconds5
sumologic.numThreadsThe number of http threads sending data to sumo1
sumologic.sourceNameSet the sumo _sourceName%{namespace}.%{pod}.%{container}
sumologic.sourceHostSet the sumo _sourceHostNil
sumologic.sourceCategorySet the sumo _sourceCategory%{namespace}/%{pod_name}
sumologic.sourceCategoryPrefixDefine a prefix, for _sourceCategorykubernetes/
sumologic.sourceCategoryReplaceDashUsed to replace - with another character/
sumologic.logFormatFormat to post logs, into sumo (json, json_merge, or text)json
sumologic.kubernetesMetaInclude or exclude kubernetes metadata, with json formattrue
sumologic.excludeContainerRegexAll matching containers will not be sent to sumoNil
sumologic.excludeFacilityRegexAll matching facilities will not be sent to sumoNil
sumologic.excludeHostRegexAll matching hosts will not be sent to sumoNil
sumologic.excludeNamespaceRegexAll matching namespaces will not be sent to sumoNil
sumologic.excludePathFiles in this pattern will not be sent to sumo, ie "[\"/var/log/containers/*.log\", \"/var/log/*.log\"]Nil
sumologic.excludePodRegexAll matching pods will not be sent to sumoNil
sumologic.excludePriorityRegexAll matching priorities will not be sent to sumoNil
sumologic.excludeUnitRegexAll matching systemd units will not be sent to sumoNil
sumologic.fluentdOptAdditional command line options, sent to fluentdNil
sumologic.verifySslVerify SumoLogic HTTPS certificatestrue
sumologic.multilineStartRegexpThe regular expression for the concat plugin to use when merging multi-line messages/^\w{3} \d{1,2}, \d{4}/, i.e. Julian dates
sumologic.readFromHeadStart to read the logs from the head of file, not bottom. Only applies to containers log files. See in_tail doc for more informationtrue
sumologic.concatSeparatorThe character to use to delimit lines within the final concatenated message. Most multi-line messages contain a newline at the end of each lineNil
sumologic.auditLogPathDefine the path to the Kubernetes Audit Log/mnt/log/kube-apiserver-audit.log
sumologic.timeKeyThe field name for json formatted sources that should be used as the time. See time_key.time
sumologic.addTimeStampOption to control adding timestamp to logs.true
sumologic.addTimeOption to control adding time to logs.true
sumologic.addStreamOption to control adding stream to logs.true
sumologic.containerLogsPathSpecify the path in_tail should watch for container logs./mnt/log/containers/*.log
sumologic.proxyUriAdd the uri of the proxy environment if present.Nil
sumologic.enableStatWatcherOption to control the enabling of stat_watcher.true
image.nameThe image repository and name to pull fromsumologic/fluentd-kubernetes-sumologic
image.tagThe image tag to pullv2.3.0
image.pullPolicyImage pull policyIfNotPresent
persistence.enabledBoolean value, used to turn on or off fluentd position file persistence, on nodes (requires Kubernetes >= 1.8)false
persistence.hostPathThe path, on each node, to a directory for fluentd pos files. You must create the directory on each node first or set persistence.createPath (requires Kubernetes >= 1.8)/var/run/fluentd-pos
persistence.createPathWhether to create the directory on the host for you (requires Kubernetes >= 1.8)false
resources.requests.cpuCPU resource requests100m
resources.limits.cpuCPU resource limits256m
resources.requests.memoryMemory resource requests128Mi
resources.limits.memoryMemory resource limits256Mi
rbac.createIs Role Based Authentication enabled in the clusterfalse
rbac.serviceAccountNameRBAC service account name{{ fullname }}
daemonset.priorityClassNamePriority Class to use for the daemonsetNil

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

bash
$ helm install --name my-release \
    --set sumologic.collectorUrl=YOUR-URL-HERE \
    stable/sumologic-fluentd

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

bash
$ helm install --name my-release -f values.yaml stable/sumologic-fluentd

Tip: You can use the default values.yaml

Persistence

By default, the fluentd position files will be written to an ephemeral emptyDir. Each time the pods die, new position files will be created, all of the logs in the cluster will be sent to sumologic again. To avoid unnecessary re-transmissions, pos directories can be maintained as a hostPath. Create a directory, on each of the nodes, and point persistence.hostPath at that directory.

bash
$ helm install --name my-release \
    --set sumologic.collectorUrl=URL,persistence.hostPath=/var/run/fluentd \
    stable/sumologic-fluentd

RBAC

By default the chart will not install the associated RBAC rolebinding, using beta annotations.

To determine if your cluster supports this running the following:

console
$ kubectl api-versions | grep rbac

You also need to have the following parameter on the api server. See the following document for how to enable RBAC

--authorization-mode=RBAC

If the output contains "beta" or both "alpha" and "beta" you can enable rbac.

Enable RBAC role/rolebinding creation

To enable the creation of RBAC resources, do the following

console
$ helm install --name my-release stable/sumologic-fluentd --set rbac.create=true

Excluding and Including data

You have several options controlling the filtering of data that gets sent to Sumo Logic.

Excluding data using environment variables

There are several environment variables that can exclude data. The following table show which environment variables affect which Fluentd sources.

Environment VariableContainersDockerKubernetesSystemd
EXCLUDE_CONTAINER_REGEX
EXCLUDE_FACILITY_REGEX
EXCLUDE_HOST_REGEX
EXCLUDE_NAMESPACE_REGEX
EXCLUDE_PATH
EXCLUDE_PRIORITY_REGEX
EXCLUDE_POD_REGEX
EXCLUDE_UNIT_REGEX

Excluding data using annotations

You can also use the sumologic.com/exclude annotation to exclude data from Sumo. This data is sent to FluentD, but not to Sumo Logic.

yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx
spec:
  replicas: 1
  selector:
    app: mywebsite
  template:
    metadata:
      name: nginx
      labels:
        app: mywebsite
      annotations:
        sumologic.com/format: "text"
        sumologic.com/sourceCategory: "mywebsite/nginx"
        sumologic.com/sourceName: "mywebsite_nginx"
        sumologic.com/exclude: "true"
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80

Include excluded using annotations

If you excluded a whole namespace, but still need one or few pods to be still included for shipping to Sumo Logic, you can use the sumologic.com/include annotation to include data to Sumo. It takes precedence over the exclusion described above.

yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx
spec:
  replicas: 1
  selector:
    app: mywebsite
  template:
    metadata:
      name: nginx
      labels:
        app: mywebsite
      annotations:
        sumologic.com/format: "text"
        sumologic.com/sourceCategory: "mywebsite/nginx"
        sumologic.com/sourceName: "mywebsite_nginx"
        sumologic.com/include: "true"
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80

FluentD stops processing logs

When dealing with large volumes of data (TB's from what we have seen), FluentD may stop processing logs, but continue to run. This issue seems to be caused by the scalability of the inotify process that is packaged with the FluentD in_tail plugin. If you encounter this situation, setting the ENABLE_STAT_WATCHER to false should resolve this issue.