apiVersion: apps/v1
kind: Deployment
metadata:
  name: employees
  labels:
    app: employees
spec:
  replicas: 1
  selector:
    matchLabels:
      app: employees
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: employees
    spec:
      containers:
        - name: employees
          image: nogada/employees
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              cpu: 1
              # memory: 512Mi
            requests:
              cpu: 50m
              # memory: 256Mi
          livenessProbe:
            httpGet:
              path: /liveness
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 10
            failureThreshold: 3
            timeoutSeconds: 1 # default 1s
            successThreshold: 1 # default 1s
          readinessProbe:
            httpGet:
              path: /readiness
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 10
            failureThreshold: 3
            timeoutSeconds: 1 # default 1s 
            successThreshold: 1 # default 1s
          volumeMounts:
          - name: spring-properties
            mountPath: /app/config
      volumes:
      - name: spring-properties
        configMap:
          name: config