apiVersion: apps/v1
kind: Deployment
metadata:
  name: downdetector
spec:
  replicas: 1
  selector:
    matchLabels:
      app: downdetector
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: downdetector
    spec:
      containers:
        - name: downdetector
          image: eve0415/downdetector:latest
          imagePullPolicy: Always
          resources:
            limits:
              memory: "1G"
              cpu: "1000m"
          env:
            - name: DISCORD_TOKEN
              valueFrom:
                secretKeyRef:
                  name: discord
                  key: token
            - name: DATABASE_HOST
              value: postgres
            - name: POSTGRES_USER
              valueFrom:
                secretKeyRef:
                  name: postgres
                  key: user
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres
                  key: password
