apiVersion: apps/v1
kind: Deployment
metadata:
  name: fishky-flashcard-service
spec:
  selector:
    matchLabels:
      app: fishky-flashcard-service
      tier: backend
  replicas: 3
  template:
    metadata:
      labels:
        app: fishky-flashcard-service
        tier: backend
    spec:
      containers:
      - name: fishky-flashcard-service
        image: damianiero/fishky-flashcard-service:0.14.1
        env:
        - name: GET_HOSTS_FROM
          value: dns
        - name: MONGODB-URI
          valueFrom:
            secretKeyRef:
              name: fishky-mongo-secret
              key: mongodb.uri
        ports:
        - containerPort: 8080
        readinessProbe:
          httpGet:
            path: /healthCheck
            port: 8080
          initialDelaySeconds: 60
          timeoutSeconds: 2
          periodSeconds: 3
          failureThreshold: 2
        livenessProbe:
          httpGet:
            path: /healthCheck
            port: 8080
          initialDelaySeconds: 90
          timeoutSeconds: 2
          periodSeconds: 8
          failureThreshold: 1