Getting Started with Knative on Alibaba Cloud Service Kubernetes

Overview

Knative Serving builds on Kubernetes and Istio to support deploying and serving of serverless applications and functions. Serving is easy to get started with and scales to support advanced scenarios.

Let’s introduce how to quickly install Knative Serving and scale automatically based on Alibaba Cloud Container Service for Kubernetes

Installing Knative Serving

Prepare Kubernetes

Alibaba Cloud Container Service supports the Kubernetes 1.12.6 now, making it easy to create Kubernetes clusters through the Container Service Management Console, see Create a Kubernetes cluster.

Installing Istio

Knative depends on Istio for traffic routing and ingress. Currently, Alibaba Cloud Container Service Kubernetes has provided a quick one-click deployment to install and configure Istio, see the Deploy Istio.

Log on to the Container Service console. Under Kubernetes, click Clusters in the left-side navigation pane. On the right of the target cluster, choose More > Deploy Istio.

You can view your deployment results in the following way:

  • In the left-side navigation pane, choose Application > Pods, select the cluster and namespace in which Istio is deployed, and you can see the relevant pods in which Istio is deployed.

Installing Istio Ingress Gateway

In the left-side navigation pane, choose Store > App Catalog. Click the ack-istio-ingressgateway.

Click the Values tab, and then set the parameters. You can set customized parameters, including indicating whether to enable a specific port, or whether to use the intranet SLB or the Internet SLB by setting the serviceAnnotations parameter.

In the left-side navigation pane, choose Application > Pod. Select the target cluster and the istio-systemnamespace to view the pod to which the Istio Ingress gateway has been deployed.

Installing Knative CRD

Log on to the Container Service console. In the left-side navigation pane, choose Store > App Catalog. Click the ack-knative-init.

In the Deploy area on the right, select the target Cluster from the drop-down list, and then click DEPLOY.

Installing Knative Serving

Log on to the Container Service console. In the left-side navigation pane, choose Store > App Catalog. Click the ack-knative-serving.

Click the Values tab, then set the parameters. You can set customized values for parameters, or use the default value Istio IngressGateway. And then click DEPLOY.

Currently, the all four Helm charts for the Knative serving have been installed. Like this:

Getting Started with Knative

Deploy the Autoscale Sample

Deploy the sample Knative Service, run the following command:

Example of the autoscale.yaml:

Load the Autoscale Service

Obtain both the hostname and IP address of the istio-ingressgateway service in the istio-system namespace, and then export them into the IP_ADDRESS environment variable.

Make a request to the autoscale app to see it consume some resources.

Note, need to replace the {domain.name} to your domain. The domain name of the sample is aliyun.com.

Installing the hey load generator:

Send 30 seconds of traffic maintaining 50 in-flight requests:

With the traffic request running for 30 seconds, the Knative Serving scale automatically as the requests increasing.

Conclusion

Based on Alibaba Cloud’s Container Service for Kubernetes, we can quickly install Knative Serving and scale automatically. Welcome to use the container service on Alibaba Cloud to install Knative and integrate it into your product.

Reference:https://www.alibabacloud.com/blog/getting-started-with-knative-on-alibaba-cloud-service-kubernetes_594885?spm=a2c41.12950412.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store