Software AG Products 10.7 | Configuring API Gateway | Kubernetes Support | OpenShift Support | OpenShift Sample Files
 
OpenShift Sample Files
API Gateway installation provides OpenShift deployment samples located at SAG_Root/IntegrationServer/instances/default/packages/WmAPIGateway/resources/samples/OpenShift. To use the samples to deploy API Gateway to an OpenShift cluster, you must adapt the samples to configure the required specifications.
The OpenShift samples are conceptually identical to the ones described in the Kubernetes Sample Files section and support the same architectural patterns for ElasticSearch. This section highlights the parts that are specific to OpenShift environment.
OpenShift uses a DeploymentConfig object with API version apps.openshift.io/v1 to describe a deployment. The section in the sample file is as follows:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
If you have a pod labeled as tuned.openshift.io/elasticsearch, then OpenShift automatically changes the required system settings on the machine where the pod with the ElasticSearch container is started. The section in the sample file is as follows:
template:
metadata:
labels:
deploymentconfig: api-gateway-deployment
tuned.openshift.io/elasticsearch: ""
In OpenShift, use the ImageStream and ImageStreamTag objects to reference the image to be used for a container instead of specifying the image name directly in the spec.template.spec.containers section. The section in the sample file is as follows:
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- api-gateway-deployment
from:
kind: ImageStreamTag
name: api-gateway-deployment:10.7
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: api-gateway-deployment
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
# Please fill in the path to your api gateway image stored in a docker registry.
name: <yourDockerRegistry>:<RegistryPort>/<PathToApiGateway>:10.7
importPolicy: {}
name: "10.7"
referencePolicy:
type: Source
Use the Route objects that OpenShift provides to make a service visible outside the cluster. Note that the URL specified in the spec.host parameter is unique across the whole OpenShift cluster. The section in the sample file is as follows:
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: api-gateway-ui
spec:
# Provide a URL that will be visible outside of the OpenShift cluster
host: api-gateway-ui.apps.<yourClusterBaseUrl>
port:
targetPort: 9072-tcp
subdomain: ""
to:
kind: Service
name: api-gateway-service
weight: 100
wildcardPolicy: None