The author | Xu Yunyuan, hangzhou harmonic cloud technology partners and senior architect, cloud computing and Kubernetes ecological senior industry practitioners

** What is OAM? On October 17, 2019, Alibaba partner, Ali Cloud Intelligent basic product Division general Manager Jiang Jiangwei (name: Xiao Xie) announced at QCon Shanghai 2019 that Ali Cloud and Microsoft jointly launched Open Application Model (OAM) Open source project.

The core focus of OAM

  • * separation of concerns: ** Developers focus on the application itself, while operations personnel focus on modular operation and maintenance capabilities, making application management easier and application delivery more controllable;
  • ** Platform independent and highly extensible: ** Application definition is decoupled from platform layer implementation, application description supports arbitrary extension and cross-environment implementation;
  • ** Modular application o&M characteristics: ** O&M characteristics description that can be freely combined and support modular implementation.

Core modules of OAM

1. Application Components

In OAM, an “application” is a combination of multiple concepts. The first concept is application Components, which are an important part of the entire application. Application components can include either the services on which the application runs, such as the MySQL database, or the application services themselves, such as PHP servers that have multiple copies. Developers can “package” their code into an application component, and then write configuration files that describe how that component relates to other services.

Application components to the concept of platform architect to applications such as broken down into each module can be reused, this modular encapsulation application part of thought, represents a kind of building security, high scalability application of best practice: by a fully distributed architecture model, implements the application component description and implementation of decoupling.

2. Application Configuration file

To turn the application component description into a running application, the application operations person instantiates the application to be run through a special deployment configuration file that contains all the application component information. The configuration file itself is a declarative API in the OAM specification that allows application operators to instantiate a running application based on the application description submitted by the developer or platform.

3. Application of operation characteristics (Traits)

Finally a concept is a set of application operational characteristics (Traits), they describe the application in the concrete operational characteristics of the deployment environment, such as the application of horizontal extension strategy and rules of Ingress, these characteristics for application of operations is very important, but they are often in a different deployment environment has a very different way. To take a simple example, the same Ingress may be implemented completely differently on a public cloud than on a local data center: the former is typically a cloud service like SLB, while the latter may be a specialized piece of hardware. This means that the Ingress operation and maintenance work for these two environments will be vastly different. But at the same time, this Ingress rule may be exactly the same for an application developer, regardless of the environment.

The design of the application characteristics makes this separation of concerns possible: as long as the two environments provide an implementation of the Ingress application’s operation characteristics under the OAM model, the application can operate indiscriminably in both places using a unified Ingress rule description. In the meantime, infrastructure vendors in both environments can continue to configure implementations of these application characteristics to meet their respective operational requirements (e.g., compliance and security differences between Ingress implementations in different environments).

An introduction to a visual implementation based on OAM

At present, the platform is mainly based on the V1 alpha1 version of OAM, and the core concepts of OAM are abstracted and encapsulated to better meet the user’s usage habits. Behind the visualization section of this article is the complete YAML file in OAM format. The visual OAM platform mainly contains two core functions:

1. Operation and maintenance feature model

The o&M feature model is a concrete instantiation of OAM Traits, allowing users to plug and remove complex OAM features directly for application publishers to use. Currently, the platform has encapsulated eight o&M features, including service publishing, log collection, automatic scaling, and storage mounting.

2. OAM application choreography

The OAM application orchestration function visualizes the entire OAM application publishing process and abstracts and encapsulates OAM core functions such as adding application components, modifying configuration files, and adding operation and maintenance features. OAM application Choreography currently contains the following core functions:

  • Component choreography: visually add platform components and set component parameters;
  • ** Operation feature arrangement: ** add and arrange operation and maintenance features on the basis of added platform components (also prepare for subsequent development and separation of operation and maintenance concerns);
  • **OAM version management: ** The platform stores all OAM releases and provides upgrade and rollback functions.

Next, we will take a typical application (Nginx + Tomcat + Redis) deployment to fully explain how to perform visual distribution of OAM on the platform.

precondition

The Traints application model has been installed. On the interface, you can quickly view the application models of operation characteristics and their running status. Currently, only system-defined O&M features are supported. User-defined O&M feature lifecycle management will be developed in the future. Allows users to write their own operations and maintenance features and install them into the platform for use.

OAM application creation process

OAM application publishing process: Create an application, add a component, choreograph an application, save the version, and publish an application.

  • ** Create app: ** Click Application ->OAM App menu, click “Create App” button, enter required items;

  • ** Add component: ** Click the “Add Component” button to set the workload type, container configuration, etc.

