Deploy your workloads as a Knative service for use cases such as web hosting, serverless applications, AI tasks, and event-driven architectures. A Knative service lets you use resources on demand and focus on your business logic. It provides features like request-based auto scaling, scaling to zero pods when idle, and simplified revision management.
Prerequisites
Knative is deployed in your cluster. For more information, see Deploy and manage Knative components.
Step 1: Deploy a Knative service
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
Click the Services tab. At the top of the Services page, select the namespace for the service. Then, deploy the Knative service.
You can deploy the service from the console or by using YAML.
Console
In the upper-right corner of the Services page, click Create Service and configure the parameters.
Parameter
Description
Service name
Enter a custom name for the service.
Image name
Click Select Image and choose an image from the dialog box.
You can also specify a private image and tag. The format is
domainname/namespace/imagename:tag.You can also use the demo image and version provided by ACK as prompted on the page. This example uses
registry-vpc.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:73fbdd56(replace the regioncn-hangzhouwith your actual region).Set Image Pull Secret
Credentials used to pull private images.
Access Protocol
The supported protocols are HTTP and gRPC.
Container port
The port on the container that listens for network traffic. The port number must be between 1 and 65535.
Advanced
Click Advanced Settings to configure more settings.
YAML
In the upper-right corner of the Services page, click Create from Template.
In the editor, paste your YAML manifest and click Create.
For example, paste the following YAML into the template 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-hangzhou.aliyuncs.com/knative-sample/helloworld-go:73fbdd56 # Replace with your region ID. env: - name: TARGET value: "Knative"
After the service is created, it appears on the Services tab. From here, you can view, edit, or delete the service.
Step 2: Access the service
After the Knative service is created, you can access it by mapping the service's domain name to the gateway IP address in your local hosts file.
On the Services tab, click the service name.
In the Basic Information section of the details page, find the access gateway and domain name.
Add an entry to your local hosts file to map the gateway IP address to the domain name.
The following example shows the format.
121.xx.xxx.xx helloworld-go.default.example.comAccess the service in your browser by using its domain name.

Related topics
For more information about how to use a custom domain name for your Knative service, see Use a custom domain and path.
For more information about how to configure an HTTPS certificate for your Knative service, see Configure an HTTPS certificate.
For more information about how to create a revision to manage different versions of your Knative service, see Create a revision.
If your workload experiences unpredictable traffic spikes, you can deploy the Knative service by using Elastic Container Instance (ECI) resources. For more information, see Use Elastic Container Instance resources.
For more information about how to implement request-based auto scaling for your Knative service, see Implement request-based auto scaling.
For more information about how to deploy Knative Eventing and create event-driven workloads, see Knative Eventing.