What Is Kubernetes API Gateway?The Gateway API, now part of the core Kubernetes distribution, provides Gateway resources that facilitate Kubernetes service networking through extensible, role-oriented, and expressive interfaces. Gateway API was created to replace the Ingress API and has since been extended. The SIG-NETWORK community manages this open-source project.
Gateway API extends the scope of Kubernetes’ underlying network gateways and proxy servers to support many more vendors and industries. It supports commonly-used networking protocols like HTTP, TCP, TLS, and UDP. You can leverage it to manage the lifecycle of all network gateways as a Kubernetes API.
Modern software architecture can be complex, with high security, reliability, and availability demands. Managing microservices and containers at scale requires metrics, traces, and logs to observe, debug, and maintain applications and systems.
The new Kubernetes API Gateway project will be used alongside these popular Kubernetes observability tools.
The Kubernetes dashboard is a web UI for deploying, troubleshooting, and managing container-based applications. It lets you manage resources for Kubernetes clusters, providing an overview of the applications running on each cluster. The dashboard provides resource state and error data. A log viewer lets you search logs related to a given pod.
Want More Tech News? Subscribe to ComputingEdge Newsletter Today!
Jaeger is a distributed tracing system for monitoring and troubleshooting microservices in distributed environments. It focuses on context propagation, transaction monitoring, root cause and service dependency analysis, and performance and latency optimization.
Grafana
Grafana helps you visualize observability data by processing the raw metrics into a human-readable form.
The ELK Stack
ELK stands for Elasticsearch, Logstash, and Kibana. It combines these open-source projects to help you analyze Kubernetes logs. Elasticsearch is an analytics tool and search engine, Logstash is a log ingestion pipeline, and Kibana is a visualization solution.
Here are some design features behind the Gateway API that show how it improves on existing standards, such as Ingress:
The Kubernetes gateway API also includes the following features:
Gateway API and Ingress API both attempt to provide functionality through APIs for Kubernetes applications, but in different ways.
Why you need APIs
Deploying a Kubernetes application requires exposing it to end-users, typically through an inlet controller configuration for north-south traffic flow. The Ingress object can define the routing and mapping of this external traffic flowing to your Kubernetes service, providing load balancing, name-based virtual hosting, and SSL termination.
Commercial controllers, like NGINX Ingress and HAProxy, help implement the Ingress API interface. Each controller differs, providing various features like advanced load balancing through vendor extensions. However, Ingress is limited and does not offer portability for the ecosystem.
Gateway API vs. Ingress
Gateway API was created to replace Ingress to provide advanced, Kubernetes-native functionality. Ingress vendors provide features that enable this functionality, but through private extensions that are not coordinated with those provided by other vendors. Gateway API solves this problem by implementing multiple vendors according to a single specification.
Unlike Ingress, Gateway API supports traffic segmentation and HTTP and TCP routing. It employs a role-oriented approach that enables you to focus on configuration related to your responsibilities.
Here are some design principles implemented in this API.
The Kubernetes gateway API ensures consistency at a single-resource level, avoiding the issues associated with complex resource graphs. It enables simple syntax checks and synchronicity, avoiding the broken links between Kubernetes resources and mismatched configurations.
Separating responsibilities across teams can result in configuration conflicts, such as two application teams inadvertently submitting the configuration for one HTTP path.
Usually, fields prone to conflicts have documentation offering guidance for resolving the conflicts. If there is no prescribed conflict resolution, use the following general principles:
It is important to consider how the API might change over time. Like the older Ingress API, various products in a cluster can implement the gateway API. Thus, the current version could be different from the version used to develop the implementation. To avoid breaking the implementation, it must have the following capabilities:
This validation is not a final validation enforcing the schema—it provides quick feedback when users submit invalid configurations. It is best to write code defensively for cases when invalid input reaches the controller. Neither Webhook nor CRD validation is fully reliable.
It is important to ensure that the implementation is secure even if the API encounters unexpected values. The validation should reject malformed configurations and notify users via status block conditions. API maintainers can avoid duplication by adding a shared validation package.
In this article, I provided an in-depth look at the Kubernetes API Gateway project and its context within the Kubernetes ecosystem. In summary, these are the core aspects added by Kubernetes API Gateway, which were not covered by the original Kubernetes Ingress:
I hope this will help you gain a better understanding of the new project and evaluate it for use in your Kubernetes clusters.
Disclaimer: The author is completely responsible for the content of this article. The opinions expressed are their own and do not represent IEEE's position nor that of the Computer Society nor its Leadership.