Skip to content

Commit 1031248

Browse files
authored
feat: readme update (#46)
1 parent d0672f4 commit 1031248

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

README.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ alternatively if `curl` is pre-installed
6161
```powershell
6262
curl -L -o <C:\path\to\your\destination\func.exe> "https://github.com/knative/func/releases/latest/download/func_windows_amd64.exe"
6363
```
64-
> [!NOTE] You need to change the part in <> to your desired destination
64+
65+
> [!WARNING]
66+
> You need to change the part in <> to your desired destination
6567
> (don't include the "<>" symbols)
68+
6669
### Mac (darwin OS)
6770

6871
#### amd64
@@ -77,7 +80,8 @@ curl -L -o /usr/local/bin/func "https://github.com/knative/func/releases/latest/
7780
curl -L -o /usr/local/bin/func "https://github.com/knative/func/releases/latest/download/func_darwin_arm64"
7881
```
7982

80-
> [!NOTE] After downloading on MacOS and Linux, you might need to make the file
83+
> [!NOTE]
84+
> After downloading on MacOS and Linux, you might need to make the file
8185
> executable
8286
8387
```sh
@@ -102,6 +106,7 @@ containerize your applications. (*You can get this as a standalone tool*)
102106
Please refer to **kind**
103107
[installation page](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
104108
or download any other runner that you like.
109+
105110
#### Download cli commands for k8s (kubectl)
106111
In order to interact with the objects in k8s, its recommended to get
107112
[kubectl](https://kubernetes.io/docs/tasks/tools/).
@@ -116,7 +121,8 @@ Create your functions directory and `cd` into it
116121
mkdir -p ~/testing/myfunc && cd ~/testing/myfunc
117122
```
118123

119-
Create a function in **golang** with **hello template** within the new (current and empty) directory
124+
Create a function in **golang** with **hello template** within the new
125+
(current and empty) directory
120126

121127
```
122128
func create --repository=https://github.com/gauron99/func-templates --language go --template=hello
@@ -152,36 +158,41 @@ see detailed info in [Templates structure](#templates-structure) section.
152158
### Build a Function
153159

154160
#### Using the Host Builder
155-
> [!NOTE]
156-
> Some languages already have the host builder enabled but not all.
157-
> If available, we recommend using the host builder.
161+
> [!WARNING]
162+
> Host builder is currently available for runtimes `go` and `python`
158163
159-
In order to use the Host Builder, simply add `--builder=host` to build your
160-
Function. If you want to `func run` your Function locally first, it's also
161-
recommended to use `--container=false`.
164+
> [!TIP]
165+
> We recommend using the host builder `--builder=host` when available
162166
163-
```bash
164-
#deploy to a running cluster (this will also build if needed)
165-
func deploy --builder=host
166-
```
167+
You build a function using the `func build` command. You can specify your desired
168+
builder (look below) or don't configure anything and use the default.
169+
170+
If you want to `func run` your Function locally first, it's recommended to use
171+
`--container=false`
167172

168173
#### Using Alternative Builders
169174
Alternative built-in builders are `pack` and `s2i` (for supported languages).
170175
The way to use them is simple. Just specify which one you want using the
171176
`--builder` flag (eg. `--builder=pack`)
172177

173178
### Deploy a Function
174-
> [!NOTE]
179+
> [!WARNING]
175180
> In order to deploy anything to a cluster, you will need to have one set up and
176-
> running along with at least [Knative-Serving](https://knative.dev/docs/serving/) installed.
181+
> running along with at least [Knative-Serving](https://knative.dev/docs/serving/)
182+
> installed.
177183
178184
You can skip the building step entirely and deploy straight after creating your
179185
function. (building is included in the `func deploy`).
180186

181-
#### Local
187+
> [!NOTE]
188+
> You can skip the building step entirely and deploy straight after creating your
189+
> function. (building is included in the `deploy`).
190+
191+
#### Local deployment
182192
You can deploy your local code (from your machine) to a cluster using a standard
183193
deploy command. `func` will need to know a registry to use for the image
184194
*to be created*. You can specify with a flag or wait to be prompted for it.
195+
185196
```bash
186197
func deploy --registry=myregistry.com/username
187198
```
@@ -194,11 +205,12 @@ with your image to solely deploy it.
194205
func deploy --image=registry.com/username/myimage@sha256:xxx
195206
```
196207

197-
*NOTE: If you know what you want, at any point you can add a `--build` flag to
198-
your command which will explicitly tell `func` if you want to build (or not)
199-
your image. (truthy values will work).*
208+
> [!TIP]
209+
> If you know what you want, at any point you can add a `--build` flag to
210+
> your command which will explicitly tell `func` if you want to build (or not)
211+
> your image. (truthy values will work).
200212
201-
#### Remote
213+
#### Remote deployment
202214

203215
You can also utilize a remote deployment, which will use
204216
[tekton](https://tekton.dev/) under the hood. (Which will need to be present in
@@ -210,7 +222,8 @@ You can simply add `--remote` to your `func deploy` command.
210222
Directory structure is as follows: **root/[language]/[template]** where *root* is
211223
the github repository itself, *language* is the programming language used and
212224
*template* is the name of the template. Function is created from Git repo via
213-
`--repository` flag when using `func create` command. More in [How-To-Use](#how-to-use) section.
225+
`--repository` flag when using `func create` command. More in
226+
[How-To-Use](#how-to-use) section.
214227

215228
```
216229
github.com/gauron99/func-templates <--[root]
@@ -226,12 +239,14 @@ github.com/gauron99/func-templates <--[root]
226239
```
227240

228241
# Contact
229-
You can contact us on CNCF Slack [knative-functions](https://cloud-native.slack.com/archives/C04LKEZUXEE) channel
242+
You can contact us on CNCF Slack
243+
[knative-functions](https://cloud-native.slack.com/archives/C04LKEZUXEE) channel
230244

231245
## F&Q
232246
1. **Function signature error**
233247
```
234-
Error: function may not implement both the static and instanced method signatures simultaneously
248+
Error: function may not implement both the static and instanced method signatures
249+
simultaneously
235250
```
236251
***->** this happens when `func (f *F) Somename(){}` is defined as well as
237252
`func Handle(){}`, these are the 2 signatures supported currently - instanced

0 commit comments

Comments
 (0)