Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes

137 views

Published on

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/

Published in: Technology
  • Be the first to comment

  • Be the first to like this

[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes

  1. 1. API MANAGER From Microservices to APIs: The API Operator in Kubernetes Nuwan Dias Director, API Architecture at WSO2 @nuwandias
  2. 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
  3. 3. A Monolith
  4. 4. Monolith -> Microservices
  5. 5. Service Mesh
  6. 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
  7. 7. Demo
  8. 8. Pre-requisites • Kubectl • Kubernetes cluster (v1.12 or above) with 8GB memory and 2vCPUs • Docker-Hub account • API Operator – https://github.com/wso2/k8s-apim-operator/ • API Controller – https://wso2.com/api-management/tooling/
  9. 9. User Story Online Shopping Store Products Microservice Inventory Microservice Review Microservice
  10. 10. User Story Online Shopping Store Products Microservice Inventory Microservice Review Microservice Shopping API
  11. 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
  12. 12. API Structure Products Microservice Inventory Microservice Review Microservice Shopping API GET /products GET /products/{product_id} GET, POST /inventory/{product_id} GET /review/{product_id}
  13. 13. Kubernetes ● Kubernetes (K8s) is an open source system for automating deployment, scaling, and managing containerized workloads across multiple host machines. ● By Google
  14. 14. API MANAGER The API Operator for Kubernetes 14
  15. 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. 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. 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
  18. 18. Custom Resources ● API ● Security ● Rate Limiting ● Target Endpoint
  19. 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. 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: []
  21. 21. Custom Resource - Rate Limits ● Rate Limiting - holds rate limiting related information apiVersion: wso2.com/v1alpha1 kind: RateLimiting metadata: name: fourreqpolicy namespace: app1-ns spec: type: application description: Allow 4 requests per minute # optional timeUnit: min unitTime: 1 requestCount: limit: 4 OPENAPI Defintion x-wso2-throttling-tier: fourreqpolicy
  22. 22. Custom Resource - Target Endpoint ● Target Endpoint - holds endpoint related information apiVersion: wso2.com/v1alpha1 kind: TargetEndpoint metadata: name: products-service labels: app: app2 spec: protocol: http port: 9090 deploy: name: products-service dockerImage: pubudu/products:1.0.0 count: 1 mode : sidecar OPENAPI Defintion x-wso2-production-endpoints: products-service x-wso2-mode: sidecar
  23. 23. Deployment modes for APIs ● Private Jet ● Sidecar ● Shared
  24. 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. 25. Deployment modes for APIs ● Sidecar ❏ Scale microservice with the gateway ❏ Dedicated gateway for the API Pod API Microgateway Container /API1 Microservice Container
  26. 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. 27. 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
  28. 28. Community GIthub - https://github.com/wso2/k8s-apim-operator Join us on Slack - https://wso2-apim.slack.com/ Invitation link for Slack - http://bit.ly/332VYeC
  29. 29. API MANAGER THANK YOU wso2.com

×