Validated patterns explained

Learn the basics of validated patterns, a type of flexible code architecture that allows you to go from concept to production using the same stack configuration.

Learn the basics of validated patterns, a type of flexible code architecture that allows you to go from concept to production using the same stack configuration.

Deploying a validated pattern

20 mins

Now that you’ve prepared your environment, we’ll walk through how to deploy a validated pattern on your cluster. 

This learning path deploys the Multicloud GitOps validated pattern, because it demonstrates the GitOps approach to managing multiple cloud deployments in both public and private clouds. As a base pattern, it’s also easy to add new products and Helm charts. Finally, it uses many common Red Hat products and shows how they work together to create a fully-integrated workload. 

If another pattern better suits your needs or use case, feel free to use it instead, as the same general process will apply.

What will you learn?

  • How to deploy a pattern using the Validated Patterns Operator in the OpenShift web console
  • How to deploy a pattern using the patterns.sh script in the command line interface (CLI)

What do you need before starting?

Overview of the workflow

In general, you can deploy a validated pattern in one of two ways:

  • Using a community operator called the Validated Patterns Operator
  • Using the pattern.sh script via the CLI

The Validated Patterns Operator is not supported by Red Hat, but is designed by the upstream community as an easy way to install and deploy a pattern repository via the Red Hat OpenShift web console. If using this option, you must load the secrets file separately after the pattern components have been deployed. 

Fork the repository

Whether you install the validated pattern with the community operator or via CLI, you’ll need to first fork the pattern repository and edit your values files.

  1. Fork the Multicloud GitOps validated pattern repository on GitHub.
  2. Clone the forked repository:
    git clone git@github.com:your-username/multicloud-gitops.git
    cd multicloud-gitops
  3. Make the values changes you determined when preparing your environment. Commit and push the changes to GitHub.
    git checkout -b my-branch
    vim values-*.yaml
    git add values-*.yaml
    git commit values-*.yaml
    git push origin my-branch

    Do not commit the secrets file to GitHub, as it will contain confidential information that should not be publicly accessible.
  4. Optional: If you want to customize credentials, create a local copy of the secrets values file. Again, do not push the secrets file to GitHub.
    cp ./values-secret.yaml.template ~/values-secret-multicloud-gitops.yaml
    vim ~/values-secret-multicloud-gitops.yaml

Deploying a pattern with the Validated Patterns Operator

Install the operator

 

  1. Access the Red Hat OpenShift web console by running oc whoami --show-console. You’ll see the URL for the console and your login credentials.
  2. In the left sidebar, click Operators and then OperatorHub
  3. In the Filter by box, type “pattern,” which should show you the Validated Patterns Operator. Select this operator, click Continue, then click Install.
    The OperatorHub catalog search where a user will search "pattern" to find the Validated Patterns Operator
    The OperatorHub catalog search where a user will search "pattern" to find the Validated Patterns Operator
  4. On the following Install Operator page, you can leave the defaults and click Install.
    The Install Operator screen for the Validated Patterns Operator
    The Install Operator screen for the Validated Patterns Operator

 

Create the pattern

  1. Once you finish installing the operator, click View Operator and then Create instance.
  2. Fill out the Create a pattern form, including the following:
    1. Choose a name for the pattern deployment. This name will be used in the projects created.
    2. Apply any other labels you may need to this deployment.
    3. Choose a cluster group name. For the Multicloud GitOps pattern, we’ll use “hub” as a cluster group name. Check with your specific validated pattern to determine the correct cluster group.
    4. Select Git Config and change the Target Repo URL to your forked repository URL.
    5. You may need to change the Target Revision, depending on if you are using a specific version or branch.
    6. For this learning path, you don’t need to make changes to your values-*.yaml files, but if you are changing any parameters, you would confirm at this point that those have been made locally and pushed to your forked repository.
    7. Change any other form fields that require specifications.
      The "Create a pattern" form where you will include relevant information for your pattern installation
      The "Create a pattern" form where you will include relevant information for your pattern installation
  3. Select Create, then go back to Installed Operators. You should soon see the OpenShift GitOps and Validated Patterns operators show up, along with any other operators and assets you will need.
    The Installed Operators screen where your installed operators and assets will populate after creating the pattern
    The Installed Operators screen where your installed operators and assets will populate after creating the pattern
  4. You can monitor the progress of your application deployment by selecting the dropdown menu to the left of your console notifications and waiting for the two Argo CD applications to show up. Select Hub Argo CD, which redirects you to the Argo CD login page. Click Login using OpenShift, and enter your OpenShift credentials. 
    The dropdown menu that shows the status of OpenShift GitOps applications
    The dropdown menu that shows the status of OpenShift GitOps applications

From here, OpenShift GitOps will install the rest of the assets and artifacts for the pattern, including Red Hat Advanced Cluster Manager.

Load secrets

The final step in using the Validated Patterns Operator is to load the secrets file separately. Run the following command in the CLI:

~/values-secret-multicloud-gitops.yaml> ./pattern.sh make load-secrets

You should see the secrets loading from the OpenShift GitOps hub screen. This may take some time.

The Argo CD hub application screen (config-demo) shows that the secrets have not been loaded
The Argo CD hub application screen (config-demo) shows that the secrets have not been loaded
The Argo CD hub application screen (config-demo) shows that the secrets have been loaded
The Argo CD hub application screen (config-demo) shows that the secrets have been loaded

Deploying a pattern with pattern.sh

  1. Login to your cluster using oc login.
  2. Run the following command to install the pattern and load the secrets at the same time:
    ./pattern.sh make install

Congratulations, you have now successfully deployed a validated pattern to your cluster.

Previous resource
Preparing the environment
Next resource
Conclusion

This learning path is for operations teams or system administrators

Developers may want to check out the Developer Sandbox to get started with validated patterns. 

Get started on developers.redhat.com

Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.