Difficulty: beginner
Estimated Time: 10-15 minutes

OpenShift Applier is a framework that helps you automate the lifecycle of OpenShift and Kubernetes resources using Infrastructure as Code. This tutorial will get you up and running with OpenShift Applier.

To understand some of the base knowledge and background behind applier, we recommend the following resources:

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Intro to OpenShift-Applier

Step 1 of 3

Step 1

To get started, let us login to the OpenShift cluster by running the following:

oc login -u developer -p developer

For this tutorial we are going to create a new infrastructure as code project from scratch. In the future, you can use some of the following resources as starting points:

To begin, let's create a new directory and cd into it.

mkdir sample-applier; cd sample-applier

cat <<EOM >requirements.yml
- name: openshift-applier
    scm: git
    src: https://github.com/redhat-cop/openshift-applier
    version: v2.0.2

A generic directory structure for an Applier project looks like this:

├── inventory
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts
│   └── host_vars
│       ├── application.yml
│       └── bootstrap.yml
├── params
├── projectrequests
├── requirements.yml
└── templates

Let's go ahead and create our project scaffolding.

mkdir -p inventory/{group_vars,host_vars} params templates
touch inventory/group_vars/all.yml inventory/host_vars/{application.yml,bootstrap.yml} inventory/hosts

In the next step we'll start populating the inventory.