Skip to content

Commit 09ef6f8

Browse files
committed
[SRVCOM-1846]: Remove outdated module and add content to func getting started
1 parent 0088bb5 commit 09ef6f8

File tree

4 files changed

+13
-71
lines changed

4 files changed

+13
-71
lines changed

modules/serverless-build-func-kn.adoc

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,16 @@
66
[id="serverless-build-func-kn_{context}"]
77
= Building functions
88

9-
Before you can run a function, you must build the function project by using the `kn func build` command. The build command reads the `func.yaml` file from the function project directory to determine the image name and registry.
9+
Before you can run a function, you must build the function project by using the `kn func build` command. This command creates an OCI container image that can be run locally on your computer or on an {product-title} cluster. The build command uses the function project name and the image registry name to construct a fully qualified image name for your function.
1010

11-
.Example `func.yaml`
12-
[source,yaml]
13-
----
14-
name: example-function
15-
namespace: default
16-
runtime: node
17-
image: <image_from_registry>
18-
imageDigest: ""
19-
trigger: http
20-
builder: default
21-
builderMap:
22-
default: quay.io/boson/faas-nodejs-builder
23-
envs: {}
24-
----
11+
The OpenShift Container Registry is used by default as the image registry for storing function images. You can override this by using the `-r` flag:
2512

26-
If the image name and registry are not set in the `func.yaml` file, you must either specify the registry flag, `-r` when using the `kn func build` command, or you are prompted to provide a registry value in the terminal when building a function. An image name is then derived from the registry value that you have provided.
27-
28-
.Example command using the `-r` registry flag
13+
.Example build command
2914
[source,terminal]
3015
----
31-
$ kn func build [-i <image> -r <registry> -p <path>]
16+
$ kn func build -r quay.io/username
3217
----
18+
// removed mentioning the `FUNC_REGISTRY` environment variable because we didn't provide an example and it seems unnecessary - can add it in later if it's important
3319

3420
.Example output
3521
[source,terminal]
@@ -38,17 +24,10 @@ Building function image
3824
Function image has been built, image: quay.io/username/example-function:latest
3925
----
4026

41-
This command creates an OCI container image that can be run locally on your computer, or on a Kubernetes cluster.
27+
To learn more about `kn func build` command options, you can use the help command:
4228

43-
.Example using the registy prompt
29+
.Build help command
4430
[source,terminal]
4531
----
46-
$ kn func build
47-
A registry for function images is required (e.g. 'quay.io/boson').
48-
49-
Registry for function images: quay.io/username
50-
Building function image
51-
Function image has been built, image: quay.io/username/example-function:latest
32+
$ kn func help build
5233
----
53-
54-
The values for image and registry are persisted to the `func.yaml` file, so that subsequent invocations do not require the user to specify these again.

modules/serverless-deploy-func-kn.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
[id="serverless-deploy-func-kn_{context}"]
77
= Deploying functions
88

9-
You can deploy a function to your cluster as a Knative service by using the `kn func deploy` command.
10-
11-
If the targeted function is already deployed, it is updated with a new container image that is pushed to a container image registry, and the Knative service is updated.
9+
You can deploy a function to your cluster as a Knative service by using the `kn func deploy` command. If the targeted function is already deployed, it is updated with a new container image that is pushed to a container image registry, and the Knative service is updated.
1210

1311
.Prerequisites
1412

1513
* The {ServerlessOperatorName} and Knative Serving are installed on the cluster.
16-
* You have installed the `kn` CLI.
14+
* You have installed the Knative (`kn`) CLI.
1715
* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}.
1816
* You must have already created and initialized the function that you want to deploy.
1917
@@ -23,7 +21,7 @@ If the targeted function is already deployed, it is updated with a new container
2321
+
2422
[source,terminal]
2523
----
26-
$ kn func deploy [-n <namespace> -p <path> -i <image> -r <registry>]
24+
$ kn func deploy [-n <namespace> -p <path> -i <image>]
2725
----
2826
+
2927
.Example output

modules/serverless-functions-using-integrated-registry.adoc

Lines changed: 0 additions & 34 deletions
This file was deleted.

serverless/functions/serverless-functions-getting-started.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9+
This guide explains how you can get started with creating, building, and deploying a function on an {ServerlessProductName} installation. When building and deploying functions, the resulting container image is stored in an image registry.
10+
911
:FeatureName: {FunctionsProductName}
1012
include::snippets/technology-preview.adoc[leveloffset=+2]
1113

12-
This guide explains how you can get started with creating, building, and deploying a function on an {ServerlessProductName} installation.
13-
1414
[id="prerequisites_serverless-functions-getting-started"]
1515
== Prerequisites
1616

@@ -20,7 +20,6 @@ include::modules/serverless-create-func-kn.adoc[leveloffset=+1]
2020
include::modules/serverless-build-func-kn.adoc[leveloffset=+1]
2121
include::modules/serverless-deploy-func-kn.adoc[leveloffset=+1]
2222
include::modules/serverless-kn-func-invoke.adoc[leveloffset=+1]
23-
include::modules/serverless-functions-using-integrated-registry.adoc[leveloffset=+1]
2423

2524
ifdef::openshift-enterprise[]
2625
[id="additional-resources_serverless-functions-getting-started"]

0 commit comments

Comments
 (0)