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:
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 themkdir
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 bebastionPrep.sh
For the
masterVM-0
it would bemasterPrep.sh
For the
infraVM-0
it would beinfraPrep.sh
For the
appnodeVM-0
it would benodePrep.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 thedeploy_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 bothopenshift-metrics
andopenshift-logging
.