In this lab you will be deploying the Log Analytics agent for Azure in OpenShift to allow you to be able to monitor OpenShift from the Azure portal.
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:
Configure Cloud Shell for Bash using the Advanced Settings. Use the existing subscription, resource group, and storage account. If your storage account does not populate, make sure that the South Central US region is selected. To make the file share, choose Create new and specify okdcloudshell as the new file share.
- Download SSH Keys for the Lab
You will need to pull down the SSH keys so you can connect to the VMs using SSH. First make the
.ssh
directoy, if it isn’t already there, with themkdir
command.Then,
cd
into the.ssh
directory.Now, 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.pubChange the permissions of the files to
600
.- Run the Lab Prep Subscriptions
You will need to connect to each VM using SSH and run a prep script.
After you connect to a VM using SSH, you will first need to install
wget
.After we SSH into the a VM, we will first need to install
wget
. We will need to download the associated script for the node found in the Git repo for the lab. The VM links are:- For the
bastionVM-0
it would be: wget https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/scripts/bastionPrep.sh - For the
masterVM-0
it would be: wget https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/scripts/masterPrep.sh - For the
infraVM-0
it would be: wget https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/scripts/infraPrep.sh - For the
appnodeVM-0
it would be: wget https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/scripts/nodePrep.sh
Once the download completes, you will need to make the script executable.
Finally, you would run the script. Make sure you use
sudo
or the script will fail.- For the
- Install OpenShift
Use Ansible to run the
prerequisites.yml
and thedeploy_cluster.yml
playbooks to install OpenShift. Run these from the Bastion Host.- Deploy the OMS Agent in OpenShift
Log in to the master node and use the OpenShift CLI tools to:
Download the
ocp-omsagent.yaml
file from the Git repo:https://raw.githubusercontent.com/linuxacademy/content-openshift-origin-azure/master/scripts/ocp-omsagent.yaml
Create the
omslogging
project.Create a service account named
omsagent
.Add the cluster role
cluster-reader
to the service account.Set the Security Context Constraint to
privileged
for the service account.Deploy the agent using the
oc create
command.