apiVersion: apps/v1
kind: Deployment
metadata:
  name: devops-test
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: devops-test
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: devops-test
    spec:
      containers:
      - name: devops-hello-world
        image: hello-world
        imagePullPolicy: Never
        env:
        - name: JAVA_OPTS
          value: "-Xmx12g -Xms12g"
        ports:
        - containerPort: 8080
          protocol: TCP
        resources:
          limits:
            memory: 2Gi
          requests:
            memory: 2Gi
        livenessProbe:
          httpGet:
            path: /health
            port: http
          initialDelaySeconds: 60
          periodSeconds: 3600
        readinessProbe:
          httpGet:
            path: /health
            port: http
          initialDelaySeconds: 60
          periodSeconds: 3600
        volumeMounts:
          - name: config-volume
            mountPath: /opt/config/application.properties
            subPath: application.properties
