
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress
  namespace: test
  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"
        # dummy port to exclude ingress from mesh traffic
        # only egress should go over the mesh
        appmesh.k8s.aws/ports: "444"
    spec:
      terminationGracePeriodSeconds: 30
      containers:
        - name: ingress
          image: "envoyproxy/envoy-alpine:d920944aed67425f91fc203774aebce9609e5d9a"
          securityContext:
            capabilities:
              drop:
                - ALL
              add:
                - NET_BIND_SERVICE
          command:
            - /usr/bin/dumb-init
            - --
          args:
            - /usr/local/bin/envoy
            - --base-id 30
            - --v2-config-only
            - -l
            - $loglevel
            - -c
            - /config/envoy.yaml
          ports:
            - name: admin
              containerPort: 9999
              protocol: TCP
            - name: http
              containerPort: 80
              protocol: TCP
            - name: https
              containerPort: 443
              protocol: TCP
          livenessProbe:
            initialDelaySeconds: 5
            tcpSocket:
              port: admin
          readinessProbe:
            initialDelaySeconds: 5
            tcpSocket:
              port: admin
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
          volumeMounts:
            - name: config
              mountPath: /config
      volumes:
        - name: config
          configMap:
            name: ingress-config

