@@ -6,40 +6,16 @@ This project was forked from [zeerorg/cron-connector](https://github.com/openfaa
6
6
7
7
## How to Use
8
8
9
- You need to have OpenFaaS deployed first, see [ https://docs.openfaas.com ] ( https://docs.openfaas.com ) to get started
9
+ First, [ deploy OpenFaaS with faasd or Kubernetes ] ( https://docs.openfaas.com/deployment/ )
10
10
11
- ### Deploy using the Helm chart
11
+ ### Deploy the connector for Kubernetes
12
12
13
- The helm chart is available in the [ faas-netes ] ( https://github. com/openfaas/faas-netes/tree/master/chart/ cron-connector ) repo.
13
+ For Kubernetes, see: [ Scheduling function runs ] ( https://docs.openfaas. com/reference/ cron/ )
14
14
15
- For faasd, you can edit your ` docker-compose.yaml ` file to see the deployment. See the chart above for the image name and configuration required.
15
+ ### Deploy the connector for faasd
16
16
17
- ### Add to faasd
17
+ For faasd, see [ Serverless For Everyone Else ] ( https://gumroad.com/l/serverless-for-everyone-else ) .
18
18
19
- Edit ` /var/lib/faasd/docker-compose.yaml ` and add:
20
-
21
- ``` yaml
22
- cron-connector :
23
- image : " ghcr.io/openfaas/cron-connector:latest"
24
- environment :
25
- - gateway_url=http://gateway:8080
26
- - basic_auth=true
27
- - secret_mount_path=/run/secrets
28
- volumes :
29
- # we assume cwd == /var/lib/faasd
30
- - type : bind
31
- source : ./secrets/basic-auth-password
32
- target : /run/secrets/basic-auth-password
33
- - type : bind
34
- source : ./secrets/basic-auth-user
35
- target : /run/secrets/basic-auth-user
36
- cap_add :
37
- - CAP_NET_RAW
38
- depends_on :
39
- - gateway
40
- ` ` `
41
-
42
- Then restart faasd.
43
19
### Trigger a function from Cron
44
20
45
21
The function should have 2 annotations:
@@ -51,8 +27,10 @@ For example, we may have a function "nodeinfo" which we want to invoke every 5 m
51
27
52
28
Deploy via the CLI:
53
29
54
- ` ` `
55
- faas-cli store deploy nodeinfo --annotation schedule="*/5 * * * *" --annotation topic=cron-function
30
+ ``` bash
31
+ faas-cli store deploy nodeinfo \
32
+ --annotation schedule=" */5 * * * *" \
33
+ --annotation topic=cron-function
56
34
```
57
35
58
36
Or via ` stack.yml ` :
0 commit comments