We recommend that you deploy Knative Services for hosted web services, serverless applications, AI jobs, and event-driven systems. Knative Services enable you to use resources on demand, focus on business logic development, and benefit from auto scaling based on requests. When no traffic is sent to your Service, the number of pods is automatically scaled to zero. Knative Services also greatly simplify version management.
Prerequisites
Knative is deployed in the ACS cluster. For more information, see Deploy Knative.
Step 1: Deploy a Knative Service
Log on to the ACS console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its ID. In the left-side navigation pane of the cluster details page, choose .
Click the Services tab. Select the namespace to which the Service belongs in the top navigation bar on the Services tab. Then, deploy a Knative Service.
You can deploy a Knative Service by using the wizard or the YAML editor.
Use the console
On the Services tab, click Create Service, and finish the configuration as prompted.
Parameter
Description
Service Name
Enter a name for the Service.
Image Name
Click Select Image. In the Select Image dialog box, select an image that you need. You can also enter the address of a private image registry. The address must be in the domainname/namespace/imagename:tag format.
In this example, registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go is used.
Image Version
Click Select Image Version. In this example, the image version is 73fbdd56.
Access Protocol
HTTP and gRPC are supported.
Container Port
The container port that you want to expose. The port number must be in the range of 1 to 65535.
Advanced
Click Advanced to configure the advanced settings.
Use the YAML editor
In the upper-right part of the Services tab, click Create from YAML.
Enter the YAML content of the Service into the YAML editor and click Create.
For example, copy the following YAML content to the editor to create a Service named
helloworld-go.apiVersion: serving.knative.dev/v1 kind: Service metadata: name: helloworld-go spec: template: spec: containers: - image: registry-vpc.cn-beijing.aliyuncs.com/knative-sample/helloworld-go:73fbdd56 env: - name: TARGET value: "Knative"
After the Service is created, you can view, modify, or delete the Service on the Services tab.
Step 2: Access the Knative Service
After the Knative Service is deployed, you can point its domain name to the IP address of a gateway to associate the Service with the gateway. This allows you to access the Knative Service by using its domain name. To do this, perform the following operations:
On the Services tab, click the name of the Service.
In the Basic Information section, you can view information about the gateway and domain name.
Add the following information to the hosts file to point the domain name of the Service to the IP address of the gateway.
Example:
121.xx.xxx.xx helloworld-go.default.example.comAfter you modify the hosts file, you can use the domain name to access the Knative Service.

References
You can specify custom domain names for Knative Services. For more information, see Configure a custom domain name.
You can configure a certificate to access Knative Services over HTTPS. For more information, see Configure a certificate to access Knative Services over HTTPS.
You can create revisions to manage the versions of Knative Services. For more information, see Create a revision.
For more information about how to implement auto scaling for a Knative Service based on requests, see Configure auto scaling based on the number of requests.
To deploy Knative Eventing and implement Knative Eventing, see Knative Eventing.