apiVersion: v1 kind: PersistentVolumeClaim metadata: name: temporal-elasticsearch-pvc namespace: temporal spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi --- apiVersion: apps/v1 kind: StatefulSet metadata: name: temporal-elasticsearch namespace: temporal labels: app: temporal-elasticsearch spec: serviceName: temporal-elasticsearch replicas: 1 selector: matchLabels: app: temporal-elasticsearch template: metadata: labels: app: temporal-elasticsearch spec: containers: - name: elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0 ports: - name: http containerPort: 9200 protocol: TCP - name: transport containerPort: 9300 protocol: TCP env: - name: discovery.type value: single-node - name: ES_JAVA_OPTS value: "-Xms512m -Xmx512m" - name: xpack.security.enabled value: "false" volumeMounts: - name: elasticsearch-storage mountPath: /usr/share/elasticsearch/data resources: requests: cpu: 250m memory: 512Mi limits: cpu: 500m memory: 1Gi livenessProbe: httpGet: path: /_cluster/health port: 9200 initialDelaySeconds: 60 periodSeconds: 10 readinessProbe: httpGet: path: /_cluster/health port: 9200 initialDelaySeconds: 30 periodSeconds: 5 volumeClaimTemplates: - metadata: name: elasticsearch-storage spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 20Gi --- apiVersion: v1 kind: Service metadata: name: temporal-elasticsearch namespace: temporal labels: app: temporal-elasticsearch spec: type: ClusterIP clusterIP: None # Headless service for StatefulSet ports: - port: 9200 targetPort: 9200 protocol: TCP name: http - port: 9300 targetPort: 9300 protocol: TCP name: transport selector: app: temporal-elasticsearch