This topic describes how to use Knative to deploy an application.
- A Kubernetes cluster is created with ACK. For more information, see Create an ACK cluster.
- Knative is deployed on the Kubernetes cluster. For more information, see Deploy Knative components on a Kubernetes cluster.
- The Serving component is deployed on the Kubernetes cluster. For more information, see Deploy a Knative component.
- Log on to the Container Service console.
- In the left-side navigation pane under Container Service-Kubernetes, choose .
- In the upper-righter corner, click Create Service.
- Set the following parameters:
- Service Name: Set the service name. In this example, the service name is set as helloworld-go.
- Image Name: Select an image by clicking Select Image, or in the box, enter a private registry that must be in the format of domainname/namespace/imagename:tag.
Note In this example, the registry registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go is used.
- Image Version: Select an image by clicking Select Image Version, or in the box, enter an image version. By default, if you do not set this parameter, the latest image version is used. In this example, the image version is set as 73fbdd56.
- Environment Variables: Set an environment variable by entering a key-value pair. In this example, the environment
variable is set as
- Click Create.
On the Knative Service Manage page, the created service is then displayed.
Verify the result
To access the created Knative service through its URL, follow these steps:
- In the left-side navigation pane under Container Service-Kubernetes, choose to view the IP address of the gateway of the Knative service.
- In the host file of your local host, associate the IP address of the gateway and the
domain name of the Knative service with your local host by adding the following information:
The following is a sample:
the IP address of the gateway + the domain name
- In your browser, enter the URL http://helloworld-go.default.example.com to access the Knative service.