API Gateway Docker Container with Externalized Elasticsearch and Kibana
The best practices for Docker container specify having a single process per container. This allows to control the components of an webMethods API Gateway container and enables horizontal scaling. A full split results into three separate containers, one each for API Gateway, Elasticsearch and Kibana. Since Kibana is not scaled independently it can be included into the webMethods API Gateway container.
API Gateway Container with an Externalized Elasticsearch
The following figure depicts an webMethods API Gateway container with an externalized Elasticsearch where Kibana is included in the webMethods API Gateway container.

Do the following to set up webMethods API Gateway container with an Elasticsearch:
- Run the Elasticsearch.
You can start Elasticsearch container by using the Elasticsearch Docker image available on docker hub. The Elasticsearch version should be the same as used in webMethods API Gateway.
docker run -p 9200:9240 -p 9300:9340 -e "xpack.security.enabled=false" -v es-data:/usr/share/elasticsearch/data docker.elastic.co/elasticsearch/elasticsearch:8.2.3
Use the option
-e xpack.security.enabled=false
to disable basic authentication for Elasticsearch. This is the default option available in webMethods API Gateway.Use the volume mapping
-v es-data:/usr/share/elasticsearch/data
to persist the Elasticsearch data outside the Docker container. - Run webMethods API Gateway Docker container.
To create a Docker file or image for an webMethods API Gateway that does not contain Elasticsearch the ./apigw_container.sh createDockerFile and build command offer the following option:
--extern.ES
Setting the flag ensures that the Elasticsearch is not added to the Docker image created by the generated Docker file.
Elasticsearch configuration can be injected into an existing webMethods API Gateway image. Assuming an existing webMethods API Gateway image sag:apigw:
docker run -d -p 5555:5555 -p 9072:9072 --env-file apigw-env.list --hostname apigw --name apigw sag:apigw
The apigw-env.list contains the environment variables required for configuring an Elasticsearch and Kibana:
apigw_elasticsearch_hosts=host:port apigw_elasticsearch_https_enabled=("true" or "false") apigw_elasticsearch_http_username=user apigw_elasticsearch_http_password=password
An example looks as follows:
apigw_elasticsearch_hosts=testhost1:9200 apigw_elasticsearch_https_enabled=false apigw_elasticsearch_http_username= apigw_elasticsearch_http_password=
You can specify the Elasticsearch properties to modify the property files on the container startup.
Instead of using the env file to change the environment variables, you can set them using -e options in the Docker run. For setting the Elasticsearch host the Docker run command looks as follows:
docker run -d -p 5555:5555 -p 9072:9072 \ -e apigw_elasticsearch_hosts=testhost1:9200 \ --hostname apigw \ --name apigw sag:apigw
API Gateway Container with an Elasticsearch and Kibana
The following figure depicts an webMethods API Gateway container with Elasticsearch and Kibana containers.

Do the following to set up webMethods API Gateway container with an Elasticsearch and Kibana:
- Run the Elasticsearch.
You can start Elasticsearch by using the default Elasticsearch Docker image available on docker hub. The Elasticsearch version should be the same as used in webMethods API Gateway.
docker run -p 9200:9240 -p 9300:9340 -e "xpack.security.enabled=false" -v es-data:/usr/share/elasticsearch/data docker.elastic.co/elasticsearch/elasticsearch:8.2.3
Use the option
-e xpack.security.enabled=false
to disable basic authentication for Elasticsearch. This is the default option available in webMethods API Gateway.Use the volume mapping
-v es-data:/usr/share/elasticsearch/data
to persist the Elasticsearch data outside the Docker container. - Run the Kibana If you have modified the original Kibana, for example by adding a style sheet file, or modified the kibana.yml file, as per your requirements, then this customization of Kibana is bundled with webMethods API Gateway. This customized Kibana is provided under the directory: profiles/IS_default/apigateway/dashboard. To achieve this, create and run a Docker image based on the customization. This can be achieved by a Docker file as follows:
FROM centos:7 COPY /opt/softwareag/profiles/IS_default/apigateway/dashboard /opt/softwareag/kibana EXPOSE 9405 RUN chmod 777 /opt/softwareag/kibana/bin/kibana CMD /opt/softwareag/kibana/bin/kibana
Build and run the Docker file as follows:
docker build -t sagkibana . docker run -p 9405:9405 sagkibana
- Run webMethods API Gateway Docker container
To run a Docker image for an webMethods API Gateway running against an Kibana the Docker run can be called with the following environment variable:
apigw_kibana_dashboardInstance=instance
The environment variable can be added to an env file. The env file for running a Docker container with Elasticsearch and Kibana looks as follows:
apigw_elasticsearch_hosts=testhost1:9200 apigw_elasticsearch_http_username= apigw_elasticsearch_http_password= apigw_kibana_dashboardInstance=http://testhost1:9405