Deploying WSO2 APIM via Local Kubernetes Cluster in Windows
Greeting to everyone! 🍾 🎉
We all know that the Windows OS is the most used OS in the world in terms of the Desktop and Laptop PCs. With that in mind, here we are going to use the same Windows OS to setup a local Kubernetes cluster and deploy the WSO2 API Manager v4.2.0.
First let’s install the necessary tools to setup a Kubernetes cluster in a Windows machine.
👉 Install VirtualBox
To setup a Kubernetes cluster in local machine, it needs a containerized environment or virtual machine environment. In this scenario, we will be using the VirtualBox as the virtulization driver which ultimately setup a virtual machine environment within our machine.
Download VirtualBox —https://www.virtualbox.org/wiki/Downloads
From the above link, let’s use the ‘Windows hosts’ option. With that, follow the prompts to install the VirtualBox.
👉 Install Kubernetes client (kubectl)
Once we setup a Kubernetes cluster, to connect to the cluster and to execute the commands to manage the cluster, we need the ‘kubectl’ in our machine.
Download kubectl — https://dl.k8s.io/release/v1.28.4/bin/windows/amd64/kubectl.exe
From the above link, it will directly download the current latest release(v1.28.4) of the ‘kubectl’. It can directly execute the ‘.exe’ file with necessary arguments. To run the ‘kubectl’ commands from anywhere in the machine, let’s update the path variable of the machine. For that, place the ‘kubectl.exe’ to a specific directory in your machine. Ex — C:\Users\WSO2\Documents\tools
With that, update the ‘path’ system variable of the machine by adding the ‘C:\Users\WSO2\Documents\tools’ value.


After clicking the ‘Edit’ button, click on ‘New’ button to add value entry to the same ‘path’ variable.
To make validate the installation, let’s execute the below command and verify the output.
C:\Windows\System32> kubectl version
Client Version: v1.28.4
Kustomize Version: v5.0.4–0.20230601165947–6ce0bf390ce3
Server Version: v1.28.3
NOTE: Install ‘kubectl’ before running the Minikube. With that, the Kubernetes cluster created by the Minikube will be automatically configured to execute the ‘kubectl’ commands, by the Minikube.
👉 Install Minikube
To run a Kubernetes cluster, let’s use the ‘Minikube’. Please refer to the ‘Get Started!’ documentation of the Minikube. For easy downloading, please use the below link for the current latest release of ‘v1.32.0’.
Download Minikube — https://github.com/kubernetes/minikube/releases/tag/v1.32.0
Select and download the ‘minikube-windows-amd64.exe’ from the release assets.
To easily execute the Minikube commands from anywhere in the machine, let’s place the ‘minikube-windows-amd64.exe’ to the same location of ‘C:\Users\WSO2\Documents\tools’. Then rename it as ‘minikube.exe’.
To make validate the installation, let’s execute the below command and verify the output.
C:\Windows\System32> minikube version
minikube version: v1.32.0
commit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d
Now we are done with the prerequisites to run a Kubernetes cluster in our local Windows machine.
👉 Configure and start the Kubernetes cluster in local Windows machine
Execute the below commands to allocate resources for the Kubernetes cluster.
C:\Windows\System32> minikube config set memory 8000
C:\Windows\System32> minikube config set cpus 6
With the above commands we are allocating 8GB of memory and 6 CPU cores for the Kubernetes cluster. This amount of resources will be enough to run the WSO2 APIM server with MySQL DB, NFS for volume mounts, and Ingress controller as the LB.
Let’s start the local Kubernetes cluster using the below Minikube command.
C:\Windows\System32> minikube start
NOTE: Make sure to enable the virtualization in your machine by referring to the make and model of your machine. Ex — enabling virtualization for lenovo X1 Carbon
The output will be like below.
* minikube v1.32.0 on Microsoft Windows 10 Pro 10.0.19045.3693 Build 19045.3693
* Automatically selected the virtualbox driver
* Starting control plane node minikube in cluster minikube
* Creating virtualbox VM (CPUs=6, Memory=8000MB, Disk=20000MB) …
! This VM is having trouble accessing https://registry.k8s.io
* To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
* Preparing Kubernetes v1.28.3 on Docker 24.0.7 …
— Generating certificates and keys …
— Booting up control plane …
— Configuring RBAC rules …
* Configuring bridge CNI (Container Networking Interface) …
— Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Verifying Kubernetes components…
* Enabled addons: storage-provisioner, default-storageclass
* Done! kubectl is now configured to use “minikube” cluster and “default” namespace by default
With the above output. we can validate the configured resources and ‘kubectl’ configuring state for the cluster.
Since the Kubernetes resources of the ‘WSO2 APIM’ is using the ‘Ingress controller’ as the load balancer and the proxy of the servers, let’s setup the ‘Ingress controller’ in our cluster.
👉 Install Ingress controller
Follow the ‘Minikube’ section of the official guide to set up the Ingress controller as a ‘Minikube addon’.
Execute the below command.
C:\Windows\System32> minikube addons enable ingress
Verify the output of the command comparing the below output.
* ingress is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub. You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
— Using image registry.k8s.io/ingress-nginx/controller:v1.9.4
— Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20231011–8b53cabe0
— Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20231011–8b53cabe0
* Verifying ingress addon…
* The ‘ingress’ addon is enabled
👉 Verify the Kubernetes cluster
Now let’s execute set of simple ‘kubectl’ commands to verify the status of the cluster.
C:\Windows\System32> kubectl cluster-info

