apiVersion: apps/v1
kind: Deployment
metadata:
  name: portfolio-api-deployment
spec:
  replicas: 3
  template:
    metadata:
      name: portfolio-api
      labels:
        app: portfolio-api
    spec:
      containers:
        - name: portfolio-api-container
          image: rubenskj/portfolio-api:v1.0.3
          ports:
            - containerPort: 8080
          envFrom:
            - configMapRef:
                name: portfolio-api-config-map
          livenessProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            periodSeconds: 20
            failureThreshold: 3
            initialDelaySeconds: 120
          readinessProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            periodSeconds: 20
            failureThreshold: 3
            initialDelaySeconds: 120
          resources:
            limits:
              cpu: 1000m
              memory: 5Gi
            requests:
              cpu: 200m
  selector:
    matchLabels:
      app: portfolio-api
