info@yenlo.com
eng
Menu
API Management 3 min

How to deploy WSO2 APIM in Kubernetes 

Learn how to effectively deploy WSO2 API Manager 4.2 on Kubernetes. This blog walks you through each step of the process, providing valuable insights for a seamless and efficient implementation. A must-read for those in the API management and integration space.

sachith ushan
Sachith Ushan
Integration Consultant
high level architecture of the WSO2 APIM setup in the cluster

Kubernetes, a widely embraced open-source platform, is celebrated for its skillful handling of containerized workloads and services. Its popularity among developers is attributed to its user-friendly configuration and powerful automation features. Recognizing this widespread acceptance, WSO2 has seamlessly integrated Kubernetes support into its product suite. This blog post aims to provide an easy-to-follow, detailed guide, breaking down the process of deploying WSO2 API Manager 4.2 on Kubernetes with the thoughtful resources supplied by WSO2.

Configure Kubernetes environment

Before you start deploying WSO2 API Manager 4.2 on Kubernetes, make sure Helm, the Kubernetes package manager, is installed and set up on your machine. This is a crucial step as Helm plays a central role in managing the deployment process. Ensuring Helm is ready ensures a smooth transition through the deployment stages, setting the stage for a hassle-free and efficient experience. If Helm is not installed, follow the instructions provided here.

WSO2 API Manager requires a minimum of 2 CPUs. Therefore, it is crucial to verify that your nodes have sufficient CPU resources, as inadequacies may result in the inability of APIM pods to schedule on any nodes. For this guide, the installation will be demonstrated on a locally set up Minikube cluster.

  1. Commence by cloning the WSO2 APIM Helm resources from the Git repository and checking out the Git tag:  v4.0.0.1.

git clone https://github.com/wso2/kubernetes-apim

cd kubernetes-apim

git checkout v4.0.0.1

  1. You need to ensure that your cluster has the Ingress addon because otherwise the IP address won’t be assigned to the ingress as shown in the screenshot below.
minikube cluster addons

As I mentioned before I’m using Minikube cluster, and I have added the Ingress addonu using the following command.

minikube addons enable ingress

The output of the above command should look like the screenshot below.

output addons minikube cluster
  1. There are multiple deployment patterns available in the given git repository. I will be using the am-pattern-1 for this blog. The following diagram explains a high-level architecture of the WSO2 APIM setup in the cluster.
high level architecture of the WSO2 APIM setup in the cluster
  1. The Kubernetes resources can be found in the following path

                 <git root folder>/advanced/{patter-name}/templates

Kubernetes resources path
  1. Then, necessary updates to the Kubernetes resources must be made based on your Kubernetes version. For instance, we have updated the Ingress definition file by changing
  • Ingress version – changes the apiVersion from extensions/v1beta1 to apiVersion: networking.k8s.io/v1
  • PathType – added the pathType: Prefix
  • Service – changes the structure for defining service name and port parameters.

The following screenshot includes the git diff of an ingress file which has the above mentioned changes.

git diff of an ingress file
  1. Then navigate to the <git root folder>/advanced/{patter-name} path and execute the following command to install the WSO2 APIM setup in your Kubernetes cluster.

helm install <release-name>.

install the WSO2 APIM
  1. Upon successful installation, then you should see  all the deployments and pods related to this release running successfully as shown in the screenshot.
all the deployments and pods
count of pods and the deployment count can be different

The count of pods and the deployment count can be different based on the deployment pattern that you are choosing.

  1. Verify that services and ingresses related to the release are operational, with assigned cluster IP addresses since this cluster is exposed to outside world using the ingress resources.
assigned cluster IP addresses
file to access the cluster with the am.wso2.com
  1. As the last step you need to add the following line to your /etc/host file to access the cluster with the am.wso2.com DNS.

192.168.64.11 am.wso2.com

Upon completing these steps, you should be able to access the WSO2 API Carbon Console, publisher, and developer portal using the configured DNS, as depicted in the screenshots.

access the WSO2 API Carbon Console
access the WSO2 API Carbon publisher
access the WSO2 API Carbon developer

Conclusion

As the conclusion, we’ve explored the process of deploying WSO2 API Manager 4.2 on the dynamic Kubernetes platform. Kubernetes, celebrated for its portability, extensibility, and open-source nature, has become the go-to choose for managing containerized workloads and services. As developers embrace Kubernetes for its declarative configuration and automation capabilities, WSO2 has adeptly integrated support for this platform into their products.

eng
Close