NGINX Modern Apps Reference Architecture

The NGINX Modern Apps Reference Architecture (MARA) represents a strategic shift in how enterprises approach the deployment of microservices within Kubernetes environments. Historically, the transition from monolithic architectures to microservices has been plagued by what Rob Whiteley, GM of the NGINX Product Group at F5, describes as "black magic." This complexity stems from the myriad of decisions required regarding networking, security, authentication, and the implementation of API gateways. When these components are misconfigured, the result is often a fragile infrastructure that is difficult to debug and scale. To combat this, the NGINX Modern Apps Reference Architecture provides a highly opinionated, "stealable" framework. It is designed to enable developers, DevOps, and Platform Ops teams to instantiate a complete, fully operational microservices-based application in a matter of minutes, all hosted within a single GitHub repository.

By providing these ready-to-use blueprints, NGINX aims to accelerate the development cycle and improve the overall reliability of microservices systems. This architectural framework does not merely serve as a guide for users; it acts as a critical platform for NGINX and F5 to test new features, whether they are developed internally or by external partners, and distribute them as part of the product core or via dynamic modules. Furthermore, by analyzing how these reference architectures are implemented, NGINX gains a holistic perspective on the broader microservices ecosystem, allowing for better integration with partner systems.

The Technical Framework of MARA

The NGINX Modern Apps Reference Architecture is built upon a foundation of automation and Infrastructure-as-Code (IaC). Rather than providing static documentation, MARA delivers actual code that can be modified and improved.

  • Implementation Components: The architecture consists primarily of YAML files and Python scripts.
  • Infrastructure as Code: Pulumi is utilized as the default choice for the infrastructure-as-code implementation, ensuring that the environment can be provisioned consistently across different stages of the software development lifecycle.
  • Deployment Velocity: The architecture is optimized for speed, allowing teams to get a microservices-based application up and running in minutes.

NGINX Microservices Network Models

The NGINX Microservices Reference Architecture (MRA) acknowledges that not all microservices applications require the same level of complexity. Consequently, it offers several progressively complex models to suit different organizational needs and maturity levels.

The Proxy Model

The Proxy Model is the most straightforward networking approach provided within the reference architecture. It is designed for simplicity and is primarily used when NGINX Plus serves as a central controller or an API gateway for a microservices application.

  • Foundational Infrastructure: This model is built on top of Docker Cloud.
  • Primary Use Case: It is most suitable for simple networking requirements where a central entry point is needed to manage requests before they are routed to the internal microservices.

The Router Mesh Model

As applications grow in scale and complexity, the Router Mesh Model provides a more robust alternative to the simple proxy. This model focuses on the efficiency of communication between the various services in the cluster.

  • Architectural Design: In this model, a load balancer is deployed on each host.
  • Connection Management: The Router Mesh Model specifically manages the connections between different systems, reducing the bottlenecks associated with a single central proxy and improving the resilience of the network fabric.

The Fabric Model

While the Proxy and Router Mesh models handle basic and intermediate networking, the Fabric Model represents a higher tier of architectural sophistication, designed for large-scale, high-performance microservices ecosystems.

Integration with Kubernetes and Service Mesh

The emergence of Kubernetes as a container orchestration framework has fundamentally changed how microservices are deployed, and NGINX has evolved to fill several critical roles within this ecosystem.

NGINX as a Kubernetes Ingress Controller

In a Kubernetes environment, NGINX often serves as the Ingress controller. This component acts as the entry point for all external traffic entering the cluster.

  • API Gateway Pattern: The ingress controller implements the API gateway pattern, providing a single point of entry that manages request routing, SSL termination, and authentication.
  • Managed Solutions: In specific implementations, such as those on Azure Kubernetes Service (AKS), a managed NGINX-based ingress controller is utilized via an application routing add-on to expose HTTP and HTTPS routes to services inside the cluster.

NGINX in the Istio Service Mesh

For organizations requiring advanced traffic management and observability, NGINX integrates deeply with Istio.

  • Sidecar Proxy Role: NGINX Open Source and NGINX Plus can be deployed as sidecar proxies within an Istio service mesh.
  • Reliability and Capability: By utilizing NGINX as a sidecar, organizations can bring greater reliability and enhanced capabilities to their service mesh applications, leveraging NGINX's high-performance proxying and load balancing features.

