apiVersion: apps/v1
kind: Deployment  
metadata:  
  name: foo  
  labels:
    app: foo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: foo
  template:
    metadata:
      labels:
        app: foo
    spec:  
      containers: 
      - name: serve 
        image: davidvu98/protok_serverless:latest
        volumeMounts:
        - name: config-data
          mountPath: /data
        - name: function-logs
          mountPath: /logs
        command: ["sh", "-c", "python http_trigger.py;"]
        ports:
        - containerPort: 8080
      initContainers:
      - name: init-configs
        image: debian
        volumeMounts:
        - name: config-data
          mountPath: /data
        env:
        - name: SERVERLESS_CONFIG
          value: "{}"
        command: ["sh", "-c", "echo -e $SERVERLESS_CONFIG  > /data/config.json"]
      volumes:
      - name: config-data
        emptyDir: {}
      - name: function-logs
        hostPath:
          path: /function_logs
          type: Directory

