apiVersion: apps/v1
kind: Deployment
metadata:
  name: cal-ossp
  labels:
    app: ossp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ossp
  template:
    metadata:
      labels:
        app: ossp
    spec:
      serviceAccountName: cal-fluentd-elasticsearch
      containers:
      - image: ossp:latest
        imagePullPolicy: Never
        name: ossp
        ports:
        - containerPort: 50088
          protocol: TCP
      - name: fluentd
        image: gcr.io/fluentd-elasticsearch/fluentd:v2.5.2
        env:
          - name:  FLUENTD_ARGS
            value: -c /fluentd/etc/fluentd-sidecar.conf
        volumeMounts:
        - name: fluentd-sidecar
          mountPath: /fluentd/etc
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: varlog
          mountPath: /var/log
      volumes:
      - name: fluentd-sidecar
        configMap:
          name: fluentd-sidecar
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: varlog
        hostPath:
          path: /var/log