The Pragmatic Maturity Model for Microservices

Adopting microservices is not a binary switch but a journey of increasing maturity. Charles Pretzer, Technical Architect at NGINX, emphasizes a pragmatic approach to this transition, regardless of whether the project is a "green field" application or a migration from a legacy monolith.

  • Coupling Strategies: A core focus of the maturity model is determining how to couple microservices. The goal is to ensure that services remain loosely coupled to avoid "distributed monoliths."
  • Loosely Coupled Architecture: NGINX is used as the mechanism to enforce this loose coupling, ensuring that changes in one service do not necessitate immediate changes in others.
  • Advanced NGINX Plus Capabilities: Within a mature microservices architecture, NGINX Plus provides several high-level features:
    • Service Discovery: Automatically detecting new service instances as they are scaled.
    • Load Balancing: Distributing traffic efficiently across multiple instances.
    • Health Monitoring: Ensuring traffic is only sent to healthy pods.
    • Security: Implementing robust security layers to protect internal and external APIs.

Implementation in Azure Kubernetes Service (AKS)

A practical application of the NGINX microservices architecture can be seen in the deployment of a drone delivery application on Azure Kubernetes Service (AKS). This implementation demonstrates how NGINX integrates with cloud-native components.

Core Component Matrix

Component Role in Architecture Specific Technology
Orchestration Hosts and orchestrates microservices containers AKS
Networking Connects pods to Azure virtual networks; provides traffic visibility Azure CNI powered by Cilium
Ingress Exposes HTTP/HTTPS routes; implements API Gateway pattern Managed NGINX-based Ingress Controller
Identity Management Provides authentication and authorization Microsoft Entra ID
Data Storage Stateless microservices write data and state Azure Cosmos DB, Azure Managed Redis, Azure DocumentDB, Service Bus

Data Flow and Design Patterns

The AKS microservices architecture leverages several cloud design patterns, including Publisher-Subscriber, Competing Consumers, and Gateway Routing.

  • External Request Entry: A client application sends a JSON payload via HTTPS to the public fully qualified domain name (FQDN) of the load balancer, which is the managed NGINX ingress controller.
  • Workflow Microservice Orchestration:
    • The workflow microservice consumes message information from the Service Bus message queue.
    • It sends an HTTPS request to the delivery microservice, which subsequently interacts with Azure Managed Redis.
    • It sends an HTTPS request to the drone scheduler microservice.
    • It sends an HTTPS request to the package microservice, which writes data to MongoDB.
  • Status Retrieval: When an HTTPS GET request is made to check delivery status, the request passes through the managed NGINX ingress controller before reaching the delivery microservice.

Advanced Patterns in Microservices Architecture

Beyond the basic connectivity, the NGINX reference architecture incorporates advanced software patterns to ensure system stability and scalability.

  • The Twelve-Factor App: NGINX provides guidance on adapting the Twelve-Factor App methodology specifically for microservices environments, ensuring that applications are portable and scalable.
  • Circuit Breaker Pattern: To prevent cascading failures in a microservices chain, NGINX Plus can be used to implement the Circuit Breaker pattern. This prevents a failing service from bringing down the entire system by failing fast and providing fallback mechanisms.

Conclusion

The NGINX Microservices Reference Architecture marks a departure from the fragmented approach to container networking. By shifting from abstract documentation to "stealable" code implemented via Pulumi and YAML, F5 and NGINX have lowered the barrier to entry for organizations moving toward cloud-native architectures. The progression from the Proxy Model to the Router Mesh and finally the Fabric Model allows organizations to scale their networking complexity in lockstep with their operational maturity.

The integration of NGINX as both an Ingress controller and an Istio sidecar proxy demonstrates a versatile approach to the "service mesh" versus "API gateway" debate, proving that both can coexist to provide maximum reliability. When combined with the pragmatic maturity model, the architecture ensures that microservices remain loosely coupled, highly observable, and secure. Whether deployed on an AKS baseline using Azure CNI or as a standalone Kubernetes cluster, the NGINX reference architecture provides the necessary guardrails to avoid the "black magic" of misconfiguration, resulting in a system that is not only fast to deploy but sustainable to operate.

Sources

  1. The New Stack
  2. F5 Blog
  3. F5 Webinar
  4. F5 Resources
  5. Microsoft Learn

Related Posts