Skip to content

Commit 847742c

Browse files
committed
update main branch samples
Signed-off-by: laminar <[email protected]>
1 parent cb68c32 commit 847742c

File tree

26 files changed

+87
-78
lines changed

26 files changed

+87
-78
lines changed

Prerequisites.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You can refer to the [Installation Guide](https://github.com/OpenFunction/OpenFu
2626
namespace: default
2727
spec:
2828
kafka:
29-
version: 2.8.0
29+
version: 3.1.0
3030
replicas: 1
3131
listeners:
3232
- name: plain
@@ -41,8 +41,9 @@ You can refer to the [Installation Guide](https://github.com/OpenFunction/OpenFu
4141
offsets.topic.replication.factor: 1
4242
transaction.state.log.replication.factor: 1
4343
transaction.state.log.min.isr: 1
44-
log.message.format.version: '2.8'
45-
inter.broker.protocol.version: "2.8"
44+
default.replication.factor: 1
45+
min.insync.replicas: 1
46+
inter.broker.protocol.version: "3.1"
4647
storage:
4748
type: ephemeral
4849
zookeeper:
@@ -53,7 +54,7 @@ You can refer to the [Installation Guide](https://github.com/OpenFunction/OpenFu
5354
topicOperator: {}
5455
userOperator: {}
5556
---
56-
apiVersion: kafka.strimzi.io/v1beta1
57+
apiVersion: kafka.strimzi.io/v1beta2
5758
kind: KafkaTopic
5859
metadata:
5960
name: <kafka-topic>

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# OpenFunction function samples
22

3+
For samples of the latest stable version, please visit here:
4+
5+
-> [v0.6.0 samples](https://github.com/openFunction/samples/tree/release-0.6)
6+
37
## Function samples
48

59
The following are samples of OpenFunction function.

apps/buildah/function-buildah.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ spec:
1313
srcRepo:
1414
url: "https://github.com/OpenFunction/samples.git"
1515
sourceSubPath: "apps/with-dockerfile"
16+
revision: "main"
1617
shipwright:
1718
strategy:
1819
name: buildah
1920
kind: ClusterBuildStrategy
2021
serving:
21-
runtime: Knative
22+
runtime: knative
2223
template:
2324
containers:
2425
- name: function

apps/kaniko/function-kaniko.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ spec:
1313
srcRepo:
1414
url: "https://github.com/OpenFunction/samples.git"
1515
sourceSubPath: "apps/with-dockerfile"
16+
revision: "main"
1617
shipwright:
1718
strategy:
1819
name: kaniko
1920
kind: ClusterBuildStrategy
2021
serving:
21-
runtime: Knative
22+
runtime: knative
2223
template:
2324
containers:
2425
- name: function

apps/ko/function-ko.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ spec:
1313
srcRepo:
1414
url: "https://github.com/OpenFunction/samples.git"
1515
sourceSubPath: "apps/with-dockerfile"
16+
revision: "main"
1617
shipwright:
1718
strategy:
1819
name: ko
1920
kind: ClusterBuildStrategy
2021
serving:
21-
runtime: Knative
22+
runtime: knative
2223
template:
2324
containers:
2425
- name: function

apps/sample-apps-java-maven.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ spec:
1313
srcRepo:
1414
url: "https://github.com/buildpacks/samples.git"
1515
sourceSubPath: "apps/java-maven"
16+
revision: "main"
1617
serving:
17-
runtime: "Knative" # default to Knative
18+
runtime: "knative" # default to knative
1819
template:
1920
containers:
2021
- name: function

functions-framework/golang/Knative/http/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export FUNC_CONTEXT='{"name":"function-demo","version":"v1.0.0","port":"8080","r
2424
Start the function:
2525

2626
```shell
27-
go run main.go plugin.go
27+
go run main.go
2828
```
2929

3030
Access the function:

functions/Async/bindings/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ kind: Function
2222
metadata:
2323
name: bindings-without-output
2424
spec:
25-
image: "<your registry name>/bindings-without-output:v2"
25+
image: "<your registry name>/bindings-without-output:latest"
2626
```
2727
2828
Use the following commands to create this Function:
@@ -64,7 +64,7 @@ kind: Function
6464
metadata:
6565
name: bindings-with-output
6666
spec:
67-
image: "<your registry name>/bindings-with-output:v2"
67+
image: "<your registry name>/bindings-with-output:latest"
6868
```
6969
7070
Use the following commands to create this Function:

functions/Async/bindings/with-output/function-bindings.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ metadata:
1212
- plugin-example
1313
spec:
1414
version: "v2.0.0"
15-
image: openfunctiondev/bindings-with-output:v2
15+
image: openfunctiondev/bindings-with-output:latest
1616
imageCredentials:
1717
name: push-secret
1818
build:
19-
builder: openfunction/builder-go:v2-1.16
19+
builder: openfunction/builder-go:latest
2020
env:
2121
FUNC_NAME: "BindingsOutput"
2222
FUNC_CLEAR_SOURCE: "true"
2323
srcRepo:
2424
url: "https://github.com/OpenFunction/samples.git"
2525
sourceSubPath: "functions/Async/bindings/with-output/"
26-
revision: "release-0.6"
26+
revision: "main"
2727
serving:
2828
template:
2929
containers:
3030
- name: function
31-
imagePullPolicy: IfNotPresent
31+
imagePullPolicy: Always
3232
runtime: "async"
3333
inputs:
3434
- name: cron

functions/Async/bindings/with-output/output-target/output-target.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ metadata:
44
name: output-target
55
spec:
66
version: "v2.0.0"
7-
image: openfunctiondev/bindings-output-target:v2
7+
image: openfunctiondev/bindings-output-target:latest
88
imageCredentials:
99
name: push-secret
1010
build:
11-
builder: openfunction/builder-go:v2-1.16
11+
builder: openfunction/builder-go:latest
1212
env:
1313
FUNC_NAME: "Target"
1414
FUNC_CLEAR_SOURCE: "true"
1515
srcRepo:
1616
url: "https://github.com/OpenFunction/samples.git"
1717
sourceSubPath: "functions/Async/bindings/with-output/output-target"
18-
revision: "release-0.6"
18+
revision: "main"
1919
serving:
2020
runtime: async
2121
inputs:
@@ -39,4 +39,4 @@ spec:
3939
template:
4040
containers:
4141
- name: function
42-
imagePullPolicy: IfNotPresent
42+
imagePullPolicy: Always

functions/Async/bindings/without-output/function-bindings.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ metadata:
44
name: bindings-without-output
55
spec:
66
version: "v2.0.0"
7-
image: openfunctiondev/bindings-without-output:v2
7+
image: openfunctiondev/bindings-without-output:latest
88
imageCredentials:
99
name: push-secret
1010
build:
11-
builder: openfunction/builder-go:v2-1.16
11+
builder: openfunction/builder-go:latest
1212
env:
1313
FUNC_NAME: "BindingsNoOutput"
1414
FUNC_CLEAR_SOURCE: "true"
1515
srcRepo:
1616
url: "https://github.com/OpenFunction/samples.git"
1717
sourceSubPath: "functions/Async/bindings/without-output"
18-
revision: "release-0.6"
18+
revision: "main"
1919
serving:
2020
template:
2121
containers:
2222
- name: function
23-
imagePullPolicy: IfNotPresent
23+
imagePullPolicy: Always
2424
runtime: "async"
2525
inputs:
2626
- name: input

functions/Async/logs-handler-function/logs-handler-function.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ metadata:
44
name: logs-async-handler
55
spec:
66
version: "v2.0.0"
7-
image: openfunctiondev/logs-async-handler:v2
7+
image: openfunctiondev/logs-async-handler:latest
88
imageCredentials:
99
name: push-secret
1010
build:
11-
builder: openfunction/builder-go:v2-1.16
11+
builder: openfunction/builder-go:latest
1212
env:
1313
FUNC_NAME: "LogsHandler"
1414
FUNC_CLEAR_SOURCE: "true"
@@ -17,7 +17,7 @@ spec:
1717
srcRepo:
1818
url: "https://github.com/OpenFunction/samples.git"
1919
sourceSubPath: "functions/Async/logs-handler-function/"
20-
revision: "release-0.6"
20+
revision: "main"
2121
serving:
2222
runtime: "async"
2323
scaleOptions:
@@ -37,7 +37,7 @@ spec:
3737
template:
3838
containers:
3939
- name: function
40-
imagePullPolicy: IfNotPresent
40+
imagePullPolicy: Always
4141
inputs:
4242
- name: kafka
4343
component: kafka-receiver

functions/Async/pubsub/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Build and push the producer image.
1818

1919
```shell
2020
cd producer
21-
docker build -t <your registry name>/v1beta1-autoscaling-producer:v2 -f Dockerfile.producer .
22-
docker push <your registry name>/v1beta1-autoscaling-producer:v2
21+
docker build -t <your registry name>/v1beta1-autoscaling-producer:latest -f Dockerfile.producer .
22+
docker push <your registry name>/v1beta1-autoscaling-producer:latest
2323
```
2424

2525
Modify the container image in `deploy.yaml`:
@@ -30,8 +30,8 @@ Modify the container image in `deploy.yaml`:
3030
spec:
3131
containers:
3232
- name: producer
33-
image: <your registry name>/v1beta1-autoscaling-producer:v2
34-
imagePullPolicy: IfNotPresent
33+
image: <your registry name>/v1beta1-autoscaling-producer:latest
34+
imagePullPolicy: Always
3535
env:
3636
- name: PUBSUB_NAME
3737
value: "autoscaling-producer"
@@ -59,7 +59,7 @@ kind: Function
5959
metadata:
6060
name: autoscaling-subscriber
6161
spec:
62-
image: "<your registry name>/autoscaling-subscriber:v2"
62+
image: "<your registry name>/autoscaling-subscriber:latest"
6363
```
6464
6565
Use the following commands to create these Functions:

functions/Async/pubsub/producer/deploy.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
labels:
66
app: producer
77
spec:
8-
replicas: 2
8+
replicas: 1
99
selector:
1010
matchLabels:
1111
app: producer
@@ -22,8 +22,8 @@ spec:
2222
spec:
2323
containers:
2424
- name: producer
25-
image: openfunctiondev/v1beta1-autoscaling-producer:v2
26-
imagePullPolicy: IfNotPresent
25+
image: openfunctiondev/v1beta1-autoscaling-producer:latest
26+
imagePullPolicy: Always
2727
env:
2828
- name: PUBSUB_NAME
2929
value: "autoscaling-producer"

functions/Async/pubsub/subscriber/function-subscriber.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ metadata:
44
name: autoscaling-subscriber
55
spec:
66
version: "v2.0.0"
7-
image: openfunctiondev/autoscaling-subscriber:v2
7+
image: openfunctiondev/autoscaling-subscriber:latest
88
imageCredentials:
99
name: push-secret
1010
build:
11-
builder: openfunction/builder-go:v2-1.16
11+
builder: openfunction/builder-go:latest
1212
env:
1313
FUNC_NAME: "Subscriber"
1414
FUNC_CLEAR_SOURCE: "true"
@@ -17,7 +17,7 @@ spec:
1717
srcRepo:
1818
url: "https://github.com/OpenFunction/samples.git"
1919
sourceSubPath: "functions/Async/pubsub/subscriber"
20-
revision: "release-0.6"
20+
revision: "main"
2121
serving:
2222
runtime: "async"
2323
scaleOptions:
@@ -37,7 +37,7 @@ spec:
3737
template:
3838
containers:
3939
- name: function
40-
imagePullPolicy: IfNotPresent
40+
imagePullPolicy: Always
4141
inputs:
4242
- name: producer
4343
component: kafka-server

functions/Knative/function-with-dapr/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ serving:
4545
template:
4646
containers:
4747
- name: function
48-
imagePullPolicy: IfNotPresent
48+
imagePullPolicy: Always
4949
```
5050
5151
Use the following command to create the function:

functions/Knative/function-with-dapr/function-front.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ metadata:
1212
- plugin-example
1313
spec:
1414
version: "v1.0.0"
15-
image: "openfunctiondev/sample-knative-dapr:v2"
15+
image: "openfunctiondev/sample-knative-dapr:latest"
1616
imageCredentials:
1717
name: push-secret
1818
port: 8080 # default to 8080
1919
build:
20-
builder: openfunction/builder-go:v2-1.16
20+
builder: openfunction/builder-go:latest
2121
env:
2222
FUNC_NAME: "Sender"
2323
FUNC_CLEAR_SOURCE: "true"
2424
srcRepo:
2525
url: "https://github.com/OpenFunction/samples.git"
2626
sourceSubPath: "functions/Knative/function-with-dapr"
27-
revision: "release-0.6"
27+
revision: "main"
2828
serving:
2929
scaleOptions:
3030
minCount: 0
@@ -52,4 +52,4 @@ spec:
5252
template:
5353
containers:
5454
- name: function
55-
imagePullPolicy: IfNotPresent
55+
imagePullPolicy: Always

functions/Knative/function-with-dapr/output-target/output-target.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ metadata:
44
name: output-target
55
spec:
66
version: "v1.0.0"
7-
image: openfunctiondev/bindings-output-target:v2
7+
image: openfunctiondev/bindings-output-target:latest
88
imageCredentials:
99
name: push-secret
1010
build:
11-
builder: openfunction/builder-go:v2-1.16
11+
builder: openfunction/builder-go:latest
1212
env:
1313
FUNC_NAME: "Target"
1414
FUNC_CLEAR_SOURCE: "true"
1515
srcRepo:
1616
url: "https://github.com/OpenFunction/samples.git"
1717
sourceSubPath: "functions/Knative/function-with-dapr/output-target"
18-
revision: "release-0.6"
18+
revision: "main"
1919
serving:
2020
runtime: async
2121
inputs:
@@ -40,4 +40,4 @@ spec:
4040
template:
4141
containers:
4242
- name: function
43-
imagePullPolicy: IfNotPresent
43+
imagePullPolicy: Always

0 commit comments

Comments
 (0)