Deploy applications using Foreman ACD

This demo explains how Foreman ACD can be used to deploy a Prometheus and Grafana stack.
Register or Login to like
GitHub launches Open Source Friday 

Opensource.com

When you manage your IT infrastructure using Foreman and Katello, the smallest unit to operate on is generally a host. You can provision hosts, deliver versioned content, and set configurations. Using Foreman ACD, you can use your Foreman instance to deploy applications consisting of multiple services spanning multiple hosts. This blog post briefly introduces the Foreman ACD plugin and explains how it can help you deploy a Prometheus and Grafana stack. If you want to know more about deploying an ELK stack consisting of an Elasticsearch cluster and Kibana, look at Deploying an ELK Cluster with Application Centric Deployment.

Introduction to Foreman and Katello

You can use Foreman and Katello to manage your IT infrastructure. Using Foreman generally starts with managing content. You can import content from upstream repositories, version and filter packages, mix repositories, and make it consumable for hosts. Next, you can provision hosts based on synchronized content. Using plugins, you can deploy to the cloud and on-premises solutions. The third step is to use configuration management tools, such as Ansible, to configure hosts. Configuration includes installing packages, creating users, specifying network settings, and more.

Altogether, the traditional way focuses on single hosts or groups of similar hosts. Most frequently, host details are shared using so-called host groups in Foreman. They contain provisioning and configuration information such as compute resources, Ansible roles, operating system, provisioning templates, parameters, and more. You can think of them as "blueprints" for new hosts. Deploying an additional host based on a host that you have already deployed using a host group is as easy as entering a valid hostname.

But what if you want to provide a more user-friendly way to deploy applications? What if your application relies on several services requiring one or more hosts? Enter Foreman ACD.

Foreman ACD to the rescue

Traditional deployments focus on individual hosts, which are provisioned and configured based on host groups. Foreman ACD, short for Application Centric Deployment, is a Foreman plugin to deploy applications. It's developed and maintained by ATIX AG and is completely open source.

Forman ACD with Prometheus and Grafana

(Maximilian Kolb, CC BY-SA 4.0)

The screenshot above shows how to deploy a Prometheus and Grafana cluster based on an Ansible playbook and a previously created application definition. For end users, deploying their application is as easy as entering host names and selecting the number of services as part of their application. For more information on the Prometheus and Grafana example, look at Deploying a Prometheus and Grafana Cluster Using Application Centric Deployment in the orcharhino blog.

What are the differences between host and application-centric approaches?

Both the traditional host-centric and the application-centric way share some procedures. They both start by preparing Foreman with your infrastructure, importing content, and creating necessary entities such as operating systems. After everything is ready, deployment and configuration information are bundled in host groups.

Here are two different approaches.

Host-centric approach

  1. Integrate Foreman into your infrastructure
  2. Import content
  3. Set up host groups
  4. Create hosts based on host groups
  5. Configure hosts using your automation software of choice (such as Ansible)
  6. Use configuration management to install software packages and configure services such as firewalls

Application-centric approach

  1. Integrate Foreman into your infrastructure
  2. Import content
  3. Set up host groups
  4. Fetch an ACD template consisting of an Ansible playbook and an application definition
  5. Create and deploy application instances.

Foreman ACD automates application deployments consisting of multiple services using an Ansible playbook and an application definition, which connects services to host groups and optionally defines host parameters. It requires the foreman_acd and smart_proxy_acd plugins, which are open source software. Packages are available at yum.theforeman.org.

Advantages of using Foreman ACD

Foreman ACD helps you to deploy complete applications with the click of a button. Foreman provisions hosts and automatically configures them after deployment. Each service is started on the defined group of hosts.

In terms of self-service, ACD helps you split users' responsibilities: You can assign the Application Centric Deployment Manager role to users that import the Ansible playbook and define the application definitions. End users with the Application Centric Deployment User role only have permission to deploy predefined application definitions. Note that end users can still, if allowed, set variables such as user accounts, ports, or the number of hosts per service in a predefined range.

Foreman ACD ensures a seamless deployment experience by handling inter-host connectivity. You can deploy multiple hosts simultaneously, all within a self-service-capable interface. This feature allows users with less technical knowledge or access rights to scale their applications vertically and/or horizontally.

Wrap up

If you have already configured Foreman and Katello to provision hosts and already have host groups bundling deployment and configuration information, using the Foreman ACD plugin is the next step to leverage your existing setup. You can conveniently deploy complete applications without connecting hosts manually.

Foreman ACD and Smart Proxy ACD are open source plugins for Foreman developed and maintained by ATIX AG. You can find the documentation at docs.theforeman.org > Application Centric Deployment. There are also several open source ACD playbooks, such as the ACD playbook for Elasticsearch cluster and Kibana and ACD playbook for Prometheus and Grafana. If you have questions, feedback, or suggestions, please open a thread on community.theforeman.org.

Our next ACD playbook helps you deploy Kubernetes. Follow the blog to read the upcoming announcement at orcharhino.com/news.

What to read next
User profile image.
technical content creator by day | hacker by night | minimalist by choice
Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.