This document provides a step-by-step guide for deploying OpenLegacy API Caller to OpenShift.
Installation
API Caller is installed using a Docker Compose file.
Access to the Openlegacy Docker Hub and further details can be requested from Support@openlegacy.com
Prerequisites
Operator Laptop:
- OpenShift Cluster access with OpenShift CLI
- Docker
- Private Docker Registry access (docker login)
- OpenLegacy API Caller Images (frontend, designer, proxy, iam)
- OpenShift deployment script and OpenShift Resource Descriptors (YAML files)
Cluster:
- OpenShift Cluster is configured to pull images from Private Docker Registry
- PostgreSQL Database
API Caller Docker Images
You can get OpenLegacy API Caller images by either downloading them with docker from DockerHub or by getting .tar/.tar.gz archive from OpenLegacy representative.
1. DockerHub
First and foremost, you should get read permission for the following private repositories:
- openlegacy/reverse-api-frontend
- openlegacy/reverse-api-designer
- openlegacy/reverse-api-proxy
- openlegacy/reverse-api-iam
Then login to docker.io via terminal using your DockerHub credentials: docker login
Pull docker images by using the command: docker pull openlegacy/<image-name>:<tag>
2. Private Docker Registry
Now, when you have all the images on your machine, you need to push (docker push) them to the private docker registry of your choice (JFrog, Docker, GitLab).
Note: OpenShift Cluster should have a pull access to this docker registry.
OpenShift Deployment
After you have pushed docker images to the private docker registry extract the content of the api-caller-openshift.zip archive. An extracted folder contains 2 shell scripts and 5 OpenShift resource descriptors.
In order to deploy API Caller to OpenShift follow the instructions below.
1. Adjust OpenShift Resource Descriptors
Make the following adjustments in all of the *.yml files:
- Replace [DOKER REGISTRY URL] placeholder with an actual url of your docker registry.
- Replace [NAMESPACE] placeholder with the name of the OpenShift Project/ Namespace you are going to deploy to.
- In case you need to provide an image pull secret uncomment the appropriate section in YAML file and replace <image pull secret> placeholder with the name of the secret.
2. Add permissions to read ConfigMaps and Secrets
In order to enable Pods to read ConfigMaps and Secrets add edit role to the default ServiceAccount*:
oc policy add-role-to-user edit system:serviceaccount:[namespace]:default
3. Deploy PostgreSQL Database
Deploy the database by running the following commands:
- oc create -f postgres-template.yml
- oc new-app postgre
4. Deploy API Caller Components
Run deploy.sh script (./deploy.sh) and wait for applications to deploy.
To shutdown applications run undeploy.sh script.
* Note: it is possible to configure more restrictive permissions. You can enable ConfigMaps support by providing get, list and watch verbs for configmaps and secrets resources in your custom role.