kind: Pod
apiVersion: v1
metadata:
  name: invoker
  labels:
    app: invoker
spec:
  volumes:
    - name: manifest-volume
      configMap:
        name: manifest-configmap
    - name: envoy-volume
      configMap:
        name: envoy-configmap
    - name: secret-volume
      secret:
        secretName: sleep-secret
        optional: true

  containers:
    # for debug only--remove later
    - name: sleep
      image: curlimages/curl
      command: ["/bin/sleep", "3650d"]
      volumeMounts:
      - mountPath: /etc/sleep/tls
        name: secret-volume
      - name: envoy-volume
        mountPath: /etc/envoy
      - name: manifest-volume
        mountPath: /etc/faas

    - name: envoy
      image: docker.io/envoyproxy/envoy:v1.17-latest
      args: [
          "-c", "/etc/envoy/envoy.yaml",
          "-l", "off",
          "--component-log-level", "upstream:debug,connection:trace",
          "--service-node", "front-proxy",
          "--service-cluster", "front-proxy" ]
      ports:
        - name: http
          containerPort: 18000
          protocol: TCP
      resources: { }
      volumeMounts:
        - name: envoy-volume
          mountPath: /etc/envoy
    - name: invoker
      image: materialized-invoker
      #      TODO: pull from manifest.yaml
      env:
        - name: AUTHZ_BASE_URL
          value: http://authz:8081
      ports:
        - name: http
          containerPort: 8080
          protocol: TCP
        - name: envoy-grpc
          containerPort: 9000
          protocol: TCP
      volumeMounts:
        - name: manifest-volume
          mountPath: /etc/faas
