apiVersion: apps/v1
kind: Deployment
metadata:
  name: elasticsearch
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elasticsearch
  template:
    metadata:
      labels:
        app: elasticsearch
    spec:
      containers:
      - name: elasticsearch
        image: docker.elastic.co/elasticsearch/elasticsearch:7.4.1
        ports:
        - containerPort: 9200
          name: rest
          protocol: TCP
        env:
          - name: cluster.name
            value: workflows
          - name: node.name
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: discovery.type
            value: single-node