apiVersion: apps/v1
kind: Deployment
metadata:
  name: dept-spring
  labels:
    app: dept-spring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dept-spring
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: dept-spring
    spec:
      containers:
      - name: dept-spring
        image: htdp1/dept-spring:v2
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: tomcat
        volumeMounts: 
        - name: application-properties
          mountPath: "/config"
          readOnly: true
        resources:
          limits:
            cpu: 1000m
            memory: 512Mi
          requests:
            cpu: 300m
            memory: 256Mi
        livenessProbe:
          httpGet:
            path: /dept-spring/actuator/info
            port: tomcat
          initialDelaySeconds: 5
          periodSeconds: 60
        readinessProbe:
          httpGet:
            path: /dept-spring/actuator/info
            port: tomcat
          initialDelaySeconds: 30
          periodSeconds: 5
      volumes:
      - name: application-properties
        configMap:
          name: dept-spring
          items:
          - key: application.yml
            path: application.yml
          - key: application-redis.yml
            path: application-redis.yml
          - key: application-apis.yml
            path: application-apis.yml
          - key: application-mariadb.yml
            path: application-mariadb.yml            