apiVersion: apps/v1
kind: Deployment
metadata:
  name: coit-backend1
  labels:
    app: coit-backend1
spec:
  selector:
    matchLabels:
      app: coit-backend1
  replicas: 3
  minReadySeconds: 15
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  template:
    metadata:
      labels:
        app: coit-backend1
    spec:
      containers:
      - image: coitlearning/coit-backend1:latest
        imagePullPolicy: IfNotPresent
        name: coit-backend1
        env:
          - name: SA_LOGIC_API_URL
            valueFrom:
              configMapKeyRef:
                name: coit-backend1-config
                key: python_url
          - name: SMS_PROVIDER_API_URL
            valueFrom:
              configMapKeyRef:
                name: coit-backend1-config
                key: sms_provider
          - name: SMS_PROVIDER_USERNAME
            valueFrom:
              secretKeyRef:
                name: coit-backend1-secrets
                key: username
          - name: SMS_PROVIDER_PASSWORD
            valueFrom:
              secretKeyRef:
                name: coit-backend1-secrets
                key: password
        ports:
          - containerPort: 8080