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/
Handwritten Text Recognition for manuscripts and early printed texts
Cloud Native APIs: The API Operator for Kubernetes
1. API MANAGER
Cloud Native APIs: The API Operator
for Kubernetes
Pubudu Gunatilaka
Technical Lead
Dinusha Dissanayake
Senior Software Engineer
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. Kubernetes
● Kubernetes (K8s) is an open source
system for automating deployment,
scaling, and managing containerized
workloads across multiple host
machines.
● By Google
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. 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.
12. 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. Deployment modes for APIs
● Private Jet
Pod
API Microgateway
Container
/API1
Pod
Microservice
Container
Pod
Microservice
Container
❏ Scale separately
❏ Dedicated gateway for the
API
20. Deployment modes for APIs
● Sidecar
❏ Scale microservice with the
gateway
❏ Dedicated gateway for the
API
Pod
API
Microgateway
Container
/API1
Microservice
Container
21. 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
22. 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)
24. 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
25. 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
26. Try API Operator for Kubernetes
https://github.com/wso2/k8s-apim-operator/tree/v1.0.0
26
27. Q & A
Join us on Slack - https://wso2-apim.slack.com/
Invitation link for Slack - http://bit.ly/332VYeC