Deploying Choreo Connect on Kubernetes With MWARE ESB as a Control Plane¶
Let's deploy an API on Choreo Connect, which running on Kubernetes, with MWARE ESB as the Control Plane.
Before you begin
- Install kubectl.
- Set up a Kubernetes cluster v1.20 or above.
- Minimum CPU : 4vCPU
- Minimum Memory : 3GB
- Deploy an ingress controller - NGINX Ingress Controller for this sample.
Note
If you are using Rancher Desktop, disable the default Traefik ingress controller in order to deploy the Nginx ingress controller. Refer Rancher Docs for more information
Step 1 - Setup Choreo Connect in Kubernetes¶
-
Download and extract the Choreo Connect distribution .zip
The latest Choreo Connect distribution can be downloaded from https://wso2.com/choreo/choreo-connect/. Extract the Choreo Connect distribution .zip file. The extracted folder will be called as
CHOREO-CONNECT_HOME
hereafter.
Step 2 - Setup MWARE ESB in Kubernetes¶
-
Download MWARE ESB 4.2.0 distribution .zip file from https://wso2.com/api-manager/.
-
Place the .zip file in
CHOREO-CONNECT_HOME
/docker-compose/choreo-connect-with-apim/dockerfiles/apim/. -
Build the Docker image of MWARE ESB 4.2.0 using the following command.
docker-compose -f CHOREO-CONNECT_HOME/docker-compose/choreo-connect-with-apim/docker-compose.yaml build apim
Note
If your Kubernetes Cluster is running in a remote environment, make the created docker image available to the Kubernetes Cluster. You can push the docker image to a docker registry and update the image tag specified in the CHOREO-CONNECT_HOME/k8s-artifacts/choreo-connect-with-apim/apim/apim-deployment.yaml file.
Step 3 - Deploy Artifacts and update /etc/hosts entries¶
-
Add the Kubernetes configurations for Choreo Connect and ESB using the kubectl tool.
kubectl apply -f <CHOREO-CONNECT_HOME>/k8s-artifacts/choreo-connect-with-apim/apim
Apply the Kubernetes configurations for Choreo Connect after starting the ESB instance.
kubectl apply -f <CHOREO-CONNECT_HOME>/k8s-artifacts/choreo-connect-with-apim/choreo-connect
-
Add the host entry to the
/etc/hosts
file.Add the following entry to
/etc/hosts
file in order to access the Choreo Connect Router, ESB publisher and Developer Portal.<ingress_address> gw.wso2.com apim.wso2.com
Step 4 - Update the JWKS Endpoint¶
The JWKS endpoint of the ESB has the external facing hostname by default, and it is not always routable via Choreo Connect Enforcer. As a result, you can alter the JWKS endpoint in the ESB to use the ESB's internal service name in Kubernetes.
- Log into Admin portal - https://apim.wso2.com/admin/
- Navigate to
Key Managers
section and select theResident Key Manager
. - Change the JWKS URL in the
Certificates
section tohttps://wso2apim:9443/oauth2/jwks
.
Step 5 - Deploy Sample API from ESB¶
- Publisher Portal: https://apim.wso2.com/publisher/
- Developer Portal: https://apim.wso2.com/devportal/
Follow the instructions in create and publish an API from ESB using the above URLs to access each of the portals.
Top