---
apiVersion: v1
kind: Service
metadata:
  name: logstash
  namespace: edoc2
  labels:
    app: logstash
    k8s-app: logstash
spec:
  ports:
  - name: logstash
    port: 5044
    targetPort: 5044
    protocol: TCP
  selector:
    app: logstash
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: logstash
  namespace: edoc2
  labels:
    app: logstash
    k8s-app: logstash
spec:
  replicas: 1
  revisionHistoryLimit: 5
  selector:
    matchLabels:
      app: logstash
  template:
    metadata:
      labels:
        app: logstash
    spec:
      hostname: logstash
      terminationGracePeriodSeconds: 30
      containers:
      - name: logstash
        #image: registry.edoc2.com:5000/edoc2v5/logstash:ecm-apm-v6.5.0.0
        image: registry.edoc2.com:5000/edoc2v5/logstash:v6.7.1.16
        imagePullPolicy: IfNotPresent
        env:
        - name: CONTAINER_PLATFORM
          value: "kubernetes"
        - name: LS_JAVA_OPTS
          value: "-Xms1g -Xmx1g"
        - name: COLLECT_LOG_SERVICES
          value: '["edoc2","content","unionsync","orgsync","transport","regionsync","decryption","edrms","inbiz","auth","perm","org"]'
        - name: API_LOG_MODULE
          value: '["WebAPI","CoreAPI","DB","EDoc2.PermCtrl","EDoc2.Cache","EDRMS-DB","EDRMS-WEBAPI"]'
        ports:
        - name: logstash
          protocol: TCP
          containerPort: 5044
        # volumeMounts:
        # - mountPath: /edoc2Docs
        # name: edoc2doc
      restartPolicy: Always
      # volumes:
      # - name: edoc2doc
      #     server: 192.168.251.161
      #     path: /data/nfs/edoc2Docs
