All Products
Search
Document Center

Container Compute Service:Quickly deploy a Knative Service

Last Updated:Mar 26, 2026

Knative Services are suited for hosted web services, serverless applications, AI jobs, and event-driven systems. They scale automatically based on incoming traffic—including down to zero pods when no requests arrive—so you pay only for what you use and can focus on your application logic instead of infrastructure. Knative Services also greatly simplify version management.

Prerequisites

Before you begin, ensure that you have:

Deploy a Knative Service

  1. Log on to the ACS console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the ID of the cluster you want to manage. In the left-side navigation pane of the cluster details page, choose Applications > Knative.

  3. Click the Services tab. In the top navigation bar, select the namespace for your Service.

  4. Deploy the Service using the console wizard or the YAML editor.

Use the console

Click Create Service and complete the configuration.

Parameter Description
Service Name Enter a name for the Service.
Image Name Click Select Image. In the Select Image dialog box, choose an image. You can also enter a private image registry address in domainname/namespace/imagename:tag format. Example: registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go
Image Version Click Select Image Version. Example version: 73fbdd56
Access Protocol Select HTTP or gRPC.
Container Port The container port to expose. Valid values: 1–65535.

Click Advanced to configure additional settings.

Parameter Description
Internal Access Only If selected, the Service is not accessible over the Internet.
Maximum Concurrent Requests Maximum concurrent requests the container handles. Default: 0 (unlimited).
Minimum Pods Minimum pods to keep running when no requests arrive. Set to 0 to enable scale-to-zero.
Maximum Pods Maximum pods allowed.
Resource Limit Upper limits for CPU (cores), memory (bytes or mebibytes), and GPU resources.
Lifecycle Specify Command and Parameter to override the image's default entrypoint. If only Parameter is set, the image's default command is used with the specified parameter. If both are set, both image defaults are overridden.
Environment Variables Key-value pairs passed to the container.
Volume Mount local storage or persistent volume claims (PVCs). For local storage, choose HostPath, ConfigMap, Secret, or EmptyDir. For PVCs, select Cloud Storage.

Use the YAML editor

  1. In the upper-right corner of the Services tab, click Create from YAML.

  2. Paste your YAML into the editor and click Create. The following example creates a Service named helloworld-go:

    apiVersion: serving.knative.dev/v1
    kind: Service
    metadata:
      name: helloworld-go          # [1]
    spec:
      template:
        spec:
          containers:
          - image: registry-vpc.cn-beijing.aliyuncs.com/knative-sample/helloworld-go:73fbdd56  # [2]
            env:
            - name: TARGET         # [3]
              value: "Knative"

    [1] The Service name. Used as part of the default domain name. [2] The container image, including the registry address and image version tag. [3] An environment variable passed to the application.

You can view, edit, or delete the Service at any time on the Services tab.

Access the Knative Service

To access the Service using its domain name, point the domain name to the gateway IP address.

  1. On the Services tab, click the Service name.

  2. In the Basic Information section, note the gateway IP address and domain name.

    新服务

  3. Add an entry to your local hosts file to map the domain name to the gateway IP address:

    121.xx.xxx.xx helloworld-go.default.example.com
  4. Use the domain name to access the Knative Service.

    访问服务

What's next

References