# Create the actual deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: contour
  namespace: heptio-contour
  labels:
    app: contour
spec:
  replicas: 1
  selector:
    matchLabels:
      app: contour
  template:
    metadata:
      labels:
        app: contour
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8002"
        prometheus.io/path: "/stats"
        prometheus.io/format: "prometheus"
    spec:
      containers:
      - image: docker.io/envoyproxy/envoy-alpine:v1.6.0
        name: envoy-envoyingressv1
        ports:
        - containerPort: 80
          name: http
        - containerPort: 8002
          name: statsd
        command: ["envoy"]
        args: ["-c", "/config/contour.yaml", "--service-cluster", "cluster0", "--service-node", "node0"]
        volumeMounts:
        - name: contour-config
          mountPath: /config
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
          limits:
            cpu: 100m
            memory: 100Mi
      - image: gcr.io/heptio-images/contour:v0.6.1
        imagePullPolicy: Always
        ports:
        - containerPort: 8000
          name: contour
        name: contour-unknown
        command: ["contour"]
        args: ["serve", "--incluster", "--envoy-http-port=80", "--debug-http-port=6069"]
      initContainers:
      - image: gcr.io/heptio-images/contour:v0.6.1
        imagePullPolicy: Always
        name: envoy-initconfig
        command: ["contour"]
        args: ["bootstrap", "/config/contour.yaml", "--statsd-enabled"]
        volumeMounts:
        - name: contour-config
          mountPath: /config
      volumes:
      - name: contour-config
        emptyDir: {}
      dnsPolicy: ClusterFirst
      serviceAccountName: contour
      terminationGracePeriodSeconds: 30
