AppMesh on Google Cloud Platform
Tags: google, cloud, integration, tutorial
Published: 2021-08-13 09:20:04

---
title: AppMesh on Google Cloud Platform
published: true
date: 2021-03-09 04:36:06 UTC
tags: #google, #cloud, #integration, #tutorial
canonical_url: https://tech.forums.softwareag.com/t/appmesh-on-google-cloud-platform/239511
---

 **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](https://aws1.discourse-cdn.com/techcommunity/original/2X/6/68e1a68c71300a689b2aba36c9ff965403491d8d.png)

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](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/9676c32b5cd7ce23ed53124b3fee8840bd603a1a.png)

Verify the Kubernetes cluster info: kubectl cluster-info

![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/e/ee476442d05d65eb43667267fefa756a0767df32.png)

- 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](https://aws1.discourse-cdn.com/techcommunity/original/2X/5/521207fdf62426b9bfbc1c158c3525b6777a0843.png)

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](https://aws1.discourse-cdn.com/techcommunity/original/2X/c/cc9096d4d65c81df16235feea9f5438d3d6d1615.png)

![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/d/d5df8bd1181e6ff887f19119f288a462271cc953.png)

- 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](https://aws1.discourse-cdn.com/techcommunity/original/2X/d/dff0048b30b876c0375c9d454b0c61d3a21f121b.png)
5. Run the yaml file using kubectl command  
kubectl apply -f apigw.yaml
6. 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
7. Access the Integration Server and API Gateway via the endpoints.
![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/7/7d2cda56d2885e18a3b616465681cfe07d36f09e.png)
8. 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](https://aws1.discourse-cdn.com/techcommunity/original/2X/1/1e5162d24dc1832246bf58a0b959475a9d634ed2.png)

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

![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/f/ff5e2a6a1168f26c9cdf4fdec2e6acb145187aca.png)

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](https://tech.forums.softwareag.com/t/appmesh-user-guide/237453)  
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.

[Read full topic](https://tech.forums.softwareag.com/t/appmesh-on-google-cloud-platform/239511)