# Simple Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  generation: 1
  labels:
    app: eni-todo
  name: eni-todo
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: eni-todo
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: eni-todo
    spec:
      containers:
      - image: eni-todo:tomcat-mariadb-env
        # ou image : registry.diehard.net:5000/tomcat-eni-todo:dev
        imagePullPolicy: IfNotPresent
        name: eni-todo
        env:
        - name: SPRING_PROFILES_ACTIVE
          value: "tomcat-mariadb-env"
        - name: DB_DTB_USERNAME
          value: "springuser"
        - name: DB_DTB_PASSWORD
          value: "mypassword-quoor-uHoe7z"
        - name: DB_DTB_JDBC_URL
          value: "jdbc:mysql://mariadb-0.mariadb:3306/db_todo"
        - name: MULTIPART_LOCATION
          value: "/usr/local/tomcat/files"
        ports:
        - name: http8080 
          containerPort: 8080
          protocol: TCP
        startupProbe: 
          httpGet:
            #host: 127.0.0.1
            path: "/eni-todo"
            port: 8080
            scheme : "HTTP"
            httpHeaders :
                - name : "x-kubeprob-header"
                  value : "startupProbe"
          initialDelaySeconds : 300 
          failureThreshold : 3 
          periodSeconds : 30
          successThreshold : 1
          timeoutSeconds : 2
        livenessProbe : 
          httpGet:
            path: "/eni-todo"
            port: 8080
            scheme : "HTTP"
            httpHeaders :
                - name : "x-kubeprob-header"
                  value : "startupProbe"
          initialDelaySeconds : 300 
          failureThreshold : 3 
          periodSeconds : 30
          successThreshold : 1
          timeoutSeconds : 2
        readinessProbe: 
          httpGet:
            path: "/eni-todo"
            port: 8080
            scheme : "HTTP"
            httpHeaders :
                - name : "x-kubeprob-header"
                  value : "startupProbe"
          initialDelaySeconds : 300 
          failureThreshold : 3 
          periodSeconds : 30
          successThreshold : 1
          timeoutSeconds : 2
        resources:
          requests:
            cpu : "500m"
            memory: "512Mi"
          limits:
            cpu : "2000m"
            memory: "512Mi"