How Does OAM Benefit Cloud Native Applications?

Image for post
Image for post

By Sun Jianbo (nicknamed Tianyuan), Alibaba technical expert

Background

Today, I will discuss the value of OAM, that is, why we should use OAM as a standard model for cloud native applications.

Concepts behind AWS ECS CLI v2

Based on user feedback received over the years, they summarized four CLI development principles:

  • The created application is a modern one by default. By default, a modern application has the following characteristics: serverless, infrastructure as code, observable, and secure.
  • For such an application, users should consider the architecture, but not the infrastructure. When building a microservice, developers should not specify the VPC, server load balancer configuration, or a complex pipeline process configuration. During application development, developers may know nothing about cloud services, but they should determine the type of the application, that is, which architecture the application should adapt to. Then, infrastructure can be automatically matched to resources according to the specified architecture.
  • O&M is also part of the workflow. Application developers are only responsible for building, developing, and deploying applications in the application lifecycle. O&M, referring to troubleshooting and problem-solving, also needs to be included into the application lifecycle.
  • Application delivery is continuous. Application upgrades and updates can be easily integrated into the CI/CD system.

As you may notice, these principles are not so much the development principles of ECS CLI as the demands of users:

  • Users want their applications to be modern or cloud-native.
  • Users want applications to specify architectures, rather than specific infrastructure resources.
  • Users want O&M capabilities to be centrally managed as part of the application lifecycle.
  • Users want the delivery of application updates to be continuously, transparently, and conveniently integrated with and managed by the CI/CD system.

Value of the OAM Model

Cloud Native

  • OAM application definitions are self-contained. That is, the description of an OAM definition provides information on all aspects of the application lifecycle.

As shown in the following figure, an application configuration that is running OAM uses Kubernetes API specifications, which contain all the resources of an application.

Image for post
Image for post

Independent from Platforms and Runtimes

Image for post
Image for post

In different environments that support OAM, you can use a unified application description to achieve identical application delivery. As shown in the following figure, users only need to describe the unified application configuration to achieve the same application experience in different environments.

Image for post
Image for post

Infrastructure as Code

Today, the OAM implementation of the Alibaba Cloud resource orchestration product ROS provides a classic example. You can use OAM configurations to pull up infrastructure resources in the cloud.

Let’s look at a real-world example. Assume that we want to pull up a NAS persistent storage, which contains two ROS resources, which are NAS FileSystem and NAS MountTarget.

apiVersion: core.oam.dev/v1alpha1
kind: ComponentSchematic
metadata:
name: nasFileSystem
annotations:
version: v1.0.0
description: >
component schematic that describes the nas filesystem.
spec:
workloadType: ros.aliyun.com/v1alpha1.NAS_FileSystem
workloadSettings:
ProtocolType: NFS
StorageType: Performance
Description: xxx
expose:
- name: fileSystemOut
---
apiVersion: core.oam.dev/v1alpha1
kind: ComponentSchematic
metadata:
name: nasMountTarget
annotations:
version: v1.0.0
description: >
component schematic that describes the nas filesystem.
spec:
workloadType: ros.aliyun.com/v1alpha1.NAS_MountTarget
workloadSettings:
NetworkType: VPC
AccessGroupName: xxx
FileSystemId: ${fileSystemOut.FileSystemId}
consume:
- name: fileSystemOut
expose:
- name: moutTargetOut
---
apiVersion: core.oam.dev/v1alpha1
kind: ApplicationConfiguration
metadata:
name: nas-demo
spec:
components:
- componentName: nasMountTarget
traits:
- name: DeletionPolicy
properties: "Retain"
- componentName: nasFileSystem
traits:
- name: DeletionPolicy
properties: "Retain"

In the definition, you can see that NAS MountTarget uses FileSystemId that is output by NAS FileSystem, and ultimately, this YAML file is translated by ROS OAM Controller into the template file of the ROS resource stack. In this way, the cloud resources are pulled up.

The OAM implementation of ROS will soon be made open source, so stay tuned!

Focus on the Architecture Rather than the Infrastructure

OAM addresses such requirements by describing the WorkloadType of an application to define the application architecture. This WorkloadType can be a simple stateless application “server”, which means that the application can be replicated, accessed, and persistently run as a daemon. Also, the WorkloadType can be a database-type application “RDS”, which starts an RDS instance in the cloud.

The “Component” user component selects a specific architecture template by specifying “WorkloadType”, and multiple Components constitute a complete architecture.

When using OAM application definitions, users are concerned with the architecture, not the specific infrastructure.

As shown in the following figure, an OAM application description allows you to specify that the application requires a public network access capability instead of a Server Load Balancer (SLB). In this case, you can specify that the components of the application are database components.

Image for post
Image for post

O&M Capability Management

As shown in the following figure, an application contains two components: a web service and a database. The database component is able to back up data, while the web service can be accessed and elastically scaled. These capabilities are managed by the OAM interpreter (the OAM implementation layer) in a centralized manner. This eliminates the need to worry about any O&M capability binding conflicts.

Image for post
Image for post

Transparent Integration

Image for post
Image for post

Separation of Different Roles and Concerns

Image for post
Image for post

Scalability

Image for post
Image for post

Modular Collaboration

Image for post
Image for post

As the number of modular Workloads and Traits increases, a market for these components will be formed. On this market, users will be able to quickly find architectures (Workloads) suitable for their applications and the required O&M capabilities (Traits) in CRD Registry and other similar registries. This makes building applications effortless.

Looking Ahead

Original Source:

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