Deploy on OpenShift
This guide walks you through deploying API7 Gateway on a Red Hat OpenShift cluster. The instructions cover OpenShift-specific considerations such as Security Context Constraints (SCCs) and service account configuration, while following the same Helm-based deployment model as a standard Kubernetes deployment.
Architecture Overview
API7 Gateway uses the same two-component architecture on OpenShift as on any Kubernetes cluster:
- Control Plane (CP): Dashboard, DP Manager, and PostgreSQL database
- Data Plane (DP): API7 Gateway instances that handle API traffic
The key difference on OpenShift is that pods must comply with Security Context Constraints (SCCs), which restrict the actions a pod can perform.
Prerequisites
Before you begin, ensure you have:
- An OpenShift cluster running version
4.12or later, withcluster-adminaccess. - The OpenShift CLI (
oc) version4.12or later. See Install oc. - Helm version
3.10or later. See Install Helm. - An API7 Enterprise license. See Get a trial license.
Log in to the OpenShift Cluster
Log in using the oc CLI. You can find the login command from the OpenShift web console under your user menu:
oc login \
--token=sha256~YOUR_TOKEN \
--server=https://api.YOUR_CLUSTER.openshiftapps.com:6443
Verify you have cluster-admin access:
oc auth can-i create scc --all-namespaces
Step 1: Create a Project
Create a dedicated OpenShift project (namespace) for API7:
oc new-project api7
Alternatively, create the project from the OpenShift web console.
Step 2: Install the Control Plane
Add the API7 Helm Repository
helm repo add api7 https://charts.api7.ai
helm repo update
Configure Security Context for Built-in Components
The built-in PostgreSQL and Prometheus pods require writable filesystems. On OpenShift, you must disable the default securityContext settings in the Helm chart to allow OpenShift's SCC system to manage security contexts:
postgresql:
primary:
podSecurityContext:
enabled: false
containerSecurityContext:
enabled: false
prometheus:
server:
podSecurityContext:
enabled: false
containerSecurityContext:
enabled: false
For production deployments, use an external PostgreSQL database (e.g., Amazon RDS, Azure Database for PostgreSQL, or a dedicated PostgreSQL instance) instead of the built-in one. See the Kubernetes deployment guide for external database configuration.
Install the Control Plane Helm Chart
helm install api7ee3 api7/api7ee3 \
-f cp-values.yaml \
-n api7
Verify Control Plane Services
oc get svc -n api7 -l app.kubernetes.io/name=api7ee3 -o wide
Expected output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
api7ee3-dashboard ClusterIP 172.30.39.137 <none> 7080/TCP,7443/TCP 2m
api7ee3-developer-portal ClusterIP 172.30.114.132 <none> 4321/TCP 2m
api7ee3-dp-manager ClusterIP 172.30.232.75 <none> 7900/TCP,7943/TCP 2m
Step 3: Activate the License
Port-forward the Dashboard service:
oc port-forward svc/api7ee3-dashboard -n api7 7443:7443
Open https://localhost:7443 in your browser. Log in with the default credentials (admin / admin), then upload your license.