eu-nebulous / optimiser-controller

Mozilla Public License 2.0
0 stars 0 forks source link

Implement serverless support #14

Closed rudi closed 1 month ago

rudi commented 1 month ago

The following kubevela file defines one component of type: serverless-platform that will run all components with type: knative-serving. The optimiser-controller should create the machine(s) for this component, and add nodeAffinity traits on all components with type: knative-serving to run on machines tagged appropriately.

apiVersion: [core.oam.dev/v1beta1](http://core.oam.dev/v1beta1)
kind: Application
metadata:
  name: first-app
spec:
  components:
    - name: helloworld
      type: webservice
      properties:
        image: oamdev/helloworld-python:v1
        env:
          - name: "TARGET"
            value: "KubeVela"
        port: 8080
    - name: serverless-backend
      type: serverless-platform
      properties:
        resources:
          requests:
            cpu: "2"    # Requests for CPU in cores
            memory: "2Gi" # Requests for memory in GiB
        replicas: 3   # Number of replicas
    - name: backend
      type: knative-serving
      properties:
        image: [gcr.io/knative-samples/helloworld-go](http://gcr.io/knative-samples/helloworld-go)
        env:
          - name: TARGET
            value: "Go Sample v1"