apiVersion: apps/v1
kind: Deployment
metadata:
  name: tfm-elasticsearch
  namespace: tfm-logging
spec:
  selector:
    matchLabels:
      app: tfm-elasticsearch
  template:
    metadata:
      labels:
        app: tfm-elasticsearch
    spec:
      containers:
        - name: tfm-elasticsearch
          image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
          env:
            - name: discovery.type
              value: single-node
            - name: ES_JAVA_OPTS
              value: "-Xms1g -Xmx1g"
          ports:
            - containerPort: 9200
              name: http
              protocol: TCP
            - containerPort: 9300
              name: inter-node
              protocol: TCP
          resources:
            limits:
              cpu: 1000m
              memory: 1.5Gi
            requests:
              cpu: 500m
              memory: 1Gi
          volumeMounts:
            - name: tfm-elasticsearch-volume
              mountPath: /usr/share/elasticsearch/data
      volumes:
        - name: tfm-elasticsearch-volume
          persistentVolumeClaim:
            claimName: tfm-elasticsearch-pvc
