apiVersion: apps/v1
kind: Deployment
metadata:
  name: elasticsearch-deployment
  labels:
    env: production
    tier: backend
    app: elasticsearch
    name: elasticsearch-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      env: production
      tier: backend
      app: elasticsearch
      name: elasticsearch-pod
  template:
    metadata:
      labels:
        env: production
        tier: backend
        app: elasticsearch
        name: elasticsearch-pod
    spec:
      containers:
      - name: elasticsearch
        image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
        imagePullPolicy: Always
        env:
          - name: discovery.type
            value: single-node
          - name: ES_JAVA_OPTS
            value: "-Xms512m -Xmx512m"
          - name: TZ
            valueFrom:
              configMapKeyRef:
                name: common-configmap
                key: TZ
        ports:
        - containerPort: 9200
          name: http
        - containerPort: 9300
          name: tcp