apiVersion: v1
kind: Project
metadata:
  labels:
    app: collectorforopenshift-syslog
  name: collectorforopenshift-syslog
  annotations:
    openshift.io/node-selector: ''
    openshift.io/description: 'Forwarding logs to Syslog, built by Outcold Solutions'
    openshift.io/display-name: 'Collectord for OpenShift (Syslog)'
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: configurations.collectord.io
spec:
  group: collectord.io
  versions:
    - name: v1
      served: true
      storage: true
  scope: Cluster
  names:
    plural: configurations
    singular: configuration
    kind: Configuration
---
apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
  name: collectorforopenshift-syslog-critical
value: 1000000000
---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: collectorforopenshift-syslog
  name: collectorforopenshift-syslog
  namespace: collectorforopenshift-syslog
---
apiVersion: v1
kind: ClusterRole
metadata:
  labels:
    app: collectorforopenshift-syslog
  name: collectorforopenshift-syslog
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - get
  - list
  - watch
---
apiVersion: v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: collectorforopenshift-syslog
  name: collectorforopenshift-syslog
  namespace: collectorforopenshift-syslog
roleRef:
  kind: ClusterRole
  name: collectorforopenshift-syslog
subjects:
  - kind: ServiceAccount
    name: collectorforopenshift-syslog
    namespace: collectorforopenshift-syslog
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: collectorforopenshift-syslog
  namespace: collectorforopenshift-syslog
  labels:
    app: collectorforopenshift-syslog
