×
Community Blog Deploying Serverless Applications with ACK One and Knative for On-Premises Data Centers

Deploying Serverless Applications with ACK One and Knative for On-Premises Data Centers

This article introduces how to use ACK One and Knative to manage cloud resources.

By Yuanyi and Yu Zhuang

How to build a unified cloud-native serverless application platform on and outside the cloud? To put it simply, there are two key points: a distributed cloud or hybrid cloud strategy, and a standardized technical solution.

The Trend of Distributed Cloud

According to Gartner's report, by 2025, 50% of large enterprises will transform their business models in their chosen regions through distributed cloud services. Additionally, IDC's report states that in 2021, 86% of enterprises adopted distributed or hybrid cloud architecture, with only 14% opting for a public cloud. Gartner's report highlights security, operational complexity, and financial complexity as the main challenges of distributed cloud architecture.

0

Customer Demands

Technology selection: how to select a standardized serverless technology solution to achieve unified technology stacks on and outside clouds

Lower costs: how to reduce resource and O&M costs

Stability: how to ensure the stability of service operation

Resiliency: on-premises IDC clusters can also elastically scale resources and indefinitely scale out serverless applications

Why Knative?

Knative is an open-source Kubernetes-based serverless application orchestration framework. With its advantages of cloud-native and cross-platform serverless application orchestration, Knative has become a popular open-source serverless framework. Knative consists of three core components. These components form a general-purpose serverless framework:

Serving: manages serverless workloads based on events and can automatically scale pods based on resource requests. If no workload is to be processed, the number of pods is scaled to zero. Serving is used to manage the workloads of serverless applications to provide services to users. Pod auto-scaling is one of the most important features of Knative Serving. Currently, pods can be scaled without limits. Knative Serving also supports canary release.

Eventing: provides event management capabilities, such as producing and consuming events. Eventing provides an all-in-one system for event-driven serverless applications. The system provides features that allow you to install external event sources, register and subscribe to events, and filter events. The event system decouples event producers and event consumers. An event producer can generate events before active event consumers listen to events. An event consumer can listen to events before active producers produce events.

Function: Knative Functions provides you with an easy way to create, build, and deploy Knative services. You can use Knative Functions to deploy stateless, event-driven functions as Knative services to Kubernetes clusters without the need to deeply understand the underlying technology stacks, such as Kubernetes, containers, and Knative.

1

ACK One

ACK One (Distributed Cloud Container Platform for Kubernetes) is an enterprise-level cloud-native platform provided by Alibaba Cloud to meet container management requirements in hybrid cloud, multi-cluster, distributed computing, and disaster recovery scenarios.

_1

Build a Unified Cloud-native Serverless Application Platform on and Outside the Cloud

ACK One now supports managed Knative. You can use ACK One and Knative to build a unified cloud-native serverless application platform on and outside the cloud so that you can use Knative to manage cloud resources with ease. On-premises IDC clusters can also elastically scale resources and indefinitely scale out serverless applications.

_2

Advantages

• Self-built on-premises IDC clusters are connected to ACK One registered clusters, realizing the same O&M experience as ACK One.

• Consistent user experience of Knative, and O&M-free components

• ACK One registered clusters provide cloud-based elasticity for self-built on-premises IDC clusters. Combined with ECIs (Elastic Container Instances), ACK One allows you to use cloud resources on demand at any time.

• ACK clusters on the public cloud and self-built on-premises IDC clusters provide higher stability.

Deploy LangChain-Chatchat Based on ACK One + Knative

LangChain-Chatchat is an open-source Q&A application based on the local knowledge base that utilizes LangChain. Let's take a look at how to deploy a LangChain-Chatchat application based on ACK One + Knative.

Prerequisites

• An external cluster is registered with Container Service for Kubernetes (ACK) through a registered cluster. For more information, see Create a registered cluster [1].

• Only offline clusters in Calico route reflection mode or Cilium BGP route mode are supported.

Deploy a Knative Service

  1. Log on to the ACK console [2]. In the left-side navigation pane, click Clusters.
  2. On the Clusters page, click the name of the registered cluster. In the left-side navigation pane, choose Applications > Knative.
  3. On the Services tab of the Knative page, set Namespace to default, click Create from Template, paste the following YAML sample to the template, and then click Create to create a service named knative-llc-demo.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: knative-llc-demo
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/maxScale: '100'
        autoscaling.knative.dev/minScale: '1'
        k8s.aliyun.com/eci-extra-ephemeral-storage: 80Gi
        k8s.aliyun.com/eci-use-specs: 'ecs.gn5-c4g1.xlarge,ecs.gn5i-c8g1.2xlarge,ecs.gn5-c8g1.2xlarge'
    spec:
      containers:
      - image: registry.cn-hangzhou.aliyuncs.com/knative-sample/chatchat:0.2.7
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8501
          name: http1
          protocol: TCP
        name: lcc

On the Services tab, record the gateway IP address and the default domain name of the Service.

3

1.  Add the following information to the hosts file to point the domain name of the service to the IP address of the gateway for the knative-llc-demo service. The following sample code shows the content to be added to the hosts file.

39.104.58.99 knative-llc-demo.default.example.com # The gateway IP address and domain name are subject to your actual data. 

2.  After you modify the hosts file, on the Services tab, click the Default Domain Name of the knative-llc-demo service to access LangChain-Chatchat. As shown in the figure, LangChain-Chatchat can be directly accessed through the domain name.

4

Summary

ACK One now supports managed Knative, providing standardized serverless application capabilities both on and off the cloud. By connecting a self-built on-premises IDC cluster to ACK One through a registered cluster, you can achieve the same operational and maintenance experience as with ACK One. Additionally, ACK One offers elastic capabilities on the cloud. When combined with ECIs, ACK One enables on-demand utilization of cloud resources and the infinite scaling out of serverless applications. For more details, please refer to ACK One registered clusters [3] and ACK One Knative [4].

References

[1] Create an ACK One registered cluster

[2] ACK console

[3] ACK One registered clusters

[4] ACK One Knative

0 1 0
Share on

Alibaba Container Service

121 posts | 26 followers

You may also like

Comments

Alibaba Container Service

121 posts | 26 followers

Related Products