modules/common-attributes.adoc :context: serverless-applications
To deploy a serverless application using {ServerlessProductName}, you must create a Knative service. Knative services are Kubernetes services, defined by a route and a configuration, and contained in a YAML file.
Example Knative service YAML
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: hello (1)
namespace: default (2)
spec:
template:
spec:
containers:
- image: docker.io/openshift/hello-openshift (3)
env:
- name: RESPONSE (4)
value: "Hello Serverless!"
-
The name of the application.
-
The namespace the application uses.
-
The image of the application.
-
The environment variable printed out by the sample application.
You can create a serverless application by using one of the following methods:
-
Create a Knative service from the {product-title} web console. See the documentation about Creating applications using the Developer perspective.
-
Create a Knative service using the
kn
CLI. -
Create and apply a YAML file.