kind: Deployment
apiVersion: apps/v1
metadata:
  name: log-forwarding-kinesis
  namespace: openshift-logging
  labels:
    app: log-forwarding-kinesis
    app.kubernetes.io/component: log-forwarding-kinesis
    app.kubernetes.io/instance: log-forwarding-kinesis
    app.kubernetes.io/part-of: log-forwarding-kinesis
spec:
  replicas: 2
  selector:
    matchLabels:
      app: log-forwarding-kinesis
  template:
    metadata:
      labels:
        app: log-forwarding-kinesis
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      containers:
        - resources:
            requests:
              cpu: 100m
              memory: 200Mi
          terminationMessagePath: /dev/termination-log
          name: log-forwarding-kinesis
          env:
            - name: KINESIS_STREAM_NAME
              value: "CHANGEME-KINESIS-STREAM-NAME"
            - name: KINESIS_REGION
              value: "CHANGEME-KINESIS-REGION"
            - name: FORWARD_FLUSH_INTERVAL
              value: "60s"
            - name: BUFFER_SIZE_LIMIT
              value: "1m"
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: AWS_ACCESS_KEY_ID
              valueFrom:
                secretKeyRef:
                  key: AWS_KEY_ID
                  name: log-forwarding-kinesis-aws
            - name: AWS_SECRET_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  key: AWS_SEC_KEY
                  name: log-forwarding-kinesis-aws
          imagePullPolicy: Always
          volumeMounts:
            - name: log-forwarding-kinesis-config
              readOnly: true
              mountPath: /etc/fluent/
            - name: log-forwarding-kinesis-secure
              readOnly: true
              mountPath: /var/run/secrets/fluentd
          terminationMessagePolicy: File
          image: >-
            quay.io/worsco/ocp4-fluentd-kinesis-forwarder:latest
          args:
            - scl
            - enable
            - rh-ruby25
            - "--"
            - fluentd
      volumes:
        - name: log-forwarding-kinesis-config
          configMap:
            name: log-forwarding-kinesis-config
            items:
              - key: td-agent.conf
                path: fluent.conf
            defaultMode: 420
            optional: true
        - name: log-forwarding-kinesis-secure
          secret:
            defaultMode: 420
            secretName: log-forwarding-kinesis-secure
      dnsPolicy: ClusterFirst
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
