Chapter 6. Installing the 3scale Operator
6.1. Introduction Copy linkLink copied to clipboard!
In this documentation you will find details about deploying custom resource definitions (CRDs), deploying role-based access control (RBAC), and deploying the 3scale operator image for managing deployments of the same configuration in multiple environments.
The 3scale operator is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
6.1.1. Prerequisites Copy linkLink copied to clipboard!
- A 3scale 2.5 On-Premises instance
OpenShift Container Platform 3.11
- A user account with administrator privileges in the OpenShift cluster
Deploy the 3scale operator and custom CRDs in a separate project. If you deploy them in an existing project containing infrastructure, it could alter or delete existing elements.
6.2. Creating a new OpenShift project Copy linkLink copied to clipboard!
You must run a command like the one shown below to create a new OpenShift project. This command shows you an example of a project name:
oc new-project operator-test
oc new-project operator-test
This will create a new OpenShift project where the operator, the APIManager custom resource (CR) and the Capabilities custom resources will be installed.
6.2.1. Registering the 3scale operator CRDs in the OpenShift API server Copy linkLink copied to clipboard!
- Download and uncompress the the tar file: deploy.tar.gz.
Log in as an administrator in the cluster and deploy all the 3scale operator CRDs by running the following command:
for i in `ls deploy/crds/*_crd.yaml`; do oc create -f $i ; done
for i in `ls deploy/crds/*_crd.yaml`; do oc create -f $i ; done
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - This will register the APIManager CRD and the CRDs related to the Capabilities functionality of the operator in the OpenShift API server.
If the command runs successfully, you should be able to query the resource types defined by this CRDs via
oc get
.For example, to verify that the APIManager CRD has been correctly registered, execute the following command:
oc get apimanagers
oc get apimanagers
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You should see the following output:
No resources found.
No resources found.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.2. Deploying roles and ServiceAccounts for the 3scale operator Copy linkLink copied to clipboard!
Go to the
operator-test
OpenShift project and make sure that no other elements exist:export NAMESPACE="operator-test" oc project ${NAMESPACE} oc get all // This shouldn't return any result
export NAMESPACE="operator-test" oc project ${NAMESPACE} oc get all // This shouldn't return any result
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the ServiceAccount that will be used by the 3scale operator:
oc create -f deploy/service_account.yaml
oc create -f deploy/service_account.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Log in as an administrator to the cluster and deploy the 3scale operator Role and the RoleBinding that will attach that role to the created ServiceAccount:
// As a cluster admin export NAMESPACE="operator-test" oc project ${NAMESPACE} oc create -f deploy/role.yaml oc create -f deploy/role_binding.yaml
// As a cluster admin export NAMESPACE="operator-test" oc project ${NAMESPACE} oc create -f deploy/role.yaml oc create -f deploy/role_binding.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.3. Deploying the 3scale operator Copy linkLink copied to clipboard!
Deploy the 3scale operator by executing the following commands:
export NAMESPACE="operator-test" oc project ${NAMESPACE} oc create -f deploy/operator.yaml
export NAMESPACE="operator-test" oc project ${NAMESPACE} oc create -f deploy/operator.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - This will create a Deployment that will contain a Pod with the Operator code and will start listening to incoming APIManager and Capabilities resources.
To verify the 3scale operator is deployed and ready, run the following command:
oc get deployment 3scale-operator
oc get deployment 3scale-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow