apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: dev-to
  labels:
    app: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
      metadata:
        labels:
          app: myapp
      spec:
        containers:
          - name: myapp
            image: java-k8s:latest
            imagePullPolicy: Never
            ports:
              - containerPort: 8080
                name: http
            envFrom:
              - configMapRef:
                  name: myapp
            livenessProbe:
              httpGet:
                path: /app/actuator/health/liveness
                port: 8080
              initialDelaySeconds: 180 # aumento do tempo para compensar limitações da VM
            readinessProbe:
              httpGet:
                path: /app/actuator/health/readiness
                port: 8080
              initialDelaySeconds: 180 # aumento do tempo para compensar limitações da VM
            resources:
              requests:
                memory: "512Mi"
                cpu: "0.5"
              limits:
                memory: "1024Mi"
                cpu: "1"

