Giter Club home page Giter Club logo

apk's Introduction

WSO2 APK - API Platform for Kubernetes

  WSO2 logo


Introducing APK, the API Platform for Kubernetes, a cutting-edge API management solution designed to leverage the power of Kubernetes for seamless and scalable deployments. APK harnesses Kubernetes' native features, enabling automatic scaling based on load and configurable parameters, utilizing rich Kubernetes metrics.

At the core of APK's robust gateway solution is the meticulously selected Envoy technology, known for exceptional performance, lightweight nature, and perfect compatibility within the APK ecosystem. APK extends beyond traditional gateways with purpose-built extensions addressing specific API management use cases. Some of these extensions have been contributed back to the Envoy community, reflecting our commitment to collaborative innovation.

WSO2 APK adheres to the Kubernetes Gateway API specification, an open-source project managed by the SIG-NETWORK community. This specification introduces vital resources such as GatewayClass, Gateway, HTTPRoute, TCPRoute, and Service, augmenting service networking capabilities in Kubernetes. By adhering to this specification, WSO2 APK seamlessly integrates with Kubernetes service networking, leveraging expressive and extensible interfaces to enhance API management functionality within Kubernetes deployments.

Some characteristics of APK

  • APK's microservices architecture offers advantages such as easy scalability and seamless upgrades, harnessing the benefits of the architecture for agility and flexibility.
  • The separation of the control plane and data plane in APK allows users to integrate any control plane of their choice, providing maximum flexibility and customization.
  • APK is an evolving open-source solution that delivers advanced API management capabilities and is designed for cloud-native architectures, seamlessly integrating with Kubernetes.
  • With seamless CI/CD integration, APK supports a streamlined GitOps approach for efficient deployment and management of APIs.
  • APK aims to provide API marketplace capabilities, enabling sharing, discovery, and reusability of APIs while focusing on efficient governance and administration.
  • With its Kubernetes-native approach, exceptional characteristics, microservices architecture, and commitment to collaboration and innovation, APK sets a new standard for API management.

For more information about APK release planning and project management information, visit APK Project Dashboard

For in-depth information about WSO2 API Management Platform, visit WSO2 API Management

To ask questions and get assistance from our community, visit WSO2 Discord

To learn how to participate in our overall community, visit our community page

In this README:

You'll find many other useful documents on our Documentation.

Introduction

APK is an open-source platform for providing complete API Management capabilities on top of the Kubernetes cluster management platform.

APK is composed of these components:


API Architecture


The APK architecture consists of both control plane and data plane components. In the data plane, we have the Config Service, an open API for generating APK configurations and Kubernetes API artifacts based on inputs like OpenAPI schema files. The Deployer Service enables the creation of API artifacts within the gateway runtime, requiring a valid access token for secure deployment.

These components efficiently generate configurations and deploy API artifacts within the data plane. The gateway partition comprises the Router, Enforcer, and Management Client. The Router intercepts API traffic, applying QoS policies for optimal performance. The Enforcer handles authentication and authorization, ensuring authorized access. The Management Client configures and synchronizes the Router and Enforcer, ensuring the gateway partition's smooth operation.

The architecture also includes the Rate Limiting Service, which manages rate limits for API calls. The Router communicates with the Rate Limiter to enforce quota compliance. To facilitate distributed counters across gateways, Redis serves as a shared information store for rate limiting.

Test Product APIs

WSO2 APK comes with Postman collections to test product APIs and developers can use collection of API requests and configure them to test different scenarios. For example, they can reuse available requests to verify that the API returns the correct responses for different requests. These tests will allow users to identify potential issues or bugs that may need to be addressed before using it. Please refer Postman Tests section of the repo for more information about tests and test artifacts.

Getting Started

To tryout APK please refer to this document.

Before you begin...

  • Install Helm (3.11.x) and Kubernetes client.

  • Setup a Kubernetes cluster. If you want to run it on the local you can use Minikube or Kind or a similar software.

  • Setup deployment namespace.

    kubectl create namespace <namespace>

Steps to deploy APK DS servers and CloudNativePG

HELM-HOME = apk/helm-charts

  1. Execute helm repo add bitnami https://charts.bitnami.com/bitnami and helm repo add jetstack https://charts.jetstack.io.

  2. Clone the repo and cd into the HELM-HOME folder.

  3. Execute helm dependency build command to download the dependent charts.

  4. Now execute helm install apk-test . to install the APK components.

    Optional

    To deploy control plane components only use --set wso2.apk.dp.enabled=false

    To deploy data plane components only use --set wso2.apk.cp.enabled=false

  5. Verify the deployment by executing kubectl get pods

To Access Deployment through local machine

  • You can either, identify the gateway-service external IP address to invoke the API through the APK gateway

    kubectl get svc | grep gateway-service
  • or, port forward to router-service to use localhost.

    kubectl port-forward svc/apk-test-wso2-apk-gateway-service 9095:9095