Let’s verify the namespaces of the cluster.
C:\Windows\System32> kubectl get namespaces

Let’s list all the pods of the cluster.
C:\Windows\System32> kubectl get pods — all-namespaces

From the above, we can make sure the cluster is up and running. At the same time, Ingress controller is successfully installed in the cluster and Ingress-Nginx pod is in running and ready state.
👉 Prerequisites for the WSO2 APIM Kubernetes artifacts
The WSO2 APIM Kubernetes resources provided as Helm artifacts in a GitHub repository. So, to work with those resources, we need to have the ‘Helm’ package manager and ‘Git’ command line tool. You can refer to the below links to setup the above requirements.
Install Git in Windows — https://github.com/git-guides/install-git#install-git-on-windows
Install Helm in Windows —https://get.helm.sh/helm-v3.13.2-windows-amd64.zip
For ‘Helm’ installation, once you click on th provided link, it will download the ‘helm-v3.13.2-windows-amd64.zip’ file. This is relevant to the current latest release of ‘v3.13.2’. To setup the Helm in your machine, please follow the same steps that we did to install Minikube.
- Unzip the file.
- Navigate to the ‘windows-amd64’ directory.
- Copy the ‘helm.exe’ file to the same previous ‘C:\Users\WSO2\Documents\tools’ directory.
After a successful installation, execute the below commands to validate the status of ‘Git’ and ‘Helm’.
C:\Windows\System32> git version
git version 2.43.0.windows.1C:\Windows\System32> helm version
version.BuildInfo{Version:”v3.13.2", GitCommit:”2a2fb3b98829f1e0be6fb18af2f6599e0f4e8243", GitTreeState:”clean”, GoVersion:”go1.20.10"}
👉 Setup WSO2 APIM server via Helm charts
Let’s clone the WSO2 APIM official helm charts from the GitHub as below.
C:\Windows\System32> git clone https://github.com/wso2/kubernetes-apim.git
Navigate inside to the ‘kubernetes-apim’ repository.
C:\Windows\System32> cd kubernetes-apim\
Then navigate to the ‘simple’ directory.
C:\Windows\System32> cd simple\
Finally, execute the below command to setup the single node of a WSO2 APIM server.
helm install apim-release am-single --version 4.2.0–1 --namespace ns-apim --dependency-update --create-namespace --set wso2.subscription.username=$USERNAME --set wso2.subscription.password=$PASSWORD
In the above command, we used;
- Helm release name as ‘apim-release’
- Helm chart version as ‘4.2.0–1’
- Kubernetes namespace as ‘ns-apim’
Also, for this ‘Powershell’ window, I embedded my WSO2 subscription credentials via environmental variable such as ‘USERNAME’ and ‘PASSWORD’.
The output of the command may looks like below upon a successful execution.


Finally, let’s validate the status of the pods under the ‘ns-apim’ namespace as below.
C:\Users\WSO2\Documents\kubernetes-apim\simple> kubectl get pod -n ns-apim

We could validate that all the pods under the ‘ns-apim’ namespace is now in running and ready state.
NOTE: Ignore the Ingress annotation related deprecated warnings.
👉 Access the APIM portals
To access the APIM portals, we need to update the local DNS file by adding entries for the ‘am.wso2.com’ and ‘gateway.am.wso2.com’ hostnames. The same is already guided in the output of the ‘helm install’ command.
Execute the below command.
C:\Users\WSO2\Documents\kubernetes-apim\simple> kubectl get ing -n ns-apim

Based on the outcome, let’s update the local DNS file by adding entries to resolve the above mentioned hostnames(‘am.wso2.com’ and ‘gateway.am.wso2.com’) to the ‘192.168.59.105’(my local IP).
NOTE: You can add entries for all four hostnames. In this article I am highlighting the basic flows related to the HTTP protocol. Due to that, it is not mandatory to add other two hostnames of ‘websocket.am.wso2.com’ and ‘websub.am.wso2.com’.
- Navigate to the ‘C:\Windows\System32\drivers\etc’ directory.
- Update the ‘hosts’ file by adding entries as below.

NOTE: You may need administrator permissions to perform the above action.
Now we all set up to access the portals. let’s try to access the carbon management console of the APIM server using below URL.

In the same way you can access the other APIM portals using below URLs.
Publisher portal — https://am.wso2.com/publisher
Devportal — https://am.wso2.com/devportal
Admin portal — https://am.wso2.com/admin
Hope you can try-out the WSO2 APIM in this way in your Windows machines now. 🏋️♂️ 🎊
Happy Blogging!! 🚀🚀