This article covers the details on Software AG API Gateway AppMesh set up on Google Cloud Platform using Google Kubernetes Engine.
- The reader is expected to have a basic understanding of API Gateway, Microgateway, App Mesh and policy enforcement.
- Basic understanding of Kubernetes and Istio Service Mesh concepts.
Set of instructions for AppMesh on GCP:
- Set up Kubernetes Cluster on Google Cloud using Google Kubernetes Engine
Create a project in Google Cloud Platform. (For example: as in below screenshot - AppMeshIstio is the project.)
Create a Kubernetes cluster with required configuration of CPU and memory.
Once the Kubernetes cluster is set up, connect to the cluster via cloud shell.
Set to the current project and fetch the credentials by executing the below commands.
Use “gcloud config set project [PROJECT_ID]” to set to the current project. (for ex: appmeshistio)
Run “gcloud container clusters get-credentials appmeshistio --zone us-east1-b --project appmeshistio”
Cluster endpoint and auth data is fetched. Kubeconfig file is generated for the project.
Kubeconfig file is required for Appmesh and Istio Service Mesh configuration.
Verify the Kubernetes cluster info: kubectl cluster-info
- Install Istio Service Mesh on Kubernetes Cluster
Install Istio Service Mesh onto the Kubernetes Cluster by enabling the ‘Istio’ feature in the Kubernetes cluster. Below screenshot for reference.
Ensure that the Istio Service Mesh is installed with control plane and all the required tools and frameworks that Istio Service Mesh is composed of.
- Deploy APIGateway Image containing AppMesh features on to the Kubernetes Cluster
Deploy the API Gateway onto the Istio Service Mesh.
API Gateway Image path on Docker Hub: store/softwareag/apigateway-trial:10.5.0.2
Create a namespace and set the context to the newly created namespace.
kubectl create namespace appmesh
kubectl config set-context --current --namespace=appmesh
Ensure that istio-injection is enabled for the namespace “appmesh” for side car deployment.
kubectl label namespace appmesh istio-injection=enabled
Create a Secret to connect to the Docker Hub for pulling the images from the registry.
kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v2/ --docker-username=***** --docker-password=****** --docker-email=******************
Create a deployment yaml for API Gateway and Microgateway
Below is the sample apigw.yaml with Secret, path to api gateway docker image and with memory configuration:
- Run the yaml file using kubectl command
kubectl apply -f apigw.yaml
- Expose the Integration Server and API Gateway ports of type Load Balancer.
kubectl expose deployment apigw – port 5555 --target-port 5555 – name http-apigw
kubectl expose deployment apigw – port 9072 --target-port 9072 – name http-apigwui – type=LoadBalancer
kubectl expose deployment apigw – port 5555 --target-port 5555 – name http-apigwisext – type=LoadBalancer
- Access the Integration Server and API Gateway via the endpoints.
- Once the API Gateway services are runing, access the API Gateway endpoint.
- Service Mesh Configuration in API Gateway
Login to the API Gateway UI to configure the Istio Service Mesh. Navigate to Administration → External Accounts → Service Mesh.
Browse and Load the kube config file (extracted from kubernetes cluster from the path /.kube/config)
Perform the App Mesh Configuration with API Gateway URL and Microgateway Image as in below screenshot.
On Saving the configuration, Kubernetes Cluster name and Cluster endpoint is reflected in the API Gateway.
- Reference Article for API configuration in AppMesh - AppMesh User guide
for details on APIfy a microservice in AppMesh. This results in API creation in API Gateway for adding the resources and Application context policies configuration. Deploy the API onto Microgateway. Deploy the Microgateway onto Istio proxy from AppMesh.
Make a REST call from postman using the Microgateway endpoint
and verify the analytics log in API Gateway.