From 5661866a94d8ba8a19ff7b4881cc24b478bb9a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Tue, 8 Oct 2019 18:30:22 +0200 Subject: [PATCH] more function --- .../scaling/hello-world-go-concurrency.yml | 21 +++++++++++++++++++ functions/scaling/hello-world-go.yml | 15 +++++++++++++ .../scaling/hello-world-py-concurrency.yml | 21 +++++++++++++++++++ functions/scaling/hello-world-py.yml | 15 +++++++++++++ functions/scaling/isprime-go-concurrency.yml | 21 +++++++++++++++++++ functions/scaling/isprime-go.yml | 15 +++++++++++++ functions/scaling/isprime-py-concurrency.yml | 21 +++++++++++++++++++ functions/scaling/isprime-py.yml | 15 +++++++++++++ .../helloworld-go.yml} | 2 +- functions/simple/helloworld-py.yml | 15 +++++++++++++ .../{isprime.yml => simple/isprime-go.yml} | 2 +- functions/simple/isprime-py.yml | 15 +++++++++++++ 12 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 functions/scaling/hello-world-go-concurrency.yml create mode 100644 functions/scaling/hello-world-go.yml create mode 100644 functions/scaling/hello-world-py-concurrency.yml create mode 100644 functions/scaling/hello-world-py.yml create mode 100644 functions/scaling/isprime-go-concurrency.yml create mode 100644 functions/scaling/isprime-go.yml create mode 100644 functions/scaling/isprime-py-concurrency.yml create mode 100644 functions/scaling/isprime-py.yml rename functions/{helloworld.yml => simple/helloworld-go.yml} (70%) create mode 100644 functions/simple/helloworld-py.yml rename functions/{isprime.yml => simple/isprime-go.yml} (71%) create mode 100644 functions/simple/isprime-py.yml diff --git a/functions/scaling/hello-world-go-concurrency.yml b/functions/scaling/hello-world-go-concurrency.yml new file mode 100644 index 0000000..cf84781 --- /dev/null +++ b/functions/scaling/hello-world-go-concurrency.yml @@ -0,0 +1,21 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: helloworld-go-sc-cc + namespace: default +spec: + template: + metadata: + annotations: + # Knative concurrency-based autoscaling (default). + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: concurrency + # Target 10 requests in-flight per pod. + autoscaling.knative.dev/target: "10" + # Disable scale to zero with a minScale of 1. + autoscaling.knative.dev/minScale: "1" + # Limit scaling to 100 pods. + autoscaling.knative.dev/maxScale: "100" + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/hello-world-go diff --git a/functions/scaling/hello-world-go.yml b/functions/scaling/hello-world-go.yml new file mode 100644 index 0000000..cf42233 --- /dev/null +++ b/functions/scaling/hello-world-go.yml @@ -0,0 +1,15 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: helloworld-go-sc + namespace: default +spec: + template: + metadata: + annotations: + # Knative cpu-based autoscaling. + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: cpu + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/hello-world-go diff --git a/functions/scaling/hello-world-py-concurrency.yml b/functions/scaling/hello-world-py-concurrency.yml new file mode 100644 index 0000000..9c0692a --- /dev/null +++ b/functions/scaling/hello-world-py-concurrency.yml @@ -0,0 +1,21 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: helloworld-py-sc-cc + namespace: default +spec: + template: + metadata: + annotations: + # Knative concurrency-based autoscaling (default). + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: concurrency + # Target 10 requests in-flight per pod. + autoscaling.knative.dev/target: "10" + # Disable scale to zero with a minScale of 1. + autoscaling.knative.dev/minScale: "1" + # Limit scaling to 100 pods. + autoscaling.knative.dev/maxScale: "100" + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/hello-world-py diff --git a/functions/scaling/hello-world-py.yml b/functions/scaling/hello-world-py.yml new file mode 100644 index 0000000..7607452 --- /dev/null +++ b/functions/scaling/hello-world-py.yml @@ -0,0 +1,15 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: hello-world-py-sc + namespace: default +spec: + template: + metadata: + annotations: + # Knative cpu-based autoscaling. + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: cpu + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/hello-world-py diff --git a/functions/scaling/isprime-go-concurrency.yml b/functions/scaling/isprime-go-concurrency.yml new file mode 100644 index 0000000..5648379 --- /dev/null +++ b/functions/scaling/isprime-go-concurrency.yml @@ -0,0 +1,21 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: isprime-go-sc-cc + namespace: default +spec: + template: + metadata: + annotations: + # Knative concurrency-based autoscaling (default). + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: concurrency + # Target 10 requests in-flight per pod. + autoscaling.knative.dev/target: "10" + # Disable scale to zero with a minScale of 1. + autoscaling.knative.dev/minScale: "1" + # Limit scaling to 100 pods. + autoscaling.knative.dev/maxScale: "100" + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/isprime-go diff --git a/functions/scaling/isprime-go.yml b/functions/scaling/isprime-go.yml new file mode 100644 index 0000000..2433528 --- /dev/null +++ b/functions/scaling/isprime-go.yml @@ -0,0 +1,15 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: isprime-go-sc + namespace: default +spec: + template: + metadata: + annotations: + # Knative cpu-based autoscaling. + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: cpu + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/isprime-go diff --git a/functions/scaling/isprime-py-concurrency.yml b/functions/scaling/isprime-py-concurrency.yml new file mode 100644 index 0000000..5b625fb --- /dev/null +++ b/functions/scaling/isprime-py-concurrency.yml @@ -0,0 +1,21 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: isprime-py-sc-cc + namespace: default +spec: + template: + metadata: + annotations: + # Knative concurrency-based autoscaling (default). + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: concurrency + # Target 10 requests in-flight per pod. + autoscaling.knative.dev/target: "10" + # Disable scale to zero with a minScale of 1. + autoscaling.knative.dev/minScale: "1" + # Limit scaling to 100 pods. + autoscaling.knative.dev/maxScale: "100" + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/isprime-py diff --git a/functions/scaling/isprime-py.yml b/functions/scaling/isprime-py.yml new file mode 100644 index 0000000..ac70fa3 --- /dev/null +++ b/functions/scaling/isprime-py.yml @@ -0,0 +1,15 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: isprime-py-sc + namespace: default +spec: + template: + metadata: + annotations: + # Knative cpu-based autoscaling. + autoscaling.knative.dev/class: kpa.autoscaling.knative.dev + autoscaling.knative.dev/metric: cpu + spec: + containers: + - image: docker.pkg.github.com/tormachris/knative-report-functions/isprime-py diff --git a/functions/helloworld.yml b/functions/simple/helloworld-go.yml similarity index 70% rename from functions/helloworld.yml rename to functions/simple/helloworld-go.yml index 006b03d..9454dbb 100644 --- a/functions/helloworld.yml +++ b/functions/simple/helloworld-go.yml @@ -7,7 +7,7 @@ spec: template: spec: containers: - - image: docker.pkg.github.com/tormachris/knative-report-functions/hello-world + - image: "docker.pkg.github.com/tormachris/knative-report-functions/hello-world-go" env: - name: TARGET value: "Go" diff --git a/functions/simple/helloworld-py.yml b/functions/simple/helloworld-py.yml new file mode 100644 index 0000000..c740ce4 --- /dev/null +++ b/functions/simple/helloworld-py.yml @@ -0,0 +1,15 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: helloworld-python + namespace: default +spec: + template: + spec: + containers: + - + env: + - + name: TARGET + image: "docker.pkg.github.com/tormachris/knative-report-functions/hello-world-py" + value: "Python" diff --git a/functions/isprime.yml b/functions/simple/isprime-go.yml similarity index 71% rename from functions/isprime.yml rename to functions/simple/isprime-go.yml index 971d19f..3694e31 100644 --- a/functions/isprime.yml +++ b/functions/simple/isprime-go.yml @@ -7,7 +7,7 @@ spec: template: spec: containers: - - image: docker.pkg.github.com/tormachris/knative-report-functions/isprime + - image: "docker.pkg.github.com/tormachris/knative-report-functions/isprime-go" env: - name: TARGET value: 107107 diff --git a/functions/simple/isprime-py.yml b/functions/simple/isprime-py.yml new file mode 100644 index 0000000..cdbe567 --- /dev/null +++ b/functions/simple/isprime-py.yml @@ -0,0 +1,15 @@ +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: + name: isprime-py + namespace: default +spec: + template: + spec: + containers: + - + env: + - + name: TARGET + image: "docker.pkg.github.com/tormachris/knative-report-functions/isprime-py" + value: 107107