Select the type of workload you want to create. Currently, six core workloads including Server, Singleton Server, Task, Singleton Task, Worker and Singleton Worker have been encapsulated. You only need to select the type of load you want to create from the drop-down list box.

After selecting the load type, users can visually select the image they want to publish and the basic configuration parameters of the container. Orchestration publishing based on multiple containers is also currently supported.

  • According to our needs, we successively add tomcat, Redis, mysql three components, you can see the status of components on the interface, and click “details” you can see the corresponding Kubernetes resource information;

View component details.

  • ** Application Choreography: ** After creating the components that need to be deployed, our OAM application is ready for development.

Then we need to add the operation characteristics to each component as required: click into the Application Layout screen, you can see the newly added component is displayed on the canvas; Click a single component on the canvas to see the o&M features currently suitable for the component. Check the o&M features you need to quickly add. After o&M features are added, the configuration parameters of o&M features will be displayed in the right bar. These o&M features will take effect after the configuration is saved.

  • After adding the operation and maintenance characteristics of all components, we can see a complete choreographed OAM application. In THE V2 version of OAM, we will also add the dependency relationship between applications. Users can drag and drop and connect to realize the dependency arrangement between applications.

  • ** Save version: ** Finally, we can click “Save current content as version” button, enter the version number, and click “OK”;

  • ** Publish the app: ** Click the “Publish” button to publish the app

After the application is published, the component status is instantiated. The application instance status is Healthy.

Click the Events TAB to display the events.

Users can quickly view and access the ingress that has been created.

  • Users can modify the Traints information to quickly modify and upgrade the current application.

Click to enter the application choreography screen and set the number of Tomcat instances to 4.

Saving the edited version as the current version directly updates the modified configuration to the current instance. If you choose to save as a new version, the current configuration changes are saved as a template for publication. We save this change as the new version.

Click Update for this version to publish the configuration you just modified. Once the release is complete, we can see that there are two versions of the OAM application template.

Check the details and confirm that the number of Tomcat instances has changed to 4, but since we also set the automatic scaling to 3 instances, it quickly changed back to 3 instances after capacity expansion.

At this point, a complete visual process for deploying and updating OAM applications is demonstrated.

conclusion

Today, OAM Spec has been iterated to v1Alpha2. The new version is more kubernetes-friendly while adhering to the OAM Spec platform independence, largely balancing standards and extensibility, and better supporting existing CRDS. That is, if you have already written a CRD Operator, you can plug smoothly into the OAM architecture and enjoy the benefits of the OAM model.

For a more detailed introduction to the new version, you can read OAM V1Alpha2 New Release: Balancing Standards and Scalability for Flexible Access to CRD Operators.

The visualization platform is also in the process of being fully upgraded to V1Alpha2, with new support allowing users to write plug-ins to extend the platform’s functionality.

The platform comes from Hangzhou Harmonic Cloud Technology, ali Cloud’s strategic partner. The open source version of the platform based on OAM is already on the way, so please look forward to it.

  • The OAM platform trial site: http://139.196.197.117:30088/ username/password: admin/Ab123456
  • All yamL files in Demo can be viewed at github: github.com/harmonyclou…

Currently, the OAM specification and model have actually addressed many of the existing problems, but its journey has only just begun. OAM is a neutral open source project and we welcome more people to join us in defining the future of cloud native application delivery. Participation:

  • Nail scan code into OAM Project Chinese discussion group

  • Participate directly in the discussion via Gitter
  • OAM open source implementation address
  • I’m gonna hit star

Hangzhou Harmoncloud Technology Co., Ltd. was founded in July 2016. The core team of the company comes from SEL Laboratory of Zhejiang University. The harmoncloud team has profound technical accumulation in cloud computing and related fields. In the world’s top open source community Docker, Kubernetes, Cloud Foundry and other projects contributed more than 2 million lines of code, ranked the fourth in the world, the first in China. The team has written Docker Container and Container Cloud, the first professional book in-depth analysis of container cloud in China, and is one of the few container cloud providers in China who master the underlying core technology. It has built the largest container cluster landing case in China and supports the largest Internet TV cloud in China.

Course recommended

In order for more developers to enjoy the dividends brought by Serverless, this time, we gathered 10+ Technical experts in the field of Serverless from Alibaba to create the most suitable Serverless open course for developers to learn and use immediately. Easily embrace the new paradigm of cloud computing – Serverless.

Click to free courses: developer.aliyun.com/learning/ro…

“Alibaba Cloud originator focuses on micro-service, Serverless, container, Service Mesh and other technical fields, focuses on the trend of cloud native popular technology, large-scale implementation of cloud native practice, and becomes the public account that most understands cloud native developers.”