This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.6.4. Creating serverless applications using YAML
To create a serverless application by using YAML, you must create a YAML file that defines a Service, then apply it by using oc apply
.
Procedure
Create a YAML file, then copy the following example into the file:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Navigate to the directory where the YAML file is contained, and deploy the application by applying the YAML file:
oc apply -f <filename>
$ oc apply -f <filename>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After the Service is created and the application is deployed, Knative creates an immutable Revision for this version of the application.
Knative also performs network programming to create a Route, Ingress, Service, and load balancer for your application and automatically scales your pods up and down based on traffic, including inactive pods.