Quick Start APK with Kubernetes client

Follow the instruction below to deploy an API using the kubectl.

  1. Create API CR and create production and/or sandbox HTTPRoute CRs, and service for the API backend. You can find a sample CR set in developer/tryout/samples/ folder in this repository.

  2. Apply CRs to kubernetes API server using the kubectl.

    kubectl apply -f developer/tryout/samples/

    Note

    Services should be created in a different namespace than APK or Kubernetes System namespaces.

    APIs should be created in the APK deployment namespace.

    Provide the router service external ip to {router_service} in below commands.

  3. Get a token to invoke the System API.

    ACCESS_TOKEN=$(curl --location --request POST "https://{router_service}:9095/oauth2/token" \
    --header "Host: idp.am.wso2.com" \
    --header "Authorization: Basic NDVmMWM1YzgtYTkyZS0xMWVkLWFmYTEtMDI0MmFjMTIwMDAyOjRmYmQ2MmVjLWE5MmUtMTFlZC1hZmExLTAyNDJhYzEyMDAwMg==" \
    --header "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "grant_type=client_credentials" | jq -r ".access_token")
  4. List the created API and retrieve API's id.

    curl --location --request GET "https://{router_service}:9095/api/runtime/apis" \
    --header "Host: api.am.wso2.com" \
    --header "Authorization: Bearer $ACCESS_TOKEN"
  5. Get a token to invoke the created API. Provide the API's id to {api_id} in below command.

    INTERNAL_KEY=$(curl --location --request POST "https://{router_service}:9095/api/runtime/apis/{api_id}/generate-key" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Host: api.am.wso2.com" \
    --header "Authorization: Bearer $ACCESS_TOKEN" | jq -r ".apikey")
  6. Invoke the API.

    curl --location --request GET "https://{router_service}:9095/http-bin-api/1.0.8/get" \
    --header "HOST: gw.wso2.com" \
    --header "Internal-Key: $INTERNAL_KEY"

Run domain services APIs in APK with postman

Test Postman collection

Build APK Components

Pre-requisites

  1. Install Java JDK 11.
  2. Install Gradle(7.5.1).
  3. Install Ballerina Ballerina version: 2201.8.5 (Swan Lake Update 8).
  4. Install Go.
  5. Install Lua.
  6. Docker Runtime Up and Running.

Build all components

Run apk/build-apk.sh file.

sh build-apk.sh

Build single component

For example: building Runtime Domain Service

cd runtime/runtime-domain-service
gradle build

Issue management

We use GitHub to track all of our bugs and feature requests. Each issue we track has a variety of metadata:

  • Epic. An epic represents a feature area for APK as a whole. Epics are fairly broad in scope and are basically product-level things.Each issue is ultimately part of an epic.
  • Milestone. Each issue is assigned a milestone. This is 0.1, 0.2, ..., or 'Nebulous Future'. The milestone indicates when we think the issue should get addressed.
  • Priority. Each issue has a priority which is represented by the column in the Prioritization project. Priority can be one of P1, P2, or >P2. The priority indicates how important it is to address the issue within the milestone. P1 says that themilestone cannot be considered achieved if the issue isn't resolved.

apk's People

Contributors

amalimatharaarachchi avatar amila-rukshan avatar apk-github-bot avatar ashera96 avatar binodmx avatar blasan avatar chanaka3d avatar chashikajw avatar crowleyrajapakse avatar dulithsenanayake avatar hisanhunais avatar krishanx92 avatar maheshika avatar mariangela avatar msm1992 avatar nomadxd avatar o-sura avatar pasant9 avatar piyumaldk avatar pubudu538 avatar rakhitharr avatar sanjeewa-malalgoda avatar sanojpunchihewa avatar savindudimal avatar sgayangi avatar tharikagithub avatar tharindu1st avatar tharsanan1 avatar thisaltennakoon avatar vajiraprabuddhaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apk's Issues

Refactor existing Admin REST API layer

This is created to track the progress of moving the business logic in existing REST API layer to a lower level so that it can be reused through Ballerina interoperability with the new DS.

[APK Management server and Adapter] Extract Data for Enforcer XDS

Description:
This is to extract data for Enforcer XDS.

Need to debug and check how enforcer gets consumer keys currently.
Update application.proto to send consumer keys and do the related changes in enforcer side.

  • ApplicationData CRD (which contains a list of apps) has changed to single Application CRD. Need to consider this design change.

DevPortal Domain Service Implementation

Purpose

This issue is created to track the progress of Developer Portal Domain Service.

Functionality of DevPortal DS

The DevPortal DS consists of all the developer portal related flows and functionalities related in APK control plane. This includes,

  • API related flows
  • Application related flows
  • Subscription related flows
  • Throttling policy related flows

Sub tasks

Mono repo POC to work with multiple languages considering all CI/CD usecases

Purpose

This issue is created to track the progress of POC to support multiple language builds and CI/CD use cases using Gradle build tool.

Sub tasks

  • Use Gradle for building, testing, and running custom tasks for each language module (Java, Ballerina, Go, Node.js).
  • Run PR checks, release components, and create release version tags per component upon PR open/merge via GitHub actions and Gradle tasks.
  • Manage dependencies among projects (outer modules) and sub-projects (inner modules).
  • Push docker images to docker hub.
  • Publish build artifacts to remote maven repository with POM.

Refactor error handling in Admin flows

This is created to track the progress of error handling in admin service flows. The previous error handling mechanism was reliant on CXF. The new approach will remove this coupling and make the error handling generic.

Restructure APK Portals

Aug 29th - Sept 12th

Oct 3rd -

Aug 29th - Sept 5th

  • PKCE support for web portals

Sept 19th

  • Verify the security / dev experience

Sept 26th -

  • Removing unwanted UI features from portal apps

Sept 26th - Oct 10th

  • OIDC flow implementation

  • Make React apps independent

Create new configuration models

A new configuration model will be introduced for the domain service since the previous carbon dependencies will no longer be used with new services.

Proposed Approach

  • Single toml file to contain all the configurations. According to the call with the ballerina team, we can use the Config.toml for this purpose.
  • Record mappings on the ballerina side (similar to api-manager.xml).
  • Startup service to start all internal components related to apimgt (similar to APIMStartupComponent). Need to use ballerina interops for this too to call as a function from the ballerina code.
  • Use an object mapper from the Java side to map the configurations in runtime.

Admin Domain Services implementation

This issue is created to track the progress of Admin Domain Service implementation.

Functionality of Admin DS

The Admin DS is capable of handling all the admin related flows and use cases in APK control plane. This includes,

  • Rate limiting policy related flows
  • Key manager related flows
  • Role/Scope mappings

Proposed Solution

The service layer will be implemented using Ballerina. Ballerina interoperability feature will be used to bring the existing (java) business logic in carbon-apimgt component to the ballerina service.

High level view of a domain service will be as follows.

apkds-new drawio

Sub tasks

[Runtime API] Define OAS definition

This issue is created to track the progress of Runtime API OAS development. The following API will be defined in the OAS specification.

  • APIs (List, Create, Update, Delete)
  • Services (List)
  • Gateways (List, Create, Update, Delete)
  • Validations
  • Import Export
  • Policies (List, Create, Delete)

API Rate Limiting

Description

Support API Level (API, Resources, and HTTP method level), Application Level, and Subscription Level rate limitings using Envoy Rate-limit service.

API invocation wth rate limits

Sub Tasks

APK Management server and Adapter implementation

Functionality of APK Agent Client

APK Agent is the responsible party for managing the data-plane cluster by managing its components as well as keeping the control plane sync-up with data-plane.

Mainly it has the following functionality

  • Talks to the K8s API server and manages (Create, Update, Delete) resources in the K8s cluster(DP) -> Create APIs (in UI driven approach), Applying policies (from UI)
  • Update rate limit service with rate limit policies -> Will be an xDS communication
  • Update enforcer with subscription details, etc. -> Will be an xDS communication
  • Should have a K8s operator to listen on the resources created on the DP cluster.
  • Communicate with CP - xDS

Functionality of APK Management Server

Management server is the responsible party for keeping the CP & DP sync by communicating with APK clients in each data-planes (or in the same control-plane when we run in a single cluster).

  • Send API create/delete/update, Subscription, Policy events to the APK client - xDS
  • Service registering.
  • Update control plane with the resources created on dataplane(using cli) such as APIs, Policies, etc..

APK Management Server to APK Agent Client Communication

API Agent Client should be associated with a k8s operator, which is watching for resource updates and sending the updates to the control plane’s Management Server and the Gateway.

Since we have only one control plane available, we decided to make this communication as a gRPC client to server streaming communication.

Remove kernel, osgi, etc from admin related flows

This issue is created to track the progress of removing all kernel, axis2, osgi, etc. related dependencies from the admin related flows.

The new domain services will not rely on the carbon framework. Hence we will be removing all those from the existing carbon-apimgt code

Back Office Domain Service Implementation

This issue is created to track the progress of Backoffice Domain Service implementation.

Functionality of Back Office DS

The Backoffice DS is capable of handling all the backoffice related flows and use cases in APK control plane. This includes,

  • Creating backoffice APIs from runtime APIs
  • Add metadata to the backoffice APIs
  • Manage the backoffice APIs
  • Publish the backoffice APIs

Sub tasks

Runtime API Implementation

This issue is created to track the progress of Runtime API Implementation.

Functionality of Runtime API

The Runtime API interacts with the Kubernetes API Server in the Data plane and serves as a backend for the Runtime UI and APK CLI.

Sub tasks

Develop Interfaces


Implement the API Interfaces in Go


Improvements to Runtime API Server

  • #79
  • #70
  • Merge k8s client implementation with server
  • Implement Authorization for APIs with STS(oauth2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.