When deploying IBM API Connect Gateway subsystem in Kubernetes we do not need to interact directly with Web-GUI of DataPower. However, sometimes it's useful to get access there. This article will describe required steps in order to enable Gateway's Web-GUI and expose it from Kubernetes.

1. When using IBM API Connect 2018
2. When using IBM API Connect v10

1. Expose DataPower Gateway Web-GUI in IBM API Connect 2018

Create a yaml extension file for the Gateway. This file is required if you want to expose Gateway GUI.
vi datapower-values.yaml

datapower:
 # Gateway MGMT variables
 # This value should either be 'enabled' or 'dislabled'. Default is disabled
 webGuiManagementState: "enabled"
 webGuiManagementPort: 9090
 webGuiManagementLocalAddress: 0.0.0.0
 # This value should either be 'enabled' or 'disabled'. Default is disabled
 gatewaySshState: "enabled"
 gatewaySshPort: 9022
 gatewaySshLocalAddress: 0.0.0.0
 # This value should either be 'enabled' or 'disabled'. Default is disabled
 restManagementState: "enabled"
 restManagementPort: 5554
 restManagementLocalAddress: 0.0.0.0

Run the following command to configure your Gateway subsystem.
apicup subsys set gwy extra-values-file=datapower-values.yaml

Install Gateway subsystem.
apicup subsys install gwy --debug

Create a service to expose IBM DataPower Gateway (API Gateway) management port:
kubectl expose pod r554d996560-dynamic-gateway-service-0 --name=dp-mgmt --port=9090 --target-port=9090 --type=NodePort -n apiconnect

You can find the port for the exposed Gateway pod using this command:
k get svc | grep -E 'gateway.*NodePort'
Use your public IP and a port printed by the command above to access your Gateway's web UI.

2. Expose DataPower Gateway Web-GUI in IBM API Connect v10

Ulike v2018, in v10 we do not have extra-values parameter to set. Thus, there is nothing to change before installation. Just install Gateway as described in the documentation. The following was done on v10.0.1.0.

Check that DataPower pod is Up and Running with:
kubect -n apiconnect get po | grep gwv

DataPower Pod in IBM API Connect v10

List containers in gwv6-0 pod. For 10.0.1.0 there must be 1 container called "datapower".
kubectl -n apiconnect get po gwv6-0 -o jsonpath='{.spec.containers[*].name}'

Listing containers in DataPower pod in IBM API Connect v10

Attach to Gateway CLI. Use admin/admin to login.
kubectl attach -ti gwv6-0 -n apiconnect -c datapower

Run the following set of commands. It will enable web-mgmt interface. After done just close the terminal (do not press ctrl+c).

co;
web-mgmt;
admin-state enabled;
exit;
write mem;
top;
exit;

To detach from the container use ctrl+p followed by ctrl+q.

Enabling Web-GUI for DataPower in IBM API Connect v10

Create a Kubernetes service for the pod.
kubectl expose pod gwv6-0 --name=dp-mgmt --port=9090 --target-port=9090 --type=NodePort -n apiconnect

Find the port for exposed pod.
k get svc | grep dp-mgmt

Created port for DataPower Web GUI in IBM API Connect v10

Now you have access to Gateway's Web GUI.

Exposed Gateway's WEB GUI in IBM API Connect v10