Prerequisites to Deploying OpenShift on Azure


Jesse Hoch
DevOps Training Architect II
In this lab you will be creating a key vault in an existing resource group to use for your OpenShift installation. You will be generating a an ssh key and storing it in the key vault. You will need to use the Azure CLI tools in the cloud shell using bash.
Prerequisites to Deploying OpenShift on Azure
Introduction
In this hands-on lab, we will create a key vault, generate the SSH keys, and then store the private key in the key vault via Azure CLI commands.
Solution
Log in to the Azure Portal using the credentials provided on the lab instructions page.
Configure Cloud Shell
If a Welcome to Microsoft Azure get started window appears, click Maybe layer.
On the left-hand side navigation menu, click All Resources.
Set up Cloud Shell by clicking the "Cloud Shell" icon button in the top-right hand corner of the screen:

When prompted to choose an environment, click Bash to begin configuring the Cloud Shell.
On the "You have no storage mounted" window, click Show advanced settings.
Leave and use the existing subscription, resource group, and storage account.
Note: If the storage account does not populate, ensure that West US is selected for the Cloud Shell region field .
Under Storage account, click the radio button for Use existing.
Under File share, choose the radio button for Create new and specify okdcloudshell as the new file share name.
Click Create Storage.
Note: Upon completion, we should see a status of
Cloud Shell.Succeeded
.
Create a Key Vault Using Azure CLI
Now use the Cloud Shell that we just created to run the Azure CLI
keyvault create
command for creating a key vault to store our SSH key in that we will create in the next task. It should look similar to this:az keyvault create --resource-group prequisites626089.9555539760.date.20190917135119795 --name keyvaultOKD --enabled-for-template-deployment true
Note: It should show as
Running
and may take a couple of minutes to successfully complete.Navigate back to the Microsoft Azure All Resources section, and then click Refresh to see
keyvaultOKD
. If keyvaultOKD is in use, append a few random numbers to the end of the name.
Generate SSH Keys
Now in the Cloud Shell, we will need to generate SSH keys. We will store them in the
.ssh
directory and name itopenshift_rsa
. Make sure not to use a passphrase:ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
Store Your SSH Key in the Key Vault
Store our SSH key that was just created in the last task in the key vault using the
keyvault secret set
Azure CLI command:az keyvault secret set --vault-name keyvaultOKD --name keysecret --file ~/.ssh/id_rsa
Conclusion
Congratulations — you've completed this hands-on lab!