apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: infra
  name: proxy
  labels:
    name: proxy
    namespace: infra
spec:
  replicas: 2
  revisionHistoryLimit: 2
  strategy:
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 100%
  selector:
    matchLabels:
      app: proxy
  template:
    metadata:
      labels:
        app: proxy
        name: proxy
        namespace: infra
    spec:
      containers:
        - name: proxy
          image: 'nginx:1.13-alpine'
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
            - name: https
              containerPort: 443
              protocol: TCP
          resources:
            requests:
              memory: 50Mi
              cpu: 100m
            limits:
              memory: 200Mi
              cpu: 200m
          volumeMounts:
            - name: config-files
              mountPath: /etc/nginx
            - name: cert-files
              mountPath: /etc/nginx/cert
      volumes:
        - name: config-files
          configMap:
            name: nginx-files
            items:
              - key: nginx.conf
                path: nginx.conf
              - key: mime.types
                path: mime.types
        - name: cert-files
          secret:
            secretName: ssl
  progressDeadlineSeconds: 30
  minReadySeconds: 10
