---
apiVersion: v1
kind: Service
metadata:
  name: web
  labels:
    app: web
spec:
  clusterIP: None
  selector:
    app: web
  ports:
    - port: 3000
      name: web
      protocol: TCP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: web
spec:
  selector:
    matchLabels:
      app: web
  serviceName: web
  template:
    metadata:
      labels:
        app: web
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 0
      containers:
        - name: web
          image: web:latest
          # entrypoint set dynamically in Tiltfile
          readinessProbe:
            tcpSocket:
              port: 3000
            periodSeconds: 1
            failureThreshold: 300
          ports:
            - containerPort: 3000
              name: web
              protocol: TCP
