apiVersion: v1
kind: ConfigMap
metadata:
  name: porter2k8s
data:
  SIDECAR: |
    apiVersion: v1
    kind: Pod
    metadata:
      labels:
        app: sas
        service: sas
      name: sas-fluent-bit
    spec:
      containers:
      - env:
        - name: TAIL_BUF_LIMIT
          value: '{{ default "145MB" .LOGGING_TAIL_BUF_LIMIT }}'
        - name: SPLUNK_SOURCETYPE
          value: '{{ default "dc-k8s-asr" .LOGGING_SOURCETYPE }}'
        - name: SPLUNK_INDEX
          valueFrom:
            configMapKeyRef:
              key: SPLUNK_INDEX
              name: porter2k8s
        - name: SPLUNK_TOKEN
          valueFrom:
            secretKeyRef:
              key: token
              name: splunk
        - name: SPLUNK_HOST
          value: splunk-us-hec-external.adobelaas.com
        - name: SPLUNK_PORT
          value: "443"
        - name: SPLUNK_TLS
          value: "On"
        - name: SPLUNK_TLS_VERIFY
          value: "On"
        - name: SPLUNK_SEND_RAW
          value: "On"
        - name: POD_UID
          valueFrom:
            fieldRef:
              fieldPath: metadata.uid
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: NODE_IP
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: APP_LABEL
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['app']
        - name: SERVICE_LABEL
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['service']
        image: fluent/fluent-bit:1.4-debug
        name: fluent-bit
        ports:
        - containerPort: 2020
        resources:
          limits:
            cpu: 0.1
            memory: 500Mi
          requests:
            cpu: 0.1
            memory: 20Mi
        volumeMounts:
        - mountPath: /logging-volume
          name: logging-volume
        - mountPath: /var/fluent-bit
          name: fluent-data
        - mountPath: /fluent-bit/etc
          name: fluent-bit-config
      volumes:
      - emptyDir: {}
        name: logging-volume
      - emptyDir: {}
        name: fluent-data
      - configMap:
          name: fluent-bit-sidecar-config
        name: fluent-bit-config
