This document describes the installation of Apinizer Integration.

1) Introduction

API integration provides the ability to create workflows by enabling one or more endpoints to be fluidly connected together.

2) Pre-installation Steps

Before starting the installation of Apinizer API Integration, the following should be noted:

3) Installation Steps

API Integration Installation is done in two ways.

  • If Kubernetes management is done via Apinizer, you can set up API Integration via API Manager.
  • If Kubernetes management is not done via Apinizer, a manual installation can be done on Kubernetes and then a connection can be established with API Manager.


3.1) Installing API Integration via API Manager

After ensuring that Kubernetes management is done via Apinizer, API Integration can be set up by following the steps below:

In API Manager, go to Administration → Server Management → Kubernetes Resources page. Enable API Integration from the Deployment & Pods tab. Complete the setup by making the necessary definitions.


image-2024-8-16_11-54-19.png


In the dialog that opens, define the mandatory fields appropriate for your organization.



FieldDescription
Access URLAPI Integration access address. Example address: http://<Integration_Access_Address>port
Count

The number of Gateway engines is equivalent to the replicaSet in Kubernetes Cluster.

Service Port

Gateway engine access port is equivalent to NodePort in Kubernetes Cluster.

CPU

This is the maximum number of CPU cores that the pod will use.

Memory

The maximum memory value that the pod will use.

Memory Unit

The unit of value required for memory is selected; MB, GB.

Additional Variables

Default and optional variables and their values ​​are defined to be run in the pod. Default variables cannot be deleted, only their values ​​can be edited.

Host Aliases

IP addresses on the network can sometimes be placed behind host names. If these are not defined in the nameserver or host file, or if Apinizer cannot resolve them in some way, a Host Alias ​​must be defined for worker pods to resolve these names.


After completing the above steps and ensuring that the Pods belonging to API Integration on Kubernetes are ready, you can start using it from the Project → Development → API Integrator → Task Flows menu.


The following warning should be taken into account when configuring the Java Options setting in the Additional variables area:

Please note that the -Xmx and -Xms settings disable automatic heap sizing.

Apinizer sets the JVM Heap values ​​to use 75% of the memory given to the container since it is running inside the container.

UseContainerSupport is active by default.

The old flags -XX: {Min|Max} RAMFraction are now deprecated. There is a new flag -XX: MaxRAMPercentage which takes a value between 0.0 and 100.0 and defaults to 25.0. Therefore, if there is a 1 GB memory limit, the JVM heap is limited to ~250 MB by default.

 Click for detailed information.

3.2) Manual Integration Setup

Create a namespace for the integration.

kubectl create ns apinizer-integration
POWERSHELL

Take the 'mongo-db-credentials' secret from the Apinizer namespace and add it to the apinizer-integration namespace.

kubectl get secret mongo-db-credentials -n apinizer -o yaml | kubectl apply -n apinizer-integration -f -
POWERSHELL

Create the Deployment yaml for Integration.

vi integration.yaml
POWERSHELL
apiVersion: apps/v1
kind: Deployment
metadata:
  name: integration
  namespace: apinizer-integration
spec
  replicas: 1
  selector:
    matchLabels:
      app: integration
      version: v1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 75%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: integration
        version: v1
    spec:
      containers:
      - env:
        - name: JAVA_OPTS
          value: -server -XX:MaxRAMPercentage=75 -Dlog4j.formatMsgNoLookups=true           
        - name: SPRING_DATA_MONGODB_URI
          valueFrom:
            secretKeyRef:
              key: dbUrl
              name: mongo-db-credentials
        - name: SPRING_DATA_MONGODB_DATABASE
          valueFrom:
            secretKeyRef:
              key: dbName
              name: mongo-db-credentials
        - name: SPRING_PROFILES_ACTIVE
          value: prod
        image: apinizercloud/integration:<APINIZER_VERSION>
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /apinizer/management/health
            port: 8092
            scheme: HTTP
          initialDelaySeconds: 120
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 30
        name: integration
        ports:
        - containerPort: 8092
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /apinizer/management/health
            port: 8092
            scheme: HTTP
          initialDelaySeconds: 120
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 30
        resources:
          limits:
            cpu: "1"
            memory: 768Mi
        startupProbe:
          failureThreshold: 3
          httpGet:
            path: /apinizer/management/health
            port: 8092
            scheme: HTTP
          initialDelaySeconds: 91
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 30
POWERSHELL


kubectl apply -f integration.yaml
POWERSHELL


To see the status of the created Pod, you can use the following Kubectl command:


kubectl get pods -n <NAMESPACE>
POWERSHELL

Up to this stage, the integration yaml file and Pod have been created.


3) NodePort Setting

vi apinizer-integration-service.yaml
POWERSHELL
apiVersion: v1
kind: Service
metadata:
  labels:
  name: integration
  namespace: apinizer-integration
spec:                 
  ports:
  - nodePort: 32090            
    port: 8092                 
    protocol: TCP
    targetPort: 8092           
  selector:
    app: integration
  type: NodePort
POWERSHELL
kubectl apply -f apinizer-integration-service.yaml
POWERSHELL