Prerequisites:

  1.  A storage bucket in GCP and credentials to access it.
  2.  A Configmap and Secret on your OpenShift cluster for the bucket config and credentials.
  3.  Creating the Configmap and Secret in OpenShift.


Step 1: Creating a storage bucket


    You can create a bucket through the GCP console or by running the following script in Google Cloud Shell.

Note: Replace <bucket_name> with the correct value before running the script.


AX_CPS_BUCKET_NAME=<bucket_name>

gsutil mb -b on gs://$AX_CPS_BUCKET_NAME/

gcloud iam service-accounts create appranix --display-name "Appranix service account"

AX_SERVICE_ACCOUNT_EMAIL=$(gcloud iam service-accounts list --filter="displayName:Appranix service account" --format 'value(email)')

gsutil iam ch serviceAccount:$AX_SERVICE_ACCOUNT_EMAIL:objectAdmin gs://${AX_CPS_BUCKET_NAME}

gcloud iam service-accounts keys create ax_service_account.json --iam-account $AX_SERVICE_ACCOUNT_EMAIL



Step 2: Obtaining the Appranix token for the cluster

  1. Log in to your Appranix console and create a cluster.

  2. After the cluster creation copy, the token generated for that cluster.

      Note: You can sign-up for Appranix at https://signin.appranix.net/red-hat/marketplace-signup


Step 3: Creating the Configmap and Secret in the cluster


     A Configmap and Secret which contains the credentials and bucket configuration must be created before installing the operator.


It can be done by running the following script against your cluster.

Note: Replace <token>, <bucketname> with the correct values before running the script.


AX_TOKEN=<token>

AX_CPS_BUCKET_NAME=<bucket_name>

AX_CPS_BUCKET_PROVIDER=gcp

AX_SERVICE_ACCOUNT=$(cat ax_service_account.json | base64 -w 0)

oc new-project appranix

curl -Ls -H "Content-Type: application/json" https://us-central1-appranix-dev-07.cloudfunctions.net/gen-setup  -d '{"token": "'$AX_TOKEN'", "bucket": "'$AX_CPS_BUCKET_NAME'", "cloud": "'$AX_CPS_BUCKET_PROVIDER'", "secret": "'$AX_SERVICE_ACCOUNT'"}' | oc apply -f -



Installation:


Once the pre-requisites are done, continue to install the operator from OperatorHub:

  1. Go to Operators -> OperatorHub on your OpenShift console

  2. Search for Appranix in OperatorHub

  3. Select Appranix APS Operator and click on Install

  4. Select the appranix namespace and click on Subscribe

  5. Go to Operators -> Installed Operators to check the installation status.


Uninstallation:


To remove the Appranix Operator from OpenShift:

  1. Go to Operators -> Installed Operators

On the Appranix APS Operator listing click on the 3 dots and click on Uninstall Operator