apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress
  namespace: demo
  labels:
    app: ingress
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ingress
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: ingress
      annotations:
        prometheus.io/path: "/stats/prometheus"
        prometheus.io/port: "9999"
        prometheus.io/scrape: "true"
        # exclude ingress ports from App Mesh
        appmesh.k8s.aws/ports: "444"
        revision: "v1.11.1-test.1"
    spec:
      terminationGracePeriodSeconds: 30
      containers:
        - name: ingress
          image: "envoyproxy/envoy-alpine:v1.11.1"
          securityContext:
            capabilities:
              drop:
                - ALL
              add:
                - NET_BIND_SERVICE
          command:
            - /usr/local/bin/envoy
          args:
            - -l
            - $loglevel
            - -c
            - /config/envoy.yaml
            - --base-id
            - "1234"
          ports:
            - name: admin
              containerPort: 9999
              protocol: TCP
            - name: http
              containerPort: 8080
              protocol: TCP
          livenessProbe:
            initialDelaySeconds: 5
            tcpSocket:
              port: admin
          readinessProbe:
            initialDelaySeconds: 5
            tcpSocket:
              port: admin
          resources:
            requests:
              cpu: 10m
              memory: 64Mi
          volumeMounts:
            - name: envoy-config
              mountPath: /config
      volumes:
        - name: envoy-config
          configMap:
            name: ingress
