---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: openfaas
    component: gateway
  name: gateway
  namespace: "openfaas"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gateway
  template:
    metadata:
      annotations:
        prometheus.io.scrape: "true"
        prometheus.io.port: "8082"
      labels:
        app: gateway
    spec:
      serviceAccountName: openfaas-controller
      volumes:
      - name: faas-netes-temp-volume
        emptyDir: {}
      - name: auth
        secret:
          secretName: basic-auth
      containers:
      - name: gateway
        resources:
            requests:
              cpu: 50m
              memory: 120Mi
        image: ghcr.io/openfaas/gateway:0.20.11
        imagePullPolicy: Always
        securityContext:
          readOnlyRootFilesystem: true
          runAsUser: 10001
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          timeoutSeconds: 5
        readinessProbe:
          httpGet:
            path: /healthz
            port: 8080
          timeoutSeconds: 5
        env:
        - name: read_timeout
          value: "65s"
        - name: write_timeout
          value: "65s"
        - name: upstream_timeout
          value: "60s"
        - name: functions_provider_url
          value: "http://127.0.0.1:8081/"
        - name: direct_functions
          value: "false"
        - name: direct_functions_suffix
          value: "openfaas-fn.svc.cluster.local"
        - name: function_namespace
          value: "openfaas-fn"
        - name: faas_nats_address
          value: "nats.openfaas.svc.cluster.local"
        - name: faas_nats_port
          value: "4222"
        - name: faas_nats_channel
          value: "faas-request"
        - name: basic_auth
          value: "true"
        - name: secret_mount_path
          value: "/var/secrets"
        - name: auth_proxy_url
          value: "http://basic-auth-plugin.openfaas:8080/validate"
        - name: auth_pass_body
          value: "false"
        - name: scale_from_zero
          value: "true"
        - name: max_idle_conns
          value: "1024"
        - name: max_idle_conns_per_host
          value: "1024"
        volumeMounts:
        - name: auth
          readOnly: true
          mountPath: "/var/secrets"
        ports:
        - name: http
          containerPort: 8080
          protocol: TCP
      - name: faas-netes
        resources:
            requests:
              cpu: 50m
              memory: 120Mi
        image: ghcr.io/openfaas/faas-netes:0.13.1
        imagePullPolicy: Always
        securityContext:
          readOnlyRootFilesystem: true
          runAsUser: 10001
        env:
        - name: port
          value: "8081"
        - name: function_namespace
          value: "openfaas-fn"
        - name: read_timeout
          value: "60s"
        - name: profiles_namespace
          value: "openfaas"
        - name: write_timeout
          value: "60s"
        - name: image_pull_policy
          value: "Always"
        - name: http_probe
          value: "true"
        - name: set_nonroot_user
          value: "false"
        - name: readiness_probe_initial_delay_seconds
          value: "2"
        - name: readiness_probe_timeout_seconds
          value: "1"
        - name: readiness_probe_period_seconds
          value: "2"
        - name: liveness_probe_initial_delay_seconds
          value: "2"
        - name: liveness_probe_timeout_seconds
          value: "1"
        - name: liveness_probe_period_seconds
          value: "2"
        - name: cluster_role
          value: "false"
        volumeMounts:
        - mountPath: /tmp
          name: faas-netes-temp-volume
        ports:
        - containerPort: 8081
          protocol: TCP
      nodeSelector:
        beta.kubernetes.io/arch: amd64