data:
  001-general.conf: |
    # The general configuration is used for all deployments
    #
    # Run collectord with the flag `-conf` and specify location of the configuration files.
    #
    # You can override all the values using environment variables with the format like
    #   COLLECTOR__<ANYNAME>=<section>__<key>=<value>
    # As an example you can set `dataPath` in the `[general]` section as
    #   COLLECTOR__DATAPATH=general__dataPath=C:\\some\\path\\data.db
    # This parameter can be configured using -env-override, set it to empty string to disable this feature

    [general]

    # Review License https://www.outcoldsolutions.com/docs/license-agreement/
    # and accept License by changing the value to *true*
    acceptLicense = false

    # Location for the database
    # Collectord stores positions of the files and internal state
    dataPath = ./data/

    # log level (accepted values are trace, debug, info, warn, error, fatal)
    logLevel = info

    # http server gives access to two endpoints
    # /healthz
    # /metrics
    httpServerBinding =

    # telemetry report endpoint, set it to empty string to disable telemetry
    telemetryEndpoint = https://license.outcold.solutions/telemetry/

    # license check endpoint
    licenseEndpoint = https://license.outcold.solutions/license/

    # license server through proxy
    licenseServerProxyUrl =

    # authentication with basic authorization (user:password)
    licenseServerProxyBasicAuth =

    # license key
    license =

    # Environment variable $KUBERNETES_NODENAME is used by default to setup hostname
    # Use value below to override specific name
    hostname =

    # Default output for events, logs and metrics
    # valid values: syslog and devnull
    # Use devnull by default if you don't want to redirect data
    defaultOutput = syslog

    # Default buffer size for file input
    fileInputBufferSize = 256b

    # Maximum size of one line the file reader can read
    fileInputLineMaxSize = 1mb

    # Include custom fields to attach to every event, in example below every event sent to Syslog will have
    # indexed field my_environment=dev. Fields names should match to ^[a-z][_a-z0-9]*$
    # Better way to configure that is to specify labels for OpenShift Nodes.
    # ; fields.my_environment = dev
    # Identify the cluster if you are planning to monitor multiple clusters
    fields.cluster = -

    # Include EC2 Metadata (see list of possible fields https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
    # Should be in format ec2Metadata.{desired_field_name} = {url path to read the value}
    # ec2Metadata.ec2_instance_id = /latest/meta-data/instance-id
    # ec2Metadata.ec2_instance_type = /latest/meta-data/instance-type

    # subdomain for the annotations added to the pods, workloads, namespaces or containers, like syslog.collectord.io/..
    annotationsSubdomain = syslog

    # Configure acknowledgement database.
    # - force fsync on every write to Write-Ahead-Log
    db.fsync = false
    # - maximum size of the Write-Ahead-Log
    db.compactAt = 1M

    # configure global thruput per second for forwarded logs (metrics are not included)
    # for example if you set `thruputPerSecond = 512Kb`, that will limit amount of logs forwarded
    # from the single Collectord instance to 512Kb per second.
    # You can configure thruput individually for the logs (including specific for container logs) below
    thruputPerSecond =

    # Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
    # older than 7 days
    tooOldEvents =

    # Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
    tooNewEvents =

    # connection to kubernetes api
    [general.kubernetes]

    # Environment variable $KUBERNETES_NODENAME is used by default to setup nodeName
    # Use it only when you need to override it
    nodeName =

    # Configuration to access the API server,
    # see https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod
    # for details
    tokenPath = /var/run/secrets/kubernetes.io/serviceaccount/token
    certPath = /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

    # Default timeout for http responses. The streaming/watch requests depend on this timeout.
    timeout = 30m

    # (obsolete) In case if pod metadata was not retrievied. how often collectord should retry to reload the pod metadata
    # metadataFetchRetry = 5s

    # (obsolete) In case if event is recent, how long pipeline should wait for the metadata to be available in Kubernetes API
    # metadataFetchWait = 30s

    # How long to keep the cache for the recent calls to API server (to limit number of calls when collectord discovers new pods)
    metadataTTL = 30s

    # regex to find pods
    podsCgroupFilter = ^/([^/\s]+/)*kubepods(\.slice)?/((kubepods-)?(burstable|besteffort)(\.slice)?/)?([^/]*)pod([0-9a-f]{32}|[0-9a-f\-_]{36})(\.slice)?$

    # regex to find containers in the pods
    containersCgroupFilter = ^/([^/\s]+/)*kubepods(\.slice)?/((kubepods-)?(burstable|besteffort)(\.slice)?/)?([^/]*)pod([0-9a-f]{32}|[0-9a-f\-_]{36})(\.slice)?/(docker-|crio-)?[0-9a-f]{64}(\.scope)?(\/.+)?$

    # path to the kubelet root location (use it to discover application logs for emptyDir)
    # the expected format is `pods/{pod-id}/volumes/kubernetes.io~empty-dir/{volume-name}/_data/`
    volumesRootDir = /rootfs/var/lib/kubelet/
    # You can attach annotations as a metadata, using the format
    #   includeAnnotations.{key} = {regexp}
    # For example if you want to include all annotations that starts with `prometheus.io` or `example.com` you can include
    # the following format:
    #   includeAnnotations.1 = ^prometheus\.io.*
    #   includeAnnotations.2 = ^example\.com.*

    # watch for changes (annotations) in the objects
    watch.namespaces = v1/namespace
    watch.deploymentconfigs = apis/v1/apps.openshift.io/deploymentconfig
    watch.configurations = apis/v1/collectord.io/configuration

    # Syslog output
    [output.syslog]

    # tcp or udp
    network = tcp
    # syslog destination
    address =

  002-daemonset.conf: |
    # DaemonSet configuration is used for Nodes and Masters.

    # Connection to the docker host
    [general.docker]

    # url for docker API, only unix socket is supported
    url = unix:///rootfs/var/run/docker.sock

    # path to docker root folder (can fallback to use folder structure to read docker metadata)
    dockerRootFolder = /rootfs/var/lib/docker/

    # (obsolete) In case if pod metadata was not retrievied. how often collectord should retry to reload the pod metadata
    # metadataFetchRetry = 5s

    # (obsolete) In case if event is recent, how long pipeline should wait for the metadata to be available in Kubernetes API
    # metadataFetchWait = 30s

    # (obsolete) In case if collectord does not see new events for specific container and with the last metadata refresh
    # We have not found this container - fow how long we should keep this metadata in cache.
    # metadataTTL = 5s

    # Timeout for http responses to docker client. The streaming requests depend on this timeout.
    timeout = 1m

    # in case of Kubernetes/OpenShift if you schedule some containers with Docker, but not with the Kubernetes
    # that allows us to find them (by default finding all containers with name not starting with k8s_)
    containersNameFilter = ^(([^k])|(k[^8])|(k8[^s])|(k8s[^_])).*$

    # regex to find docker container cgroups (helps excluding other cgroups with matched ID)
    containersCgroupFilter = ^(/([^/\s]+/)*(docker-|docker/)[0-9a-f]{64}(\.scope)?)$


    // connection to CRIO
    [general.cri-o]

    # url for CRIO API, only unix socket is supported
    url = unix:///rootfs/var/run/crio/crio.sock

    # Timeout for http responses to docker client. The streaming requests depend on this timeout.
    timeout = 1m


    # Container Log files
    [input.files]

    # disable container logs monitoring
    disabled = false

    # root location of docker log files
    # logs are expected in standard docker format like {containerID}/{containerID}-json.log
    # rotated files
    path = /rootfs/var/lib/docker/containers/
    # root location of CRI-O files
    # logs are expected in Kubernetes format, like {podID}/{containerName}/0.log
    crioPath = /rootfs/var/log/pods/

    # (obsolete) glob matching pattern for log files
    # glob = */*-json.log*

    # files are read using polling schema, when reach the EOF how often to check if files got updated
    pollingInterval = 250ms

    # how often to look for the new files under logs path
    walkingInterval = 5s

    # include verbose fields in events (file offset)
    verboseFields = false

    # docker splits events when they are larger than 10-100k (depends on the docker version)
    # we join them together by default and forward to syslog as one event
    joinPartialEvents = true

    # In case if your containers report messages with terminal colors or other escape sequences
    # you can enable strip for all the containers in one place.
    # Better is to enable it only for required container with the label collectord.io/strip-terminal-escape-sequences=true
    stripTerminalEscapeSequences = false
    # Regexp used for stripping terminal colors, it does not stip all the escape sequences
    # Read http://man7.org/linux/man-pages/man4/console_codes.4.html for more information
    stripTerminalEscapeSequencesRegex = (\x1b\[\d{1,3}(;\d{1,3})*m)|(\x07)|(\x1b]\d+(\s\d)?;[^\x07]+\x07)|(.*\x1b\[K)

    # set output (syslog or devnull, default is [general]defaultOutput)
    output =

    # configure default thruput per second for for each container log
    # for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
    # from the single container to 128Kb per second.
    thruputPerSecond =

    # Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
    # older than 7 days
    tooOldEvents =

    # Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
    tooNewEvents =

    # Syslog format
    type = k8s_logs
    syslog.format = {type}|{timestamp::format(2006-01-02T15:04:05.999999999Z07:00)}|{cluster}|{host}|{namespace}|{pod_id}|{pod_name}|{container_name}|{stream}|{message}


    # Application Logs
    [input.app_logs]

    # disable container application logs monitoring
    disabled = false

    # root location of mounts (applies to hostPath mounts only), if the hostPath differs inside container from the path on host
    root = /rootfs/

    # how often to review list of available volumes
    syncInterval = 5s

    # glob matching pattern for log files
    glob = *.log*

    # files are read using polling schema, when reach the EOF how often to check if files got updated
    pollingInterval = 250ms

    # how often to look for the new files under logs path
    walkingInterval = 5s

    # include verbose fields in events (file offset)
    verboseFields = false

    # we split files using new line character, with this configuration you can specify what defines the new event
    # after new line
    eventPatternRegex = ^[^\s]
    # Maximum interval of messages in pipeline
    eventPatternMaxInterval = 100ms
    # Maximum time to wait for the messages in pipeline
    eventPatternMaxWait = 1s
    # Maximum message size
    eventPatternMaxSize = 1MB

    # set output (syslog or devnull, default is [general]defaultOutput)
    output =

    # configure default thruput per second for for each container log
    # for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
    # from the single container to 128Kb per second.
    thruputPerSecond =

    # Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
    # older than 7 days
    tooOldEvents =

    # Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
    tooNewEvents =

    # Syslog format
    type = k8s_logs
    syslog.format = {type}|{timestamp::format(2006-01-02T15:04:05.999999999Z07:00)}|{cluster}|{host}|{namespace}|{pod_id}|{pod_name}|{container_name}|{file_name}|{message}


    [input.journald]

    # disable host level logs
    disabled = false

    # root location of log files
    path.persistent = /rootfs/var/log/journal/
    path.volatile = /rootfs/run/log/journal/

    # when reach end of journald, how often to pull
    pollingInterval = 250ms

    # sample output (-1 does not sample, 20 - only 20% of the logs should be forwarded)
    samplingPercent = -1

    # sampling key (should be regexp with the named match pattern `key`)
    samplingKey =

    # how often to reopen the journald to free old files
    reopenInterval = 1h

    # set output (syslog or devnull, default is [general]defaultOutput)
    output =

    # configure default thruput per second for this files group
    # for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
    # from the files in this group to 128Kb per second.
    thruputPerSecond =

    # Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
    # older than 7 days
    tooOldEvents =

    # Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
    tooNewEvents =

    # syslog format
    type = k8s_host_logs
    syslog.format = {type}|{timestamp::format(2006-01-02T15:04:05.999999999Z07:00)}|{cluster}|{host}|journald|{message}


    # Pipe to join events (container logs only)
    [pipe.join]

    # disable joining event
    disabled = false

    # Maximum interval of messages in pipeline
    maxInterval = 100ms

    # Maximum time to wait for the messages in pipeline
    maxWait = 1s

    # Maximum message size
    maxSize = 1MB

    # Default pattern to indicate new message (should start not from space)
    patternRegex = ^[^\s]

  003-daemonset-master.conf: |

    # Audit logs
    [input.files::audit-logs]

    # disable host level logs
    disabled = false

    # root location of for audit logs
    path = /rootfs/var/log/kube-apiserver/

    # glob matching files
    glob = audit*.log

    # files are read using polling schema, when reach the EOF how often to check if files got updated
    pollingInterval = 250ms

    # how often o look for the new files under logs path
    walkingInterval = 5s

    # include verbose fields in events (file offset)
    verboseFields = false

    # field extraction
    extraction =
    # extractionMessageField =

    # timestamp field
    timestampField =

    # format for timestamp
    # the layout defines the format by showing how the reference time, defined to be `Mon Jan 2 15:04:05 -0700 MST 2006`
    timestampFormat =

    # timestamp location (if not defined by format)
    timestampLocation =

    # set output (syslog or devnull, default is [general]defaultOutput)
    output =

    # configure default thruput per second for this files group
    # for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
    # from the files in this group to 128Kb per second.
    thruputPerSecond =

    # Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
    # older than 7 days
    tooOldEvents =

    # Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
    tooNewEvents =

    type = k8s_audit_logs
    syslog.format = {type}|{timestamp::format(2006-01-02T15:04:05.999999999Z07:00)}|{cluster}|{message}


  004-addon.conf: |
    [general]
    # addons can be run in parallel with agents
    addon = true


    [input.kubernetes_events]

    # disable collecting kubernetes events
    disabled = false

    # (obsolete, depends on kubernetes timeout)
    # Set the timeout for how long request to watch events going to hang reading.
    # eventsWatchTimeout = 30m

    # (obsolete, depends on kubernetes timeout)
    # Ignore events last seen later that this duration.
    # eventsTTL = 12h

    # set output (syslog or devnull, default is [general]defaultOutput)
    output =

    # syslog format
    type = k8s_events
    syslog.format = {type}|{timestamp::format(2006-01-02T15:04:05.999999999Z07:00)}|{cluster}|{message}

---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: collectorforopenshift-syslog
  namespace: collectorforopenshift-syslog
  labels:
    app: collectorforopenshift-syslog
spec:
  # Default updateStrategy is OnDelete. For collectord RollingUpdate is suitable
  # When you update configuration
  updateStrategy:
    type: RollingUpdate

  selector:
    matchLabels:
      daemon: collectorforopenshift-syslog

  template:
    metadata:
      name: collectorforopenshift-syslog
      labels:
        daemon: collectorforopenshift-syslog
    spec:
      priorityClassName: collectorforopenshift-syslog-critical
      dnsPolicy: ClusterFirstWithHostNet
      hostNetwork: true
      serviceAccountName: collectorforopenshift-syslog
      # We run this DaemonSet only for Non-Masters
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: DoesNotExist
      tolerations:
      - operator: "Exists"
        effect: "NoSchedule"
      - operator: "Exists"
        effect: "NoExecute"
      containers:
      - name: collectorforopenshift-syslog
        # Stick to specific version
        image: docker.io/outcoldsolutions/collectorforopenshift:5.14.281
        securityContext:
          privileged: true
          runAsUser: 0
        # Define your resources if you need. Defaults should be fine for most.
        resources:
          limits:
            cpu: 2
            memory: 512Mi
          requests:
            cpu: 200m
            memory: 192Mi
        env:
        - name: KUBERNETES_NODENAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        volumeMounts:
        # We store state in /data folder (file positions)
        - name: collectorforopenshift-syslog-state
          mountPath: /data
        # Configuration file deployed with ConfigMap
        - name: collectorforopenshift-syslog-config
          mountPath: /config/
          readOnly: true
        # Cgroup filesystem to get metrics
        - name: cgroup
          mountPath: /rootfs/sys/fs/cgroup
          readOnly: true
        # Proc filesystem to get metrics
        - name: proc
          mountPath: /rootfs/proc
          readOnly: true
        # Location of docker root (for container logs and metadata)
        - name: docker-root
          mountPath: /rootfs/var/lib/docker/
          readOnly: true
          mountPropagation: HostToContainer
        # Docker socket
        - name: docker-unix-socket
          mountPath: /rootfs/var/run/docker.sock
          readOnly: true
        # CRI-O socket (if using CRI-O runtime)
        - name: crio-unix-socket
          mountPath: /rootfs/var/run/crio/
          readOnly: true
        # Host logs location (including CRI-O logs)
        - name: logs
          mountPath: /rootfs/var/log/
          readOnly: true
        - name: run-logs
          mountPath: /rootfs/run/log/
          readOnly: true
        # Application logs
        - name: volumes-root
          mountPath: /rootfs/var/lib/kubelet/
          readOnly: true
          mountPropagation: HostToContainer
        # correct timezone
        - name: localtime
          mountPath: /etc/localtime
          readOnly: true
      volumes:
      # We store state directly on host, change this location, if
      # your persistent volume is somewhere else
      - name: collectorforopenshift-syslog-state
        hostPath:
          path: /var/lib/collectorforopenshift-syslog/data/
      # Location of docker root (for container logs and metadata)
      - name: docker-root
        hostPath:
          path: /var/lib/docker/
      # Location of cgroups file system
      - name: cgroup
        hostPath:
          path: /sys/fs/cgroup
      # Location of proc file system
      - name: proc
        hostPath:
          path: /proc
      # Host logs location (including CRI-O logs)
      - name: logs
        hostPath:
          path: /var/log
      - name: run-logs
        hostPath:
          path: /run/log
      # Docker socket
      - name: docker-unix-socket
        hostPath:
          path: /var/run/docker.sock
      # CRI-O socket (if using CRI-O runtime)
      - name: crio-unix-socket
        hostPath:
          path: /var/run/crio/
      # Location for origin mounts, to autodiscover application logs
      - name: volumes-root
        hostPath:
          path: /var/lib/kubelet/
      # correct timezone
      - name: localtime
        hostPath:
          path: /etc/localtime
      # configuration from ConfigMap
      - name: collectorforopenshift-syslog-config
        configMap:
          name: collectorforopenshift-syslog
          items:
          - key: 001-general.conf
            path: 001-general.conf
          - key: 002-daemonset.conf
            path: 002-daemonset.conf
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: collectorforopenshift-syslog-master
  namespace: collectorforopenshift-syslog
  labels:
    app: collectorforopenshift-syslog
spec:
  updateStrategy:
    type: RollingUpdate

  selector:
    matchLabels:
      daemon: collectorforopenshift-syslog

  template:
    metadata:
      name: collectorforopenshift-syslog-master
      labels:
        daemon: collectorforopenshift-syslog
    spec:
      priorityClassName: collectorforopenshift-syslog-critical
      dnsPolicy: ClusterFirstWithHostNet
      hostNetwork: true
      serviceAccountName: collectorforopenshift-syslog
      # Deploy only on master
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
      tolerations:
      - operator: "Exists"
        effect: "NoSchedule"
      - operator: "Exists"
        effect: "NoExecute"
      containers:
      - name: collectorforopenshift-syslog
        image: docker.io/outcoldsolutions/collectorforopenshift:5.14.281
        securityContext:
          privileged: true
          runAsUser: 0
        resources:
          limits:
            cpu: 1
            memory: 512Mi
          requests:
            cpu: 200m
            memory: 192Mi
        env:
        - name: KUBERNETES_NODENAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        volumeMounts:
        - name: collectorforopenshift-syslog-state
          mountPath: /data
        - name: collectorforopenshift-syslog-config
          mountPath: /config/
          readOnly: true
        - name: cgroup
          mountPath: /rootfs/sys/fs/cgroup
          readOnly: true
        - name: proc
          mountPath: /rootfs/proc
          readOnly: true
        - name: docker-logs
          mountPath: /rootfs/var/lib/docker/
          readOnly: true
          mountPropagation: HostToContainer
        - name: docker-unix-socket
          mountPath: /rootfs/var/run/docker.sock
          readOnly: true
        - name: crio-unix-socket
          mountPath: /rootfs/var/run/crio/
          readOnly: true
        - name: logs
          mountPath: /rootfs/var/log/
          readOnly: true
        - name: run-logs
          mountPath: /rootfs/run/log/
          readOnly: true
        - name: etcd-certs
          mountPath: /rootfs/etc/kubernetes/static-pod-resources/etcd-member/
          readOnly: true
        - name: volumes-root
          mountPath: /rootfs/var/lib/kubelet/
          readOnly: true
          mountPropagation: HostToContainer
        - name: localtime
          mountPath: /etc/localtime
          readOnly: true
      volumes:
      - name: collectorforopenshift-syslog-state
        hostPath:
          path: /var/lib/collectorforopenshift-syslog/data/
      - name: docker-logs
        hostPath:
          path: /var/lib/docker/
      - name: cgroup
        hostPath:
          path: /sys/fs/cgroup
      - name: proc
        hostPath:
          path: /proc
      - name: logs
        hostPath:
          path: /var/log
      - name: run-logs
        hostPath:
          path: /run/log
      - name: docker-unix-socket
        hostPath:
          path: /var/run/docker.sock
      - name: crio-unix-socket
        hostPath:
          path: /var/run/crio/
      - name: etcd-certs
        hostPath:
          path: /etc/kubernetes/static-pod-resources/etcd-member/
      - name: volumes-root
        hostPath:
          path: /var/lib/kubelet/
      - name: localtime
        hostPath:
          path: /etc/localtime
      - name: collectorforopenshift-syslog-config
        configMap:
          name: collectorforopenshift-syslog
          items:
          - key: 001-general.conf
            path: 001-general.conf
          - key: 002-daemonset.conf
            path: 002-daemonset.conf
          - key: 003-daemonset-master.conf
            path: 003-daemonset-master.conf
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: collectorforopenshift-syslog-addon
  namespace: collectorforopenshift-syslog
  labels:
    app: collectorforopenshift-syslog
spec:
  replicas: 1
  selector:
    matchLabels:
      daemon: collectorforopenshift-syslog
  template:
    metadata:
      name: collectorforopenshift-syslog-addon
      labels:
        daemon: collectorforopenshift-syslog
    spec:
      priorityClassName: collectorforopenshift-syslog-critical
      serviceAccountName: collectorforopenshift-syslog
      containers:
      - name: collectorforopenshift-syslog
        image: docker.io/outcoldsolutions/collectorforopenshift:5.14.281
        securityContext:
          privileged: true
          runAsUser: 0
        resources:
          limits:
            cpu: 500m
            memory: 256Mi
          requests:
            cpu: 50m
            memory: 64Mi
        env:
        - name: KUBERNETES_NODENAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        volumeMounts:
        - name: collectorforopenshift-syslog-state
          mountPath: /data
        - name: collectorforopenshift-syslog-config
          mountPath: /config/
          readOnly: true
      volumes:
      - name: collectorforopenshift-syslog-state
        hostPath:
          path: /var/lib/collectorforopenshift-syslog/data/
      - name: collectorforopenshift-syslog-config
        configMap:
          name: collectorforopenshift-syslog
          items:
          - key: 001-general.conf
            path: 001-general.conf
          - key: 004-addon.conf
            path: 004-addon.conf

