The Importance of API Management in Cloud Native Environments and the Role of WSO2 APK

 API Management and Kubernetes

APIs enable different software systems to communicate with each other and exchange data. Prior to 2005, APIs were primarily used to communicate between different components within a single system. As the internet grew and became more interconnected, APIs were increasingly used to allow different systems and applications to communicate with each other over the internet. This enabled the creation of new services and applications that could leverage the functionality of other systems and platforms. Today, APIs are an essential part of modern software development and are used in a wide range of applications and industries.


The rise of cloud computing has significantly contributed to the importance of APIs in modern software development. Cloud services often expose APIs that allow developers to access and integrate with their services, which has enabled the creation of a vast ecosystem of cloud-based services that can be easily integrated into modern applications. This has made it easier for organisations to build and deploy applications that leverage the power of the cloud and has helped to drive innovation and growth in the tech industry. As the internet and cloud computing continue to evolve, the importance of APIs is likely to increase as they provide a way for different systems and platforms to communicate and exchange data in a seamless and efficient manner.


Kubernetes is a popular open-source platform for managing and deploying containerized applications. One of its key benefits is its ability to abstract away the underlying infrastructure, allowing developers to focus on building their applications rather than worrying about the underlying servers and infrastructure. This makes it easier to deploy applications consistently across different environments, including on-premises, in the cloud, or in a hybrid environment.

Kubernetes is widely used in the development and deployment of cloud native applications and provides a set of tools and APIs for deploying, scaling, and managing containerized applications, as well as for handling the underlying infrastructure and resource management. 


Rethink API Management for Kubernetes Environments

A large part of modern application development and application modernization is done on Kubernetes environments because of its capabilities and infrastructure-level flexibility. 

Let's discuss some of these capabilities and see how they enhance the API management experience.

  • Flexibility and scalability: Kubernetes environments are dynamic, with applications and services being added and removed frequently. API management solutions must be able to adapt to these changes and scale up or down accordingly. Most traditional solutions often struggle to meet these scaling requirements due to their heavy, monolithic architecture.

  • Leveraging pull-based capabilities: Kubernetes environments rely on a pull-based model, in which applications and services are automatically scaled based on demand. Sometimes traditional push-based architectures can be inefficient and cause resource contention in Kubernetes environments.

  • Integration with Kubernetes features: Kubernetes offers a range of features such as service discovery, load balancing, and rolling updates that can be used to improve the reliability and scalability of applications. If an API management solution cannot integrate efficiently with these features, it won't be able to take full advantage of being on Kubernetes.

  • Lightweight and efficient: Kubernetes environments often require lightweight and efficient solutions to ensure optimal performance. Some API management solutions are a bit heavy and resource-intensive to run effectively in these environments.

  • Multiple environments support: Many organizations use multiple environments (e.g., dev, test, and prod) to develop and deploy their applications. Traditional API management solutions may struggle to manage and maintain separate configurations for each environment, leading to increased deployment/management complexity.

  • Microservices architecture support: Kubernetes environments are often used to support microservices architectures, which ideally requires building a large application consisting of  smaller, independent components. Traditional API management solutions may not be well-suited to managing APIs for these microservices, leading to increased complexity and reduced visibility.

  • Managing hybrid environments: Many organizations use a combination of on-premises and cloud infrastructure to support their applications. However, managing APIs in these  environments can lead to increased complexity and reduced flexibility.

  • Distributed architecture: Kubernetes environments often involve distributed architectures, with applications and services running across multiple nodes and clusters. It can be difficult to manage APIs in these distributed environments due to increased complexity and reduced visibility of standard API management solutions.


There is a significant need for a comprehensive solution that can utilize the above capabilities, while addressing the challenges of API management in the Kubernetes and cloud native domain. A complete solution for API management in the Kubernetes domain would need to address these challenges in a seamless and integrated manner. It should provide robust security features to protect APIs from unauthorized access and be able to scale to handle increased traffic as needed. It should also provide robust monitoring and logging capabilities to help identify and troubleshoot issues and support versioning and backward compatibility to allow for the introduction of breaking changes without affecting existing clients. In addition, the solution should provide excellent documentation and an enhanced developer experience to make it easy for developers to use and integrate with the APIs. It should also be able to handle integration with external APIs, including handling changes to these APIs and any potential downtime.


