diff --git a/module16/fission/3.functions/1.go-env.md b/module16/fission/3.functions/1.go-env.md index b4ef9db..82b59a4 100644 --- a/module16/fission/3.functions/1.go-env.md +++ b/module16/fission/3.functions/1.go-env.md @@ -56,7 +56,7 @@ spec: - A builder pod is composed by env builder, which is to build the source, and fetcher, which is to retrieve code. The two containers share the same sharedVolume ``` -kubectl get deployment -n fission-builder go-254706 -oyaml +kubectl get deployment go-254706 -oyaml ``` ``` apiVersion: apps/v1 diff --git a/module16/fission/3.functions/2.go-fn.md b/module16/fission/3.functions/2.go-fn.md index f08dc6a..e3a3b07 100644 --- a/module16/fission/3.functions/2.go-fn.md +++ b/module16/fission/3.functions/2.go-fn.md @@ -121,8 +121,8 @@ poolmgr-go-default-254706-788858ccb8-v978z 2/2 Running 0 27s the code is compiled as golang plugin ``` -go build -buildmode=plugin httpserver.go -ls -la httpserver.so +go build -buildmode=plugin hello.go +ls -la hello.so ``` and is loaded by go server, which is defined in fission golang env repo diff --git a/module16/fission/3.functions/hello.js b/module16/fission/3.functions/hello.js new file mode 100644 index 0000000..aa94dc4 --- /dev/null +++ b/module16/fission/3.functions/hello.js @@ -0,0 +1,7 @@ + +module.exports = async function(context) { + return { + status: 200, + body: "hello, world!\n" + }; +} diff --git a/module16/fission/3.functions/hello.so b/module16/fission/3.functions/hello.so new file mode 100644 index 0000000..65689b1 Binary files /dev/null and b/module16/fission/3.functions/hello.so differ diff --git a/module16/knative/3.eventing/2.source-and-channel.md b/module16/knative/3.eventing/2.source-and-channel.md index 07c68df..8ff9d2a 100644 --- a/module16/knative/3.eventing/2.source-and-channel.md +++ b/module16/knative/3.eventing/2.source-and-channel.md @@ -17,7 +17,7 @@ kn channel create knative-hello-channel ### edit pingsource and set sink to channel and let fn subscribe the event ``` -kubectl apply -f pingsource.yaml +kubectl replace -f pingsource.yaml ``` ### wait for ping being invoked and function pod being scaled diff --git a/module16/knative/3.eventing/sample-app.yaml b/module16/knative/3.eventing/sample-app.yaml index 30e61e0..ecdde3b 100644 --- a/module16/knative/3.eventing/sample-app.yaml +++ b/module16/knative/3.eventing/sample-app.yaml @@ -26,6 +26,23 @@ spec: kind: Service name: helloworld-go --- +# Knative Eventing Trigger to trigger the helloworld-go service +apiVersion: eventing.knative.dev/v1 +kind: Trigger +metadata: + name: event-display +spec: + broker: default + filter: + attributes: + type: dev.knative.samples.hifromknative + source: knative/eventing/samples/hello-world + subscriber: + ref: + apiVersion: v1 + kind: Service + name: helloworld-go +--- apiVersion: serving.knative.dev/v1 kind: Service metadata: