---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gateway
  namespace: openfaas
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gateway
  template:
    metadata:
      labels:
        app: gateway
      annotations:
        prometheus.io.scrape: 'true'
    spec:
      serviceAccountName: openfaas-operator
      containers:
      - name: gateway
        image: functions/gateway:0.8.2
        imagePullPolicy: Always
        env:
        - name: functions_provider_url
          value: "http://localhost:8081/"
        - name: faas_nats_address
          value: "nats.openfaas"
        - name: faas_nats_port
          value: "4222"
        - name: read_timeout
          value: "20s"
        - name: write_timeout
          value: "20s"
        - name: direct_functions
          value: "true"
        - name: direct_functions_suffix
          value: "openfaas-fn.svc.cluster.local."
        ports:
        - containerPort: 8080
          protocol: TCP
        resources:
          limits:
            memory: 512Mi
      - name: operator
        image: functions/openfaas-operator:0.7.1
        imagePullPolicy: Always
        command:
          - ./openfaas-operator
          - -logtostderr
          - -v=2
        env:
        - name: function_namespace
          value: openfaas-fn
        ports:
        - containerPort: 8081
          protocol: TCP
        resources:
          limits:
            memory: 512Mi
