Nuwan discusses how you can expose microservices as managed APIs in Kubernetes with the API Operator, so that you can create an end-to-end solution for your entire business functionality from microservices and APIs, to end-user applications.
You can watch the on-demand webinar "Cloud Native APIs: The API Operator for Kubernetes" here: https://wso2.com/library/webinars/2019/11/cloud-native-apis-the-api-operator-for-kubernetes/
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
1. API MANAGER
From Microservices to APIs: The API
Operator in Kubernetes
Nuwan Dias
Director, API Architecture at WSO2
@nuwandias
2. Agenda
● Monoliths -> Microservices -> Service Mesh
● Demo: Deploying APIs for Microservice in Kubernetes
● Kubernetes Operators
● Custom resources in Kubernetes
● Deployment patterns
● The need for the API operator for Kubernetes
6. WSO2 API Microgateway
● Open API driven fully open source API Microgateway.
● Apache 2.0 licensed.
● Github - https://github.com/wso2/product-microgateway
● Features
○ Request routing
○ Security (Authentication/Authorization)
○ Traffic control
○ Business insights through analytics
○ Service discovery
○ Request/response transformations
○ Schema validation
10. User Story
Online Shopping Store
Products Microservice
Inventory Microservice
Review Microservice
Shopping
API
11. To expose as a managed API...
● Expose the microservices (Ingress)
● Apply security
● Apply rate limits
● Apply transformations
● API marketplace for API discovery
● API documentation and lifecycle management
13. Kubernetes
● Kubernetes (K8s) is an open source
system for automating deployment,
scaling, and managing containerized
workloads across multiple host
machines.
● By Google
15. Kubernetes Operators
● Operators are software extensions to Kubernetes that
uses the custom resources for packaging, deploying
and managing applications.
● Hides the deployment complexities
● No need of domain specific knowledge for the
application management
● List of K8s operators - https://operatorhub.io/
16. The API Operator for Kubernetes
● Makes APIs a first-class citizen in the Kubernetes
ecosystem
● Provides fully automated experience for cloud-native
API management
● OpenAPI definition (Swagger) as one single source of
truth
17. The API Operator Overview
API CRD API Controller
API Operator
K8s API Server
Docker Registry
apictl add api -n products-api
--from-file=products_swagger.yaml
19. Custom Resource - API
● API - holds API related information
apiVersion: wso2.com/v1alpha1
kind: API
metadata:
name: "product-api"
spec:
definition:
configmapName: "product-api-swagger"
type: swagger
replicas: 1
mode: privateJet
20. Custom Resource - Security
● Security - holds security related information
apiVersion: wso2.com/v1alpha1
kind: Security
metadata:
name: petstorejwt
spec:
# Security - JWT
type: JWT
issuer: https://wso2apim:32001/oauth2/token
audience: http://org.wso2.apimgt/gateway
# Create secret with certificate and add secret name
certificate: wso2am-secret
OPENAPI Defintion
security:
- petstorejwt: []
24. Deployment modes for APIs
● Private Jet
Pod
API Microgateway
Container
/API1
Pod
Microservice
Container
Pod
Microservice
Container
❏ Scale separately
❏ Dedicated gateway for the
API
25. Deployment modes for APIs
● Sidecar
❏ Scale microservice with the
gateway
❏ Dedicated gateway for the
API
Pod
API
Microgateway
Container
/API1
Microservice
Container
26. Deployment modes for APIs
● Shared
❏ Multiple APIs deployed in the
gateway
❏ Label based API grouping
Pod
API Microgateway
Container
/API1
/API2
/API3
Pod
Microservice
Container
Pod
Microservice
Container
Pod
Microservice
Container
27.
28. Summary of the API Operator for Kubernetes
● Deploys API gateways in Kubernetes using OAS configs through a
Microgateway.
● Hides the API deployment complexities
● Simplify exposing a managed API for a service
● Handles auto scaling for the API Gateway
● Supports different deployment patterns
● Deploy and manage backend services along with APIs
● Fully CI/CD compliant