apiVersion: apps/v1
kind: Deployment
metadata:
  name: cms-php-app
  labels:
    app: cms-php
spec:
  replicas: 1
  revisionHistoryLimit: 1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 50%
  selector:
    matchLabels:
      app: cms-php
  template:
    metadata:
      labels:
        app: cms-php
    spec:      
      containers:
        - name: cms-php-app
          image: 192.168.100.27:5500/cms-php:test
          imagePullPolicy: Always
          env:
            - name: ASPNETCORE_ENVIRONMENT
              value: Development
          resources:
            limits:
              cpu: "250m"
              memory: "150M"
            requests:
              cpu: "250m"
              memory: "150M"
          livenessProbe:
            tcpSocket:
              port: 80
            initialDelaySeconds: 15
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            tcpSocket:
              port: 80
            initialDelaySeconds: 15
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 3
          ports:
            - containerPort: 80
          volumeMounts:
            - mountPath: /var/www/html/storage/logs
              name: cms-logs
            - mountPath: /var/www/html/.env
              name: cms-env
      volumes:
        - name: cms-logs
          hostPath:
            path: /home/storage/test/shared/logs/cmsphp-logs
            type: Directory
        - name: cms-env
          hostPath:
            path: /home/service-configs/test/cms-php.env
            type: FileOrCreate
      imagePullSecrets:
        - name: regcred
