apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: es
  namespace: es
spec:
  selector:
    matchLabels:
      app: es # has to match .spec.template.metadata.labels
  serviceName: "es"
  replicas: 1 # by default is 1
  template:
    metadata:
      labels:
        app: es # has to match .spec.selector.matchLabels
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: es
        image: docker.elastic.co/elasticsearch/elasticsearch:7.11.1
        env:
        - name: discovery.type
          value: "single-node"
        ports:
        - containerPort: 9200
          name: tcp
          protocol: TCP
