API Developer Portal Installation
This document explains the installation of the Apinizer API Developer Portal.
1) Introduction
The API Developer Portal is the end-user or developer portal where API Consumers can access documentation related to APIs offered by an organization, test them, utilize them within specific constraints, and ask questions about them.
Similar to other Apinizer products, the API Developer Portal operates on the Kubernetes Platform. No database is used for portal operations; instead, interaction is facilitated directly through APIs provided by the API Manager.
2) Pre-installation Steps
Before starting the installation of the Apinizer API Portal, the following points should be noted:
- API Manager must be installed. Please refer to the Apinizer Installation and Configuration documentation for API Manager Installation.
- Your license key must include the API Developer Portal component.
3) Installation Steps
The installation of the API Portal can be done in two ways:
- If Kubernetes management is done through Apinizer, you can install the API Developer Portal via the API Manager.
- If Kubernetes management is not done through Apinizer, manual installation can be performed on Kubernetes, followed by establishing a connection with the API Manager.
3.1) Create Personal API Access Tokens
Token information can be obtained by creating a new token or using an existing token on the My Profile → page.Staff tokens usually start with apnz_.
You can create the token information from the field in the image below.
3.2) Installation of API Developer Portal via API Manager
3.2.1) If API Developer Portal installation will be done via API Manager
For the installation of the API Developer Portal via API Manager, the following section in the General Settings menu must be active.
Navigate to Management → Server Management → Kubernetes Resources page in the API Manager. Activate the API Portal from the Deployment & Pods tab. Complete the installation by making necessary configurations.
In the opened dialog, define the mandatory fields according to your organization's requirements.
Field | Description |
---|---|
Apinizer Portal Management API URL | The address of the Management API run by the API Manager, necessary for the API Developer Portal to consume Apinizer Management APIs. Example address: http://apimanager-ui-ip-address:port/apiportal/management |
Apinizer Portal Management API Key/Token | The token information required for the API Developer Portal to consume Apinizer Management APIs. |
Count | Equivalent to the number of gateway engines, similar to replicaSets in Kubernetes Cluster. |
Service Port | Gateway engine access port regulates the NodePort setting of the service object in the Kubernetes Cluster. |
Node List | Sets which Kubernetes Worker servers the pods will run on. Edit the NodeAffinity setting in Kubernetes. |
CPU | The maximum number of CPU cores that the Pod can use. |
Memory | The maximum memory value that the Pod can use. |
Memory Unit | The unit of measurement for memory; MB, GB. |
Additional Variables | Default and optional variables and their values to be defined for running within the Pod. Default variables cannot be deleted, only their values can be edited. |
Host Aliases | IP addresses in the network can sometimes be appended with hostnames. If these are not defined in the nameserver or host file, or if Apinizer cannot resolve them in some way, Host Alias definitions should be made for worker pods to resolve these names. |
When configuring the Java Options in the Additional Variables field, please consider the following warning:
When-Xmx and -Xms parameters are used, automatic heap sizing is disabled.
Keep in mind that Apinizer configures JVM Heap values to utilize 75% of the allocated container memory since it runs within a container.
UseContainerSupport is enabled by default.
The old flags -XX:{Min|Max} RAMFraction have been deprecated. There is a new flag -XX:MaxRAMPercentage, which takes a value between 0.0 and 100.0 (defaulting to 75.0). If there is a 1 GB memory limit, the JVM heap is limited to approximately ~750 MB by default.
For more detailed information, click here.
3.2.2) If API Developer Portal installation will not be done through API Manager
For the manual installation of the API Developer Portal, the following steps should be followed:
Important: Create a Kubernetes Secret containing the API Manager API address and API Key/Token information. Fill in the following details according to your organization.
- apinizerManagementApiBaseUrl: The address of the Management API running on API Manager, required for the API Developer Portal to consume Apinizer Management APIs. An example address would be: http://apimanager-ui-ip-address:port
- apiKey: The token information required for the API Developer Portal to consume Apinizer Management APIs.
API_MANAGER_URL='<APINIZER_MANAGEMENT_API_BASE_URL>'
API_MANAGER_APIKEY='<API_KEY>'
echo -n ${API_MANAGER_URL} | base64
//We will substitute the output of this for the <ENCODED_URL> variable in the next step
echo -n ${API_MANAGER_APIKEY} | base64
//We will substitute the output of this for the <ENCODED_API_KEY> variable in the next step
vi api-portal-secret.yaml
apiVersion: v1
kind: Namespace
metadata:
name: apinizer-portal
---
apiVersion: v1
kind: Secret
metadata:
name: apinizer-portal-secret
namespace: apinizer-portal
type: Opaque
data:
apinizerManagementApiBaseUrl: <ENCODED_URL>
apiKey: <ENCODED_API_KEY>
kubectl apply -f api-portal-secret.yaml
vi apinizer-portal-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: apinizer-portal
namespace: apinizer-portal
spec:
replicas: 1
selector:
matchLabels:
app: apinizer-portal
version: v1
template:
metadata:
labels:
app: apinizer-portal
version: v1
spec:
containers:
- name: apinizer-portal-app
image: apinizercloud/portal:<APINIZER_VERSION>
env:
- name: SPRING_PROFILES_ACTIVE
value: prod
- name: JAVA_OPTS
value: ' -XX:MaxRAMPercentage=75.0'
- name: API_PORTAL_MANAGEMENT_API_BASE_URL
valueFrom:
secretKeyRef:
key: apinizerManagementApiBaseUrl
name: apinizer-portal-secret
- name: API_PORTAL_MANAGEMENT_API_KEY
valueFrom:
secretKeyRef:
key: apiKey
name: apinizer-portal-secret
resources:
limits:
memory: 2Gi
cpu: 1
ports:
- name: http
containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: apinizer-portal-service
namespace: apinizer-portal
labels:
app: apinizer-portal
spec:
selector:
app: apinizer-portal
type: NodePort
ports:
- name: http
port: 8080
nodePort: <API_PORTAL_PORT>
kubectl apply -f apinizer-portal-deployment.yaml
Important
Up to this point, the API Developer Portal interface installation may have been completed. However, integration with API Manager is required for APIs to be viewable on the API Developer Portal, for credential creation, and for other functionalities to be utilized.
3.3) Integration of the API Developer Portal with API Manager
In API Manager, go to Management → Portal Management → Settings page, and make the appropriate definitions for your organization.
Click for detailed information.
3.4) Starting the API Developer Portal with SSL
The API Developer Portal can be accessed with SSL if desired.
http://<KUBERNETES_WORKER_IP>:<API_PORTAL_PORT>