apiVersion: apps/v1
kind: Deployment
metadata:
  name: exams
  labels:
    app: exams
spec:
  selector:
    matchLabels:
      app: exams
  replicas: 1
  template:
    metadata:
      labels:
        app: exams
    spec:
      containers:
        - name: exams
          image: randomcitizen1705/exam-mongodb:0.01
          ports:
          - containerPort: 8080
            name: http
            protocol: TCP
          # livenessProbe:
          #   exec:
          #    command:
          #    - /bin/bash
          #    - /installer/health_check.sh
          #   failureThreshold: 3
          #   periodSeconds: 5
          #   successThreshold: 1
          #   timeoutSeconds: 2
          #   initialDelaySeconds: 30
          # readinessProbe:
          #   exec:
          #    command:
          #    - /bin/bash
          #    - /installer/health_check.sh
          #   failureThreshold: 1
          #   periodSeconds: 5
          #   successThreshold: 1
          #   timeoutSeconds: 10
          #   initialDelaySeconds: 10
          # resources:
          #   requests:
          #     memory: 100Mi
          #     cpu: 0.1
          #   limits:
          #     memory: 500Mi
          #     cpu: 0.5
          env:
          - name: "SPRING_DATA_MONGODB_HOST"
            value: "mongodb-svc"
          - name: "SPRING_DATA_MONGODB_PORT"
            value: "27017"
          - name: "SPRING_DATA_MONGODB_DATABASE"
            value: "TestSubmDB"
          - name: "SPRING_MAIL_HOST"
            value: "mail.hosts.pk"
          - name: "SPRING_MAIL_PORT"
            value: "587"
          - name: "SPRING_MAIL_USERNAME"
            value: "k8test@hosts.pk"
          - name: "SPRING_MAIL_PASSWORD"
            valueFrom:
              secretKeyRef:
                key: SPRING_MAIL_PASSWORD
                name: exams-secret
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate