apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-template
  labels: 
    app: api-name
    
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api-name
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: edgemicro
        port-8080: non #Important, used for traefik network policy
    spec:
      containers:
        - name: api-name
          image: 'my-container-registry/organization/image-name:tag'
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
              protocol: TCP
          resources:
            limits:
              cpu: 500m
              memory: 1Gi
            requests:
              cpu: 250m
              memory: 500M
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          
#          readinessProbe:
#            httpGet:
#                path: /version
#                port: 8080
#            initalDelaySeconds: 30
#            periodSeconds: 10
#            failureThreshold: 21

#          livenessProbe:
#            httpGet:
#                path: /api/healthy
#                port: 8080
#            initalDelaySeconds: 240
#            periodSeconds: 15
#            failureThreshold: 4
            
          envFrom:
          - configMapRef:
                name: api-config              
          
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 60

