apiVersion: apps/v1
kind: Deployment
metadata:
  name: elasticsearch
  labels:
    app: elasticsearch
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elasticsearch
  template:
    metadata:
      labels:
        app: elasticsearch
    spec:
      containers:
        - image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
          name: elasticsearch
          env:
            - name: "discovery.type"
              value: "single-node"
            - name: "xpack.security.enabled"
              value: "false"
          ports:
            - containerPort: 9200
              name: elasticsearch
          volumeMounts:
            - name: data
              mountPath: /var/lib/elasticsearch
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: elasticsearch
