WSO2 API Management for Istio, service mesh

Pubudu Gunatilaka
3 min readMay 2, 2019

--

Introduction

WSO2 API Manager is a full lifecycle API Management solution which has an API Gateway and a Microgateway. Istio is a service mesh solution which helps users to deploy and manage a collection of microservices. Service meshes in their native form have an “API Management Gap” that requires to be filled. These are related to exposing services to external consumers (advanced security, discovery, governance, etc), business insights, policy enforcement, and monetization. This explains how WSO2 API Manager can be positioned to integrate with Istio and manage services deployed in Istio as APIs.

The Istio mixer adapter for WSO2 API Manager can do the following.

  1. Secure your service using JWT tokens and OAuth2 tokens
  2. Validate subscriptions for your APIs which are created for the services
  3. Fine-grained access control for APIs via scopes
  4. Business insights for APIs via WSO2 API Manager Analytics
  5. WSO2 API Manager integration automates HTTPAPISpec, HTTPAPISpecBinding and rules creation for APIs

Approach

While Istio providing Data Plane and Control Plane capabilities, WSO2 API Manager provides Manage Plane capabilities to manage microservices.

Component Diagram

Role of the Istio Mixer plugin

The mixer is a core Istio component which runs in the control plane of the service mesh. Mixer’s plugin model enables new rules and policies to be added to groups of services in the mesh without modifying the individual services or the nodes where they run. API management policies such as authentication (by API key validation), rate-limiting, etc can be deployed and managed at API Manager without doing any changes to the actual microservice or sidecar proxy.

API Management for Istio

When need to expose this service to outside in a managed way, API developer can use WSO2 API Publisher portal to create the API by attaching necessary policies like security, rate limiting, etc. The Publisher is capable of pushing all these policies into Envoy proxy via Pilot and Mixer for them to take action of policy enforcement. After publishing this API, it will appear in the WSO2 API Developer portal. Now app developer can discover these APIs and use in their application along with all the capabilities provided by developer portal like getting a subscription plan, adding application security, etc. The business user can use API Analytics to get more business insights by looking at API Analytics.

Route of a Successful Request

Let us now see how service calls work with this solution and at which point API related quality of services gets applied. As you can see in the diagram below, when a request comes from outside it first goes to the Istio proxy (Envoy) and then it will communicate with the mixer for performing policy checks. Based on the outcome of the policy checks, the request may be routed to the service or an error should be sent back to the client. Please see the diagram and steps listed below.

Request flow
  1. The client sends the request to the service (Istio capture the request and redirect to the Istio-proxy). This enters the Kubernetes cluster via an ingress point.
  2. Proxy captures a wealth of signal and sends to the Mixer as attributes.
  3. Mixer adapter then calls the API Manager for various types of policy checks and verifications.
  4. API Manager performs the policy checks and responds back to the mixer.
  5. Mixer communicates the outcome of the policy checks to the Istio proxy.
  6. Since in this case there are no policy validation failures the request is routed to the microservice.
  7. The microservice executes the service logic and sends the response.
  8. The response is sent out to the client.

The WSO2 API Manager team is pleased to announce the release of WSO2 API Management for Istio - v1.0. You can try out by following the guide.

Please try out and let us know your comments.

Thank you!

--

--

Pubudu Gunatilaka

Senior Technical Lead @ WSO2 | Committer and PMC Member - Apache Stratos | PaaS Enthusiastic