Enabling OpenShift Metrics and Logging on Azure

3.5 hours
  • 5 Learning Objectives

About this Hands-on Lab

In this lab you will be enabling and deploying both the metrics and the logging components in OpenShift on Azure. This will allow metrics to show up in your web console for your applications as well as allow for log aggrregation for troubleshooting purposes.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Configure Cloud Shell

Set up Cloud Shell by clicking the Cloud Shell button in the top-right corner of the screen:

"Azure Cloud Shell"

When creating the Bash Cloud Shell File share, use the existing Resource Group and the existing Storage Account (In West US).

Download SSH Keys for the Lab

You will need to pull down the SSH keys to be able to connect to VMs. First, make the .ssh directory, if it isn’t already there, with the mkdir command.

Then, cd into the .ssh directory.

Next, use wget to pull down the SSH keys using these links:

https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/ssh/id_rsa

https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/ssh/id_rsa.pub

Change the permission to the files to 600.

Run the Lab Prep Subscriptions

We will need use SSH to connect to each VM and run a prep script.

After we use SSH to connect to a VM, we will first need to install wget.

Next, we will need to download the associated script for the node found in the Git repo for the lab.
The link is: https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/scripts/

  • For the bastionVM-0 it would be bastionPrep.sh

  • For the masterVM-0 it would be masterPrep.sh

  • For the infraVM-0 it would be infraPrep.sh

  • For the appnodeVM-0 it would be nodePrep.sh

Once the download completes, we will need to make the script executable.

Finally, we must run the script. Ensure that sudo is used or the script will fail.

Install OpenShift

Use Ansible to run the prerequisites.yml and the deploy_cluster.yml playbooks to install OpenShift.

Enable Metrics and Logging

You will need to add the following to the /etc/ansible/hosts file:

# metrics
openshift_metrics_install_metrics=True
openshift_metrics_hawkular_hostname=hawlular-metrics.apps.okd.infra.example.xip.io
openshift_metrics_cassandra_storage_type=dynamic
openshift_metrics_storage_volume_size=1Gi
openshift_metrics_hawkular_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_metrics_cassandra_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_metrics_heapster_nodeselector={"node-role.kubernetes.io/infra": "true"}

# logging
openshift_logging_install_logging=True
openshift_logging_es_pvc_dynamic=true
openshift_logging_storage_volume_size=1Gi
openshift_logging_kibana_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_logging_curator_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra": "true"}

Then, you will need to run the config.yml playbook for both openshift-metrics and openshift-logging.

Additional Resources

Oh no! You got OpenShift installed, and you configured both single sign-on and monitoring with Azure, but you did not enable metrics and logging during the OpenShift installation. If the developers can't track the performance of their app and troubleshoot it by checking errors in the logs using Kibana, then Tallahassee is going to rip you a new one. Quickly add the metrics and logging config to your inventory file and run the config playbooks for metrics and logging on your bastion host.

Note: Be sure to use the bastionhostPrep.sh, masterPrep.sh, infraPrep.sh, and nodePrep.sh for this lab. The lab prep takes about 10 to 15 minutes per node to run. The OpenShift installation can take 30 minutes or more. We have added time to accommodate this inconvenience.

When creating the Bash Cloud Shell File share, use the existing Resource Group and the existing Storage Account (In West US).

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?