Serverless applications are faster and easier with OpenShift

Red Hat OpenShift Serverless is a set of event-driven Kubernetes-based components for microservices, containers, and Function-as-a-Service (FaaS) implementations.

Serverless applications are faster and easier with OpenShift

This out-of-the-box solution includes security and traffic routing and combines Red Hat Operators, Native и Red Hat OpenShift to run stateless and serverless workloads on the OpenShift platform in private, public, hybrid and multi-cloud environments.

OpenShift Serverless allows developers to fully focus on creating next-generation applications by offering a wide range of programming languages, frameworks, development environments and other tools to create and deploy disruptive business products.

Key Features of Red Hat OpenShift Serverless:

  • A wide range of programming languages ​​and runtime components for serverless applications. You can choose exactly the set of tools that you need.
  • Automatic horizontal scaling depending on the intensity of requests or on the occurrence of events to effectively manage resources based on real, not speculative needs
  • Full integration with OpenShift Pipelines, a Kubernetes-based continuous build and delivery (CI/CD) system based on Tekton
  • A Red Hat Operator foundation that allows administrators to securely manage and update running instances, and organizes the application lifecycle by cloud service type
  • Constant tracking of new community releases, including Knative 0.13 Serving, Eventing, and kn (the official CLI for Knative) - as with all Red Hat products, this means extensive testing and validation across various OpenShift platforms and configurations

In addition, Red Hat is working closely on Serverless technologies with a number of partners, as well as with Microsoft on Azure Functions and KEDA (for details see here). In particular, a certified OpenShift operator already has TriggerMesh, and recently we began to cooperate serverless.comso that Serverless Framework can work with OpenShift Serverless and Knative. These partnerships can be seen as a sign of the maturity of serverless and the start of an industry ecosystem.

If you previously installed a Red Hat OpenShift Serverless preview, you can upgrade to general availability (GA). In this case, for the Technology Preview version, you will need to reconfigure the OLM Subscription Update Channel, as shown in Fig. 1.

Serverless applications are faster and easier with OpenShift
Rice. 1. Subscription channel update.

The subscription channel must be updated to match the OpenShift Container Platform version of either 4.4 or 4.3.

Knative Services - first class service

OpenShift 4.4 greatly simplifies the deployment of applications with OpenShift Serverless functionality, making it easy to deploy Knative Services directly from the Developer mode of the OpenShift web console.

When adding a new application to the project, it is enough to specify the Knative Service resource type for it, thereby immediately activating the OpenShift Serverless functionality and enabling standby scaling to zero, as shown in Fig. 2.

Serverless applications are faster and easier with OpenShift
Rice. 2. Selecting Knative Service as the resource type.

Easy installation using Kourier

As we have already written in announcement of OpenShift Serverless 1.5.0 Tech Previewuse Courier allowed to drastically reduce the list of requirements when installing Serverless on OpenShift, and in the GA version these requirements became even less. All this reduces resource consumption, speeds up the cold start of applications, and also eliminates the impact of conventional, non-serverless workloads running in the same namespace.

In general, these improvements, as well as improvements in OpenShift 4.3.5, speed up the creation of applications from a pre-built container by 40-50%, depending on the size of the image.
How everything happens without using Kourier can be seen in Figure 3:

Serverless applications are faster and easier with OpenShift
Rice. 3. Application creation time in cases where Kourier is not used.

How everything happens when Kourier is applied can be seen in Figure 4:

Serverless applications are faster and easier with OpenShift
Rice. 4. Application creation time when using Kourier.

TLS/SSL in automatic mode

OpenShift Serverless can now automatically generate and deploy TLS/SSL for your Knative Service's OpenShift Route so you don't have to worry about implementing and maintaining these features while working on your application. In other words, Serverless relieves the developer of the complexities associated with TSL while maintaining the high level of security that everyone has come to expect from Red Hat OpenShift.

OpenShift Serverless Command Line Interface

In OpenShift Serverless, it's called kn and is available directly from the OpenShift console on the Command Line Tools page, as shown in Figure 5. XNUMX:

Serverless applications are faster and easier with OpenShift
Rice. 5. OpenShift Serverless Command Line Interface Download Page.

When you download from this page, you get a macOS, Windows, or Linux version of kn that has been verified by Red Hat and is guaranteed to be free of malware.

On Fig. Figure 6 shows how you can deploy a service in kn with just one command to create an application instance on the OpenShift platform with URL access in a matter of seconds:

Serverless applications are faster and easier with OpenShift
Rice. 6. Using the kn command line interface.

This tool allows you to fully manage Serverless Serving and Eventing resources without having to view or edit any YAML configurations.

Improved Topology View in Console Developer Mode

Now let's see how the redesigned Topology view makes it easier to manage Knative Services.

Knative Service - Centered Visualization

Knative Services on the Topology view page are displayed as a rectangle containing all revisions, as shown in Figure 7:

Serverless applications are faster and easier with OpenShift
Rice. 7. Knative Services on the Topology view page.

Here you can instantly see the current percentages of Knative Service traffic distribution, and group Knative Services within an application group to easily visually control what is happening inside the selected group.

Collapsing Lists OpenShift Knative Services

Continuing the theme of grouping, it must be said that in OpenShift 4.4 you can collapse Knative Services inside an application group for easier viewing and management of services when more complex applications are deployed in a project.

Knative Service in detail

OpenShift 4.4 also improves the sidebar for Knative Services. It now has a Resources tab that displays service components such as Pods, Revisions, and Routes. These components also provide quick and easy access to individual pod logs.

The Topology view also shows traffic distribution percentages and even allows you to quickly reconfigure. Thus, you can quickly know the traffic distribution for the selected Knative Service in real time by the number of pods running for a given revision, as shown in Fig. 8.

Serverless applications are faster and easier with OpenShift
Rice. 8. Traffic distribution Knative Service.

A Deeper Look at Serverless Revisions

Also, the Topology view now allows you to take a much deeper look inside the selected revision, for example, quickly see all its pods and, if necessary, view their logs. In addition, the revision's deployments and configurations can be easily accessed from this view, as well as a sub-route that points directly to that revision, as shown in Figure 9. XNUMX:

Serverless applications are faster and easier with OpenShift
Rice. 9. Resources associated with revisions.

We hope that the innovations described above will be useful to you when creating and managing serverless applications, and the next versions will have even more useful features for developers, for example, the ability to create event sources and others.

Interested?

Try OpenShift!

Feedback is important to us

Tell uswhat do you think about serverless. Join our Google group OpenShift Developer Experience to participate in Office Hours discussions and workshops, to collaborate with us and provide feedback and suggestions.

additional information

Find out more about developing OpenShift applications using the following Red Hat resources:

Source: habr.com

Add a comment