AppMesh on Google Cloud Platform

Introduction

This article covers the details on Software AG API Gateway AppMesh set up on Google Cloud Platform using Google Kubernetes Engine.

Prerequisites

  • 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.

image

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.

image

Verify the Kubernetes cluster info: kubectl cluster-info

image

  • 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.

image

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.

image

image

  • 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

  1. Create a namespace and set the context to the newly created namespace.
    kubectl create namespace appmesh
    kubectl config set-context --current --namespace=appmesh

  2. Ensure that istio-injection is enabled for the namespace “appmesh” for side car deployment.
    kubectl label namespace appmesh istio-injection=enabled

  3. 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=******************

  4. 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:

image

  1. Run the yaml file using kubectl command
    kubectl apply -f apigw.yaml
  2. 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
  3. Access the Integration Server and API Gateway via the endpoints.

image

  1. 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)

image

Perform the App Mesh Configuration with API Gateway URL and Microgateway Image as in below screenshot.

image

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.