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.

Cloud Native APIs: The API Operator for Kubernetes

136 views

Published on

Kubernetes (K8s) is an open-source software solution for automating deployment, scaling, and management of containerized applications. As an increasing number of microservices are deployed on Kubernetes, the need for well-documented, easy to consume, and managed APIs becomes important to develop great applications. The API Operator for Kubernetes in WSO2 API Manager makes APIs a first-class citizen in the Kubernetes ecosystem. Similar to deploying microservices, you can now use this operator to deploy APIs for individual microservices or compose several microservices into individual APIs.

In this deck, we discuss 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. Discussion topics include:
- The need for an API operator
- Configuring the API Operator
- Expose microservices as managed APIs using the API Operator
- How to apply rate-limiting and security to APIs
- Different deployment patterns (private jet and Sidecar)
- Monitoring APIs

Watch the webinar on-demand 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

Cloud Native APIs: The API Operator for Kubernetes

  1. 1. API MANAGER Cloud Native APIs: The API Operator for Kubernetes Pubudu Gunatilaka Technical Lead Dinusha Dissanayake Senior Software Engineer
  2. 2. API MANAGER Agenda ● Kubernetes ● Expose services as managed APIs ● Kubernetes Operators ● The API Operator for Kubernetes ● Custom Resources ● Deployment modes for APIs ● The need for the API operator for Kubernetes ● Demo on API Operator
  3. 3. Kubernetes ● Kubernetes (K8s) is an open source system for automating deployment, scaling, and managing containerized workloads across multiple host machines. ● By Google
  4. 4. User Story Online Shopping Store Products Microservice Inventory Microservice Review Microservice
  5. 5. User Story Online Shopping Store Products Microservice Inventory Microservice Review Microservice Products API Inventory API
  6. 6. To expose as a managed API... ● Apply security ● Apply rate limiting ● Apply mediation ● API marketplace for API discovery ● API documentation
  7. 7. API MANAGER The API Operator for Kubernetes 7
  8. 8. API MANAGER Kubernetes Operators 8
  9. 9. 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/
  10. 10. 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
  11. 11. 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
  12. 12. Custom Resources ● API ● Security ● Rate Limiting ● Target Endpoint
  13. 13. Custom Resources ● 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
  14. 14. Custom Resources ● 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: []
  15. 15. Custom Resources ● 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
  16. 16. Custom Resources ● 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
  17. 17. Deployment modes for APIs ● Private Jet ● Sidecar ● Shared
  18. 18. Deployment modes for APIs ● Private Jet Pod API Microgateway Container /API1 Pod Microservice Container Pod Microservice Container ❏ Scale separately ❏ Dedicated gateway for the API
  19. 19. Deployment modes for APIs ● Sidecar ❏ Scale microservice with the gateway ❏ Dedicated gateway for the API Pod API Microgateway Container /API1 Microservice Container
  20. 20. 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
  21. 21. The Need for an API Operator for Kubernetes ● Hides the API deployment complexities ● Simplify exposing a managed API for a service ● Handles auto scaling for API Gateway ● Switch between private and sidecar mode deployment patterns easily ● Deploy and manage backend services ● Easy to promote APIs between the environments (Dev, QA, Prod)
  22. 22. Demo
  23. 23. Demo Scenario • Deploying microservice on k8s cluster and invoking • Configuring API operator, API portal, token service and monitoring artifacts • Exposing the deployed microservices as a managed API using API Operator • Push the API to API portal • Invoke the API and monitoring 24
  24. 24. Pre-requisites • Kubectl • Kubernetes cluster (v1.12 or above) with 8GB memory and 2vCPUs • Docker-Hub account • API Operator distribution – https://github.com/wso2/k8s-apim-operator/releases/download/v1.0. 0/api-k8s-crds-1.0.0.zip • API Command Line Tool – https://wso2.com/api-management/tooling/ 25
  25. 25. Try API Operator for Kubernetes https://github.com/wso2/k8s-apim-operator/tree/v1.0.0 26
  26. 26. Q & A Join us on Slack - https://wso2-apim.slack.com/ Invitation link for Slack - http://bit.ly/332VYeC
  27. 27. API MANAGER THANK YOU wso2.com

×