Skip to content

Commit 3707d4b

Browse files
committed
Deprecate usage of "sample functions"
- this change moves users over to the function store instead of deploying a static set of functions. Signed-off-by: Alex Ellis (VMware) <[email protected]>
1 parent 49179c4 commit 3707d4b

File tree

2 files changed

+38
-44
lines changed

2 files changed

+38
-44
lines changed

docs/deployment/docker-swarm.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,31 @@ Within a few seconds (or minutes if on a poor WiFi connection) the API gateway a
9999
!!! tip
100100
If you're running on Linux you may find that accessing `localhost` times out. We recommend using an IPv4 address such as http://127.0.0.1:8080 to prevent any ambiguity.
101101

102-
## 2.2 Deploy the sample functions
102+
## 2.2 Deploy functions from the OpenFaaS Function Store
103103

104-
The earlier `git clone` included a set of sample functions in `stack.yml`, to deploy them [install the OpenFaaS CLI](/cli/install/) and run:
104+
You can find many different sample functions from the community through the OpenFaaS Function Store. The Function Store is built into the UI portal and also available via the CLI.
105105

106+
To search the store:
107+
108+
```bash
109+
$ faas-cli store list
110+
```
111+
112+
To deploy `figlet`:
113+
114+
```bash
115+
$ faas-cli store deploy figlet
106116
```
107-
$ faas deploy -f \
108-
https://raw.githubusercontent.com/openfaas/faas/master/stack.yml
117+
118+
Now find the function deployed in the cluster and invoke it.
119+
120+
```bash
121+
$ faas-cli list
122+
$ echo "OpenFaaS!" | faas-cli invoke figlet
109123
```
110124

125+
You can also access the Function Store from the Portal UI and find a range of functions covering everything from machine-learning to network tools.
126+
111127
## 3.0 Start the hands-on labs
112128

113129
Learn how to build serverless functions with OpenFaaS and Python in our half-day workshop. You can follow along online at your own pace.

docs/deployment/kubernetes.md

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -136,60 +136,38 @@ For simplicity the default configuration uses NodePorts rather than an IngressCo
136136
137137
There are currently no sample functions built into this stack, but we can deploy them quickly via the UI or FaaS-CLI.
138138
139-
#### Use the CLI
139+
#### Deploy functions from the OpenFaaS Function Store
140140
141-
* Then clone some samples to deploy on your cluster.
141+
You can find many different sample functions from the community through the OpenFaaS Function Store. The Function Store is built into the UI portal and also available via the CLI.
142142
143-
```bash
144-
$ git clone https://github.com/openfaas/faas-cli
145-
```
146-
147-
Edit stack.yml and change your gateway URL from `localhost:8080` to `kubernetes-node-ip:31112` or pass the `--gateway` / `-g` flag to commands.
148-
149-
i.e.
150-
151-
```bash
152-
provider:
153-
name: faas
154-
gateway: http://192.168.4.95:31112
155-
```
156-
Now deploy the samples:
157-
158-
```bash
159-
faas-cli deploy -f stack.yml
160-
```
143+
You may need to pass the `--gateway` / `-g` flag to each `faas-cli` command or alternatively you can set an environmental variable such as:
161144
162-
!!! info
163-
The `faas-cli` also supports an override of `--gateway http://...` for example:
164-
165-
```bash
166-
faas-cli deploy -f stack.yml --gateway http://127.0.0.1:31112
167-
```
145+
```bash
146+
export OPENFAAS_URL=http://127.0.0.1:31112
147+
```
168148
169-
##### List the functions
149+
To search the store:
170150
171151
```bash
172-
$ faas-cli list -f stack.yml
152+
$ faas-cli store list
153+
```
173154
174-
or
155+
To deploy `figlet`:
175156
176-
$ faas-cli list -g http://127.0.0.1:31112
177-
Function Invocations Replicas
178-
inception 0 1
179-
nodejs-echo 0 1
180-
ruby-echo 0 1
181-
shrink-image 0 1
182-
stronghash 2 1
157+
```bash
158+
$ faas-cli store deploy figlet
183159
```
184160
185-
Invoke a function:
161+
Now find the function deployed in the cluster and invoke it.
186162
187163
```bash
188-
$ echo -n "Test" | faas-cli invoke stronghash -g http://127.0.0.1:31112
189-
c6ee9e33cf5c6715a1d148fd73f7318884b41adcb916021e2bc0e800a5c5dd97f5142178f6ae88c8fdd98e1afb0ce4c8d2c54b5f37b30b7da1997bb33b0b8a31 -
164+
$ faas-cli list
165+
$ echo "OpenFaaS!" | faas-cli invoke figlet
190166
```
191167
192-
* Build your first Python function
168+
You can also access the Function Store from the Portal UI and find a range of functions covering everything from machine-learning to network tools.
169+
170+
##### Build your first Python function
193171
194172
[Your first serverless Python function with OpenFaaS](https://blog.alexellis.io/first-faas-python-function/)
195173

0 commit comments

Comments
 (0)