
apiVersion: apps/v1
kind: Deployment

metadata:
  name: nginx-ingress
  labels:
    app: nginx-ingress

spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-ingress

  # The PodTemplate
  template:
    metadata:
      labels:
        app: nginx-ingress

    # The Pod
    spec:

      containers:
      - name: nginx-ingress
        image: briancsparks/quicknet-k8s-nginx-ingress
        command: ["/usr/bin/auto-reload-nginx"]
        args: ["-g", "daemon off;"]

        ports:
        - containerPort: 80
        - containerPort: 443

        livenessProbe:
          httpGet:
            path: /index.html
            port: 80
          initialDelaySeconds: 30
          timeoutSeconds: 1

        lifecycle:
          preStop:
            exec:
              command: ["/usr/bin/nginx", "-s", "quit"]

        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"

        volumeMounts:
          - mountPath: /etc/nginx/conf.d
            name: nginxconfig-volume

          - mountPath: /etc/nginx/ssl/server
            name: cert-volume

          - mountPath: /etc/nginx/ssl/server-1
            name: cert-volume-1

          - mountPath: /etc/nginx/ssl/server-2
            name: cert-volume-2

          - mountPath: /etc/nginx/ssl/server-3
            name: cert-volume-3

          - mountPath: /etc/nginx/ssl/server-4
            name: cert-volume-4

          - mountPath: /etc/nginx/ssl/server-5
            name: cert-volume-5

          - mountPath: /etc/nginx/ssl/server-6
            name: cert-volume-6

          - mountPath: /etc/nginx/ssl/server-7
            name: cert-volume-7

          - mountPath: /etc/nginx/ssl/server-8
            name: cert-volume-8

          - mountPath: /etc/nginx/ssl/server-9
            name: cert-volume-9

          - mountPath: /etc/nginx/ssl/client-cert-1
            name: client-cert-volume-1

          - mountPath: /etc/nginx/ssl/client-cert-2
            name: client-cert-volume-2

          - mountPath: /etc/nginx/ssl/client-cert-3
            name: client-cert-volume-3

          - mountPath: /etc/nginx/ssl/client-cert-4
            name: client-cert-volume-4

          - mountPath: /etc/nginx/ssl/client-cert-5
            name: client-cert-volume-5

          - mountPath: /etc/nginx/ssl/client-cert-6
            name: client-cert-volume-6

          - mountPath: /etc/nginx/ssl/client-cert-7
            name: client-cert-volume-7

          - mountPath: /etc/nginx/ssl/client-cert-8
            name: client-cert-volume-8

          - mountPath: /etc/nginx/ssl/client-cert-9
            name: client-cert-volume-9

      volumes:
        - name: nginxconfig-volume
          configMap:
            name: nginxconfig

        - name: cert-volume
          secret:
            secretName: nginxcert

        - name: cert-volume-1
          secret:
            secretName: nginxcert-1

        - name: cert-volume-2
          secret:
            secretName: nginxcert-2

        - name: cert-volume-3
          secret:
            secretName: nginxcert-3

        - name: cert-volume-4
          secret:
            secretName: nginxcert-4

        - name: cert-volume-5
          secret:
            secretName: nginxcert-5

        - name: cert-volume-6
          secret:
            secretName: nginxcert-6

        - name: cert-volume-7
          secret:
            secretName: nginxcert-7

        - name: cert-volume-8
          secret:
            secretName: nginxcert-8

        - name: cert-volume-9
          secret:
            secretName: nginxcert-9

        - name: client-cert-volume-1
          secret:
            secretName: nginxclientcert-1

        - name: client-cert-volume-2
          secret:
            secretName: nginxclientcert-2

        - name: client-cert-volume-3
          secret:
            secretName: nginxclientcert-3

        - name: client-cert-volume-4
          secret:
            secretName: nginxclientcert-4

        - name: client-cert-volume-5
          secret:
            secretName: nginxclientcert-5

        - name: client-cert-volume-6
          secret:
            secretName: nginxclientcert-6

        - name: client-cert-volume-7
          secret:
            secretName: nginxclientcert-7

        - name: client-cert-volume-8
          secret:
            secretName: nginxclientcert-8

        - name: client-cert-volume-9
          secret:
            secretName: nginxclientcert-9





