apiVersion: apps/v1
kind: Deployment
metadata:
  name: worker
  labels:
    app: challenge
spec:
  replicas: 3
  selector:
    matchLabels:
      app: challenge
  template:
    metadata:
      labels:
        app: challenge
    spec:
      containers:
        - name: challenge
          image: marcoshuck/adder
          imagePullPolicy: Always
          env:
            - name: DATABASE_HOST
              value: mysql-0:3306
          ports:
            - containerPort: 3000
          readinessProbe:
            tcpSocket:
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /healtz
              port: 3000
            initialDelaySeconds: 15
            periodSeconds: 20