apiVersion: apps/v1
kind: Deployment
metadata:
  name: gestion
  namespace: diaco
  labels:
    run: gestion
spec:
  replicas: 3
  selector:
    matchLabels:
      run: gestion
  template:
    metadata:
      labels:
        run: gestion
    spec:
      dnsPolicy: "None"
      dnsConfig:
        nameservers:
          - 128.5.8.26
        searches:
          - mineco-dev.svc.cluster.local
          - svc.cluster.local 
          - cluster.local
      containers:
      - name: gestion
        image: jjolon/gestion:v1.1
        # image: jjolon/gestion:v1.2
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 80
            protocol: TCP
          - containerPort: 25
            protocol: TCP
          - containerPort: 587
            protocol: TCP
          # - containerPort: 443
          #   protocol: TCP
        volumeMounts:
            - mountPath: "/var/www/html"
              name: vol-gestion
      # command: ["/usr/local/bin/php", "artisan", "horizon lifecycle: preStop: exec: command: ["/usr/local/bin/php", "artisan", "horizon:terminate"]
      volumes:
        - name: vol-gestion
          persistentVolumeClaim:
            claimName: gestion