Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions docs/Java 示例函数.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

访问函数
Expand All @@ -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
```

访问函数
Expand Down Expand Up @@ -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
```

访问函数
Expand Down Expand Up @@ -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` 中发送数据
Expand Down Expand Up @@ -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
```

查看函数日志
Expand Down Expand Up @@ -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
```

## 读取配置
Expand Down Expand Up @@ -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 读取配置
Expand All @@ -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。
Expand All @@ -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的访问地址
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 中以下环境变量
Expand Down Expand Up @@ -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
```

创建文件
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/cloudevent-function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/cron-input-kafka-output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/file-read-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/function-aggregation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/function-front.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/function-subscriber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/get-config-from-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/http-function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/kafka-input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/mysql-state-store.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/mysql-to-redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/functions/redis-state-store.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down