Untrusted cluster setup

This chapter focuses on setting up and configuring the untrusted cluster. In this setup, we will act as the untrusted cluster admin persona that installs and configure OSC. For each configuration, we will explain the purpose and rationale behind it.

Set the working directory

Set the working directory for this workshop session. On the bastion VM this is your home directory; locally it can be any folder you choose.

export BASE_DIR=$(pwd)

Log in into the environment

Make sure you log into the right service principal:

AZ_CID=$(oc get secrets/azure-credentials -n kube-system -o json | jq -r .data.azure_client_id | base64 -d)

AZ_CS=$(oc get secrets/azure-credentials -n kube-system -o json | jq -r .data.azure_client_secret | base64 -d)

AZ_TID=$(oc get secrets/azure-credentials -n kube-system -o json | jq -r .data.azure_tenant_id | base64 -d)

echo azure_client_id $AZ_CID
echo azure_client_secret $AZ_CS
echo azure_tenant_id $AZ_TID

az login --service-principal -u $AZ_CID -p $AZ_CS --tenant $AZ_TID

AZURE_SUB_ID=$(oc get secrets/azure-credentials -n kube-system -o json | jq -r .data.azure_subscription_id | base64 -d)
az account set --subscription "$AZURE_SUB_ID"