diff --git a/README.md b/README.md new file mode 100644 index 0000000..88840b7 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Requirements + +- OpenFunction: >= v1.1.0 +- OpenFunction API: `v1beta1` +- OpenFunction Java framework: >= 1.1.0 diff --git "a/docs/Java \347\244\272\344\276\213\345\207\275\346\225\260.md" "b/docs/Java \347\244\272\344\276\213\345\207\275\346\225\260.md" index 0c5984b..1943e1f 100644 --- "a/docs/Java \347\244\272\344\276\213\345\207\275\346\225\260.md" +++ "b/docs/Java \347\244\272\344\276\213\345\207\275\346\225\260.md" @@ -13,7 +13,7 @@ 创建函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/http-function.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/http-function.yaml ``` 访问函数 @@ -28,7 +28,7 @@ Hello, World! 创建函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/function-front.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/function-front.yaml ``` 访问函数 @@ -64,7 +64,7 @@ plugin plugin-example:v1.0.0 exec post hook for http function at 2023-06-01 08:2 创建函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/cloudevent-function.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/cloudevent-function.yaml ``` 访问函数 @@ -110,7 +110,7 @@ kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/mai 创建函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/kafka-input.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/kafka-input.yaml ``` 向 `kafka` 中发送数据 @@ -144,7 +144,7 @@ curl -d '{"message":"Awesome OpenFunction!"}' -H "Content-Type: application/json 创建函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/cron-input-kafka-output.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/cron-input-kafka-output.yaml ``` 查看函数日志 @@ -178,7 +178,7 @@ kubectl apply -f https://raw.githubusercontent.com/OpenFunction/samples/main/fun 创建 subscribe 函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/function-subscriber.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/function-subscriber.yaml ``` ## 读取配置 @@ -210,7 +210,7 @@ EOF 部署 Function ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/get-config-from-file.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/get-config-from-file.yaml ``` ### 从 configmap 读取配置 @@ -236,7 +236,7 @@ EOF 部署 Function ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/get-config-from-configmap.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/get-config-from-configmap.yaml ``` > 访问 k8s 资源需要创建对应的 servingaccount,role 和 rolebinding。 @@ -250,7 +250,7 @@ kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/mai 部署 Function ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/function-aggregation.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/function-aggregation.yaml ``` PS: 需要修改 function 的spec.serving.params 中的 FUNCTIONS 字段的值为实际的 function的访问地址 @@ -262,7 +262,7 @@ PS: 需要修改 function 的spec.serving.params 中的 FUNCTIONS 字段的值 部署 Function ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/redis-state-store.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/redis-state-store.yaml ``` 创建 state @@ -317,7 +317,7 @@ delete 2 states 部署 Function ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/mysql-state-store.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/mysql-state-store.yaml ``` 创建 state @@ -372,7 +372,7 @@ delete 2 states 部署 Function ```yaml -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/mysql-to-redis.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/mysql-to-redis.yaml ``` PS:需要修改 mysql-to-redis.yaml 中以下环境变量 @@ -425,7 +425,7 @@ data: 部署函数 ```shell -kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/main/src/main/resources/functions/file-read-write.yaml +kubectl apply -f https://raw.githubusercontent.com/OpenFunction/java-samples/release-1.0/src/main/resources/functions/file-read-write.yaml ``` 创建文件 diff --git a/src/main/resources/functions/cloudevent-function.yaml b/src/main/resources/functions/cloudevent-function.yaml index ef6c45b..5e19b42 100644 --- a/src/main/resources/functions/cloudevent-function.yaml +++ b/src/main/resources/functions/cloudevent-function.yaml @@ -15,7 +15,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: template: containers: diff --git a/src/main/resources/functions/cron-input-kafka-output.yaml b/src/main/resources/functions/cron-input-kafka-output.yaml index 225d777..0ff2f9c 100644 --- a/src/main/resources/functions/cron-input-kafka-output.yaml +++ b/src/main/resources/functions/cron-input-kafka-output.yaml @@ -20,7 +20,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: template: containers: diff --git a/src/main/resources/functions/file-read-write.yaml b/src/main/resources/functions/file-read-write.yaml index 6ef41d8..2d5c67e 100644 --- a/src/main/resources/functions/file-read-write.yaml +++ b/src/main/resources/functions/file-read-write.yaml @@ -15,7 +15,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: params: ROOT_DIR: /data diff --git a/src/main/resources/functions/function-aggregation.yaml b/src/main/resources/functions/function-aggregation.yaml index ed9d603..9452866 100644 --- a/src/main/resources/functions/function-aggregation.yaml +++ b/src/main/resources/functions/function-aggregation.yaml @@ -15,7 +15,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: params: FUNCTIONS: "http://get-config-from-configmap.default.svc.cluster.local/,http://get-config-from-file.default.svc.cluster.local/" diff --git a/src/main/resources/functions/function-front.yaml b/src/main/resources/functions/function-front.yaml index 26b64c3..fc23db1 100644 --- a/src/main/resources/functions/function-front.yaml +++ b/src/main/resources/functions/function-front.yaml @@ -21,7 +21,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: scaleOptions: minReplicas: 0 diff --git a/src/main/resources/functions/function-subscriber.yaml b/src/main/resources/functions/function-subscriber.yaml index 772fa9a..c64502a 100644 --- a/src/main/resources/functions/function-subscriber.yaml +++ b/src/main/resources/functions/function-subscriber.yaml @@ -22,7 +22,7 @@ spec: # FUNC_GOPROXY: "https://goproxy.cn" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: runtime: "async" scaleOptions: diff --git a/src/main/resources/functions/get-config-from-configmap.yaml b/src/main/resources/functions/get-config-from-configmap.yaml index 704203b..e3746c0 100644 --- a/src/main/resources/functions/get-config-from-configmap.yaml +++ b/src/main/resources/functions/get-config-from-configmap.yaml @@ -47,7 +47,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: params: CONFIGMAP_NAMESPACE: default diff --git a/src/main/resources/functions/get-config-from-file.yaml b/src/main/resources/functions/get-config-from-file.yaml index 7979c4a..af7eb2d 100644 --- a/src/main/resources/functions/get-config-from-file.yaml +++ b/src/main/resources/functions/get-config-from-file.yaml @@ -15,7 +15,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: template: volumes: diff --git a/src/main/resources/functions/http-function.yaml b/src/main/resources/functions/http-function.yaml index af8034b..7442fec 100644 --- a/src/main/resources/functions/http-function.yaml +++ b/src/main/resources/functions/http-function.yaml @@ -15,7 +15,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: template: containers: diff --git a/src/main/resources/functions/kafka-input.yaml b/src/main/resources/functions/kafka-input.yaml index afc2028..c518d8e 100644 --- a/src/main/resources/functions/kafka-input.yaml +++ b/src/main/resources/functions/kafka-input.yaml @@ -20,7 +20,7 @@ spec: FUNC_CLEAR_SOURCE: "true" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: runtime: async scaleOptions: diff --git a/src/main/resources/functions/mysql-state-store.yaml b/src/main/resources/functions/mysql-state-store.yaml index 9a0ee4f..5ab9840 100644 --- a/src/main/resources/functions/mysql-state-store.yaml +++ b/src/main/resources/functions/mysql-state-store.yaml @@ -16,7 +16,7 @@ spec: FUNCTION_FRAMEWORK_VERSION: "1.1.0" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: params: STATE_STORE_NAME: "mysql-state-store" diff --git a/src/main/resources/functions/mysql-to-redis.yaml b/src/main/resources/functions/mysql-to-redis.yaml index 6f15529..1609363 100644 --- a/src/main/resources/functions/mysql-to-redis.yaml +++ b/src/main/resources/functions/mysql-to-redis.yaml @@ -16,7 +16,7 @@ spec: FUNCTION_FRAMEWORK_VERSION: "1.1.0" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: params: JDBC_DRIVER: "com.mysql.cj.jdbc.Driver" diff --git a/src/main/resources/functions/redis-state-store.yaml b/src/main/resources/functions/redis-state-store.yaml index fe97d5a..8b92d5b 100644 --- a/src/main/resources/functions/redis-state-store.yaml +++ b/src/main/resources/functions/redis-state-store.yaml @@ -16,7 +16,7 @@ spec: FUNCTION_FRAMEWORK_VERSION: "1.1.0" srcRepo: url: "https://github.com/OpenFunction/java-samples.git" - revision: "main" + revision: "release-1.0" serving: params: STATE_STORE_NAME: "redis-state-store"