Application orchestration workflow

Note: Before you author applications for use with application orchestration, we recommend you have hands-on experience writing Puppet code. You should also be familiar with Puppet modules.

Although Puppet application orchestration can help you manage any distributed set of infrastructure, it’s primarily designed to configure an application stack. The simple application stack used in the following extended example comprises a database server on one machine and a web server that connects to the database on another machine.

With previous Puppet coding techniques, you’d write classes and defined types to define the configuration for these services, and you’d pass in class parameter data to tell the web server class how to connect to the database. With application orchestration, you can write Puppet code so this information can be exchanged automatically. And when you run Puppet, the services will be configured in the correct order, rather than repeatedly until convergence.

Application orchestration workflow

The following diagrams illustrate the major steps in the application orchestration workflow—from authoring your application to configuring it with the Puppet orchestrator.

Assumptions and prerequisites:

Before you author applications for use with application orchestration, we recommend you have hands-on experience writing Puppet code. You should also be familiar with Puppet modules.

Create service resources and application components

  1. In this example, called lamp, we create the Sql service resource in lamp/lib/puppet/type/sql.rb.

    In the applications you compose, application components share information with each other by exporting and consuming environment-wide service resources.

    Step 1, continues with create the service resource (Click to enlarge)

  2. Define the database application component in lamp/manifests/db.pp.

    An application component is an independent bit of Puppet code that can be used alongside one or more other components to create an application. Components are often defined types that consist of traditional Puppet resources that describe the configuration of the component (file, package, and service, for example).

    Step 1, create the database component (Click to enlarge)

    The produces statement, contained in lamp/manifests/db.pp expresses that the Lamp::Db component produces the Sql service resource. The produces statement is included outside of the defined type.

    Step 1, continues with create the produces statement (Click to enlarge)

Create the application definition

The application definition (or model) is where you connect all the pieces together. It describes the relationship between the application components and the exchanged service resources.

  1. Since the application defintion shares the name of the module, you put it in lamp/manifests/init.pp.

    Step 1, continues with create the application definition (Click to enlarge)

Instantiate your application

  1. In the application instance, create a unique version of your application and specify which nodes to use for each component.

    Step 2, create the application instance (Click to enlarge)

Use the orchestrator commands to run Puppet and configure your application

  1. Run puppet app show to see the details of your application instance.

  2. Run puppet job run to run Puppet across all the nodes in the order specified in your application instance.

  3. Run puppet job list to show running and completed orchestrator jobs.

    Step 3, use the orchestrator to run Puppet and configure your application
    (Click to enlarge)

At the start of a job run, the orchestrator prints a Job Plan that shows what’s included in the run and the expected node run priority. The nodes are grouped by depth. Nodes in level 0 have no dependencies and will run first. Nodes in the levels below are dependent on nodes in higher levels.

Step 3, continues with the job plan output
(Click to enlarge)

As your job progresses, the orchestrator will print results of each node run after it completes. A “Success!” message prints when all jobs complete.

Step 3, continues with the results of each job (Click to enlarge)


Related links

↑ Back to top