📜 ⬆️ ⬇️

How to simplify the deployment of cloud applications - presented a new open specification

Microsoft and Docker have developed an open specification Cloud Native Application Bundle (CNAB). It describes a universal way of packaging container applications for working in hybrid environments. Further we will tell why CNAB was needed and what it is.


/ photo tsuna72 CC BY

What is CNAB?


The Cloud Native Application Bundle is a specification that describes how to pack the components (APIs, virtual machines, containers) necessary to run cloud applications in distributed environments. At first glance, this task should be solved by Docker itself. However, it is known that in the case of large-scale hybrid infrastructures, its standard functions are not enough.

Thus, CNAB is an attempt to unify the process of packaging, scanning and managing the life cycle of distributed applications based on Kubernetes, Helm, Swarm, and others, using a single packet format. These packages are based on JSON and OpenPGP.

Using the Cloud Native Application Bundle, the developer gets the opportunity to deploy his application both on a local workstation and in a public cloud. Each of the IT giants presented their tool, which demonstrates the capabilities of the specification. At Microsoft, this decision was the Duffle client, and at Docker, the Docker app .

Examples


As we said above, the specification defines a method for packaging distributed applications of various formats. CNAB includes a package definition (bundle.json) to describe the application, as well as a special image ( invocation image ) for installing it. The package definition looks like this (an example of the description is in the official repository on GitHub ):

{ "schemaVersion": "v1.0.0-WD", "name": "helloworld", "version": "0.1.2", "description": "An example 'thin' helloworld Cloud-Native Application Bundle", "maintainers": [ { "name": "Matt Butcher", "email": "technosophos@gmail.com", "url": "https://example.com" } ], "invocationImages": [ { "imageType": "docker", "image": "technosophos/helloworld:0.1.0", "digest": "sha256:aaaaaaa..." } ], "images": [ { "image": "technosophos/microservice:1.2.3", "description": "my microservice", "digest": "sha256:aaaaaaaaaaaa...", "uri": "urn:image1uri", "refs": [ { "path": "image1path", "field": "image.1.field" } ] } ], "parameters": { "backend_port" : { "type" : "int", "defaultValue": 80, "minValue": 10, "maxValue": 10240, "metadata": { "description": "The port that the back-end will listen on" } } }, "credentials": { "kubeconfig": { "path": "/home/.kube/config", }, "image_token": { "env": "AZ_IMAGE_TOKEN", }, "hostkey": { "path": "/etc/hostkey.txt", "env": "HOST_KEY" } } } 

This block describes the parameters of the package with the application and provides information on where to “search” installed images (the format should be docker or oci). Additionally, the definition specifies the size of the image in bytes, the platform on which it will work, as well as the architecture and operating system.

And this is how the image itself is described directly:

 "invocationImages": [ { "imageType": "docker", "image": "technosophos/helloworld:0.1.0", "digest": "sha256:aca460afa270d4c527981ef9ca4989346c56cf9b20217dcea37df1ece8120685" } ] 

Its task is to install the components necessary for the work. These components can be containers, functions, virtual machines, and service frameworks.

Developers from Microsoft prepared a separate video in which they told how to work with the standard and gave a few examples on real code.

What the IT community thinks


CNAB is not the only solution for managing application lifecycle in cloud environments. For example, for the same Kubernetes there is a Crossplane manager and a package manager Helm. However, CNAB is the first solution, which covers several popular tools at once and does not depend on the platform. By the way, CNAB can also work with Helm: there is even an appropriate example on GitHub.

Because of this versatility, the IT community has met the emergence of a new specification with enthusiasm. One of Kubernetes founders, Brendan Burns (Brendan Burns), noted that installing distributed applications using CNAB resembles installing an application from an ordinary USB flash drive. According to him, it is just as easy.

But not everyone is confident in the success of the new solution. Some users are worried that CNAB is waiting for the fate of other package managers who, due to the lack of operators (as in Kubernetes), have been forgotten. To dispel doubts and discuss all possible functions, one of the decision makers joined the thematic thread on Hacker News . He answered all questions from residents of the site and listened to suggestions for development.

So far, CNAB is in the active development stage . Both Microsoft and Docker invite all developers to join them to finalize the specification and release it into production. A couple of IT giants intend to make the new tool the industry standard. At the same time, representatives of both companies hope that, over time, the Cloud Native Application Bundle will develop independently, regardless of its creators.



Posts from our corporate blog:


Posts from our Telegram channel:

Source: https://habr.com/ru/post/436536/