
apiVersion: apps/v1
kind: Deployment
metadata:
  name: edfi-api
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: edfi-api
  template:
    metadata:
      labels:
        app: edfi-api
    spec:
      containers:
      - name: edfi-api
        image: edfialliance/ods-api-web-api:v2.1.0
        resources:
          limits:
            memory: "2Gi"
            cpu: "2"
        readinessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 15
          periodSeconds: 20
        env:
          - name: POSTGRES_USER
            valueFrom:
              secretKeyRef:
                name: cloud-sql-creds
                key: username
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: cloud-sql-creds
                key: password
          - name: POSTGRES_PORT
            value: "5432"
          - name: ODS_POSTGRES_HOST
            value: pgbouncer-service.default.svc.cluster.local
          - name: ADMIN_POSTGRES_HOST
            value: pgbouncer-service.default.svc.cluster.local
          - name: ApiSettings__PathBase
            value: pgbouncer-service.default.svc.cluster.local
          - name: ODS_WAIT_POSTGRES_HOSTS
            value: "pgbouncer-service.default.svc.cluster.local "
          - name: API_MODE
            value: "YearSpecific"
          - name: TPDM_ENABLED
            value: "true"
        ports:
          - containerPort: 80
