From 1046a8de61db505274caa283d912cf726e2a03d6 Mon Sep 17 00:00:00 2001 From: Shubhada Date: Thu, 1 Aug 2024 18:06:19 -0700 Subject: [PATCH] Fixed INSTALLER_PULLSPEC to use correct release version format by trimming minor version from OpenShift version file has been added --- docs/deploy-development-rp.md | 40 +++++++++++++++++++---------------- hack/setup_resources.sh | 2 +- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/deploy-development-rp.md b/docs/deploy-development-rp.md index 60b43486696..7cfca79aa18 100644 --- a/docs/deploy-development-rp.md +++ b/docs/deploy-development-rp.md @@ -1,19 +1,31 @@ # Deploy development RP +## Why to use it? +This is the **preferred** and fast way to have your own local development RP setup, while also having a functional cluster. +It uses hacks scripts around a lot of the setup to make things easier to bootstrap and be more sensible for running off of your local laptop. + +- Check the specific use-case examples where [deploying full RP service](https://github.com/Azure/ARO-RP/blob/master/docs/deploy-full-rp-service-in-dev.md) can be a better match. + ## Prerequisites 1. Your development environment is prepared according to the steps outlined in [Prepare Your Dev Environment](./prepare-your-dev-environment.md) ## Installing the extension -1. Build the development `az aro` extension: +1. Check the `env.example` file and copy it by creating your own: + + ```bash + cp env.example env + ``` + +2. Build the development `az aro` extension: ```bash . ./env make az ``` -1. Verify the ARO extension is registered: +3. Verify the ARO extension is registered: ```bash az -v @@ -469,46 +481,32 @@ To run fake metrics socket: ```bash go run ./hack/monitor ``` -## Run the RP and create a Hive cluster +### Run the RP and create a Hive cluster **Steps to perform on Mac** - 1. Mount your local MacOS filesystem into the podman machine: ```bash podman machine init --now --cpus=4 --memory=4096 -v $HOME:$HOME ``` - 2. Use the openvpn config file (which is now mounted inside the podman machine) to start the VPN connection: - ```bash podman machine ssh - sudo rpm-ostree install openvpn - sudo systemctl reboot - podman machine ssh - sudo openvpn --config /Users//go/src/github.com/Azure/ARO-RP/secrets/vpn-aks-westeurope.ovpn --daemon --writepid vpnpid - ps aux | grep openvpn ``` - ### Instructions for Modifying Environment File - **Update the env File** - - Open the `env` file. - Update env file instructions: set `OPENSHIFT_VERSION`, update `INSTALLER_PULLSPEC` and `OCP_PULLSPEC`, mention quay.io for SHA256 hash. - Update INSTALLER_PULLSPEC with the appropriate name and tag, typically matching the OpenShift version, e.g., `release-4.13.`(for more detail see the `env.example`) - * Source the environment file before creating the cluster using the `setup_resources.sh` script(Added the updated env in the PR) ```bash cd /hack - ./setup_resources.sh ``` - * Once the cluster create verify connectivity with the ARO cluster: - Download the admin kubeconfig file ```bash @@ -522,7 +520,6 @@ export KUBECONFIG=~/.kube/aro-admin-kubeconfig ```bash kubectl get nodes ``` - ```bash kubectl get nodes NAME STATUS ROLES AGE VERSION @@ -534,4 +531,11 @@ shpaitha-aro-cluster-4sp5c-worker-westeurope2-j9zrs Ready worker shpaitha-aro-cluster-4sp5c-worker-westeurope3-56tk7 Ready worker 28m v1.25.11+1485cc9 ``` +## Troubleshooting +1. Trying to use `az aro` CLI in Production, fails with: +``` +(NoRegisteredProviderFound) No registered resource provider found for location '$LOCATION' and API version '2024-08-12-preview' +``` +- Check if`~/.azure/config` there is a block `extensions.dev_sources`. If yes, comment it. +- Check if env var `AZURE_EXTENSION_DEV_SOURCES` is set. If yes, unset it. \ No newline at end of file diff --git a/hack/setup_resources.sh b/hack/setup_resources.sh index b33f1c19607..10ecf5186de 100755 --- a/hack/setup_resources.sh +++ b/hack/setup_resources.sh @@ -23,7 +23,7 @@ OPENSHIFT_VERSION=$(awk -F'[(,)]' '/NewVersion/ {gsub(/ /, ""); print $2"."$3"." OCP_PULLSPEC=$(awk -F'"' '/PullSpec:/ {print $2; exit}' "$CONST_GO_PATH") # Set the INSTALLER_PULLSPEC -INSTALLER_PULLSPEC="arointsvc.azurecr.io/aro-installer:release-$OPENSHIFT_VERSION" +INSTALLER_PULLSPEC="arointsvc.azurecr.io/aro-installer:release-$(echo $OPENSHIFT_VERSION | sed 's/\.[^.]*$//')" echo "Using OpenShift version: $OPENSHIFT_VERSION" echo "Using OCP_PULLSPEC: $OCP_PULLSPEC" echo "Using INSTALLER_PULLSPEC: $INSTALLER_PULLSPEC"