apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: presto-coordinator
  labels:
    unit: coordinator
spec:
  serviceName: presto-coordinator
  podManagementPolicy: Parallel
  selector:
    matchLabels:
      unit: coordinator
  template:
    metadata:
      labels:
        unit: coordinator
    spec:
      serviceAccountName: presto-sa
      containers:
      - name: presto-coordinator
        image: mpolatcan/presto:344-java11
        imagePullPolicy: Always
        envFrom:
          - configMapRef:
              name: presto-coordinator-config
        readinessProbe:
          exec:
            command:
              - /bin/bash
              - -c
              - /home/presto/presto_coordinator_leader_elector.sh
          periodSeconds: 5
          initialDelaySeconds: 5
        ports:
        - containerPort: 8080
      securityContext:
        fsGroup: 1000
