- 1. Create Access Token For API Gateway (APIcast)
- 2. Install 3scale APIcast Operator
- 3. Setup APIcast API Gateway
- 4. Promote 3scale Configuration to Self-Managed API Gateway
- 5. Testing
-
From main dashboard, select Account Settings from dropdown list menu.
-
Select Personal -> Tokens menu from left panel, then click Add Access Token link.
-
Enter following details, then click Create Access token button.
- Name:
Local Gateway
- Scopes: Select
Account Management API
- Permission:
Read Only
- Name:
-
Copy the token to somewhere you can recall later. Then click I have copied the token button.
-
A new access token should be created.
-
Login to OpenShift web console, and switch to Administrator perspective. Select Home -> Projects menu from left panel, then click Create Project button.
-
Enter following details, then click Create button.
- Name:
api-gateway
- Display name:
API Gateway
- Name:
-
The project should be created. Then Select Workloads -> Secrets menu from left panel.
-
Make sure the current project is api-gateway you've just created. Then click on Create button.
-
Enter following details, then click Create button.
- Secret name:
apicast-secret
- Key:
AdminPortalURL
- Value: Enter 3scale admin portal URL in this format:
https://<ACCESS_TOKEN>@3scale-admin.apps.<DOMAIN>
where theACCESS_TOKEN
is the access token you've created in 3scale. AndDOMAIN
is the OpenShift cluster domain (You can useoc whoami --show-console|awk -F'apps.' '{print $2}'
command to get the domain value. Or just copy from the URL in web browser.)
- Secret name:
-
The secret should be created.
-
Select Operators -> OperatorHub menu from left panel.
-
Enter
gateway
in search box then selectRed Hat Integration - 3scale APIcast gateway...
-
A panel will be show on the right side, click Install button.
-
Select follwing options, then click Install button.
- Update channel:
threescale-2.12
- Installation mode:
A specific namespace on the cluster
- Installed Namespace:
api-gateway
- Update channel:
-
Wait until the operator get installed successfully. Then click View Operator button.
-
Click Create instance link to create APIcast (API Gateway) instance.
-
Switch to YAML view then replace the existing code snippet with the snippet below. DO NOT forget to replace
CLUSTER_DOMAIN
with the OpenShift cluster domain (just copy from the URL in web browser.) Then click Create button.apiVersion: apps.3scale.net/v1alpha1 kind: APIcast metadata: name: prod-gateway namespace: api-gateway spec: adminPortalCredentialsRef: name: apicast-secret deploymentEnvironment: production exposedHost: host: api-gateway.apps.<CLUSTER_DOMAIN> tls: - {}
-
A new instance of APIcast should be created. Select Networking -> Routes to see the API Gateway route.
-
A new route should be created as per the
.exposedHost.host
value in the YAML configuration above. Copy the route URL clipboard or somewhere you can recall becasue you'll need this to configure 3scale.
-
Switch to 3scale admin web console, click Human Resource Services link in the Products panel from the main dashboard.
-
Select Integration -> Settings menu from left panel. Then replace the Production Public Base URL with the APIcast (API Gateway) route URL.
-
Scroll down to bottom of the page then click Update Product button.
-
Select Integaration -> Configuration menu from left panel. Then click Promote v.n to Staging APIcast button. And then click Promote v.n to Production APIcast button as well.
-
The Production APIcast URL should be changed to the new APIcast URL now.
-
Change API Gateway URL in Postman to the new URL.
-
Test the API secured with OAuth using 3Scale API Testing (OAuth) collection.