apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    role: logstash
    name: logstash
    service: logging
  name: logstash
spec:
  replicas: 1
  selector:
    matchLabels:
      role: logstash
  template:
    metadata:
      labels:
        role: logstash
        name: logstash
        service: logging
    spec:
      containers:
        - name: logstash
          image: docker.elastic.co/logstash/logstash:7.10.2
          env:
            - name: LS_JAVA_OPTS
              value: -Xmx256m -Xms256m
          ports:
            - containerPort: 5000
          volumeMounts:
            - name: yml-config-volume
              mountPath: /usr/share/logstash/config/logstash.yml
              subPath: logstash.yml
            - name: conf-config-volume
              mountPath: /usr/share/logstash/pipeline/
      volumes:
        - name: yml-config-volume
          configMap:
            name: logstash-config-yml
        - name: conf-config-volume
          configMap:
            name: logstash-config-conf