WSO2 API Platform for Kubernetes (APK)

WSO2 decided to pivot its focus to Kubernetes environments owing to increasing demand in this area. The result is a Kubernetes-specific API management platform, drawing on the company's decade of experience in the API management domain. During the initial product analysis, the team noticed that the Kubernetes gateway API could be used to define APIs and gateways easily, and that the API gateway project from Envoy offered a simplified deployment model and API layer aimed at lighter use cases. As a result, the team decided to use the API gateway project as the API gateway implementation while using the Kubernetes gateway API to configure that gateway. The team also decided to use open standards and open source components to build the API management solution for Kubernetes, allowing for greater flexibility, community support, and cost savings. This approach also allows for easier integration with other existing systems and tools and encourages collaboration and contributions from the wider community.


Custom resource definitions (CRDs) help to extend Kubernetes APIs by creating custom resources that can be managed by the Kubernetes API server. These resources can be used to configure APIs, apps, and other resources related to our API management use cases in a Kubernetes cluster. One such use case is the Kubernetes Gateway API, which configures and manages ingress for a Kubernetes cluster. It uses CRDs to define the gateway API  (ingress resources) and allows for more flexibility and control over API traffic. 

 

WSO2 announced the platform’s first milestone release (version 0.0.1M1) at the end of December 2022, and we’ve been sending out new releases on a bi-weekly basis. The team is planning to release a general availability version in early 2Q23. Let's take a look at the solution’s components and interconnectivity capabilities.


Architecture

APK is built on a microservices architecture, which makes it highly scalable and flexible. Each component – including the API gateway, API developer portal, admin service, and API back office (publisher) – is implemented as a separate microservice. This allows businesses to easily add or remove functionality as needed. This modular design also makes it easy to update and maintain individual components without impacting the entire system.


Figure 1: WSO2 APK: component overview



The APK control plane is a system that provides API management capabilities, marketplace functionality, and domain services and web applications. It consists of four main sub-components: the Back Office, which is responsible for configuring the portal aspects of APIs, including description, document, and image etc; the Dev Portal, which allows API consumers to discover, and consume APIs; the Admin Portal, which is used to configure rate limit policies, key management services, and other administrative tasks; and the Management Server, which communicates with data planes and pushes updates. All of the system’s backend components have been developed using Ballerina, Java, and GoLang.


The APK data plane provides API runtime capabilities such as a gateway, rate-limiting services, and runtime management. It consists of three main sub-components: the Runtime Manager, which is responsible for configuring the runtime aspects of APIs, discovering Kubernetes services, and converting them into APIs; the Management Client, which communicates with the management server (control plane) to push and pull updates and maintain connectivity between the data plane and the control plane; and the API Gateway, which is composed of two main components: the Router, which intercepts incoming API traffic and applies quality of service such as authentication, authorization, and rate limiting, and the Enforcer, which enforces API management capabilities such as security, rate limiting, analytics, validation, etc. 


By using Envoy as the foundation for our API gateway, we’re able to provide businesses with a highly performant, lightweight and feature-rich gateway that can handle a large number of concurrent API requests. The Envoy-based gateway provides a centralized point of entry for all API traffic and allows businesses to easily control and manage access to their APIs. The gateway also includes authentication, rate limiting, and request/response transformation capabilities, which allows businesses to control API usage and transform requests and responses to match their specific needs.


Summary

The future direction of the API management domain is likely to be heavily influenced by the continued adoption of cloud native architectures and platforms like Kubernetes. As more organizations move towards cloud native approaches, the need for effective API management will become increasingly important. Overall, there is a clear need for a complete solution that can address the challenges of API management in the Kubernetes and cloud native domain. Such a solution will help organizations to more easily develop and deploy cloud native applications, and will make it easier for them to leverage the benefits of Kubernetes and the cloud. The experience we’ve gained by designing and developing API management solutions globally across different industry verticals has helped WSO2 to redefine API management for cloud native environments. WSO2 APK is specifically designed to address API management challenges in cloud native environments utilizing Kubernetes features.


No comments:

Post a Comment

Empowering the Future of API Management: Unveiling the Journey of WSO2 API Platform for Kubernetes (APK) Project and the Anticipated Alpha Release

  Introduction In the ever-evolving realm of API management, our journey embarked on the APK project eight months ago, and now, with great a...