Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADR] API Gateway #34

Open
piotrczyz opened this issue Mar 30, 2022 · 6 comments
Open

[ADR] API Gateway #34

piotrczyz opened this issue Mar 30, 2022 · 6 comments
Assignees
Labels

Comments

@piotrczyz
Copy link
Member

piotrczyz commented Mar 30, 2022

Context

We would like to add a communication layer between all our frontends and our back services.

As a goal, there should be an easy way to configure/add a new service. Everything should be configurable as a pipeline (Infrastructure as a code).

We want to provide an unified way of communication with our services so that will be easily accessible for external applications or developers.

Decision

After an investigation and consultations, we decide to go for Azure Front Doors.

In general, using API gateway we're not binded to a programming language. We can use whatever language we know that supports HTTP calls.

Although, almost all our applications are hosted on Google and a natural way would be to start using a service provided from Google. But we consider using Azure as a long-term strategy for our systems and it was a indication of our choice.

Cloud Loud Balancer from Google supports only services hosted on Google. Azure Front Doors is a global load balancer and we can use it both for services hosted either on Azure or Google as long as Azure Containers Apps go out of Preview.

Consequences

Possibly, there may occur some latency between Azure Front Doors and Cloud Run but we can always move dockerized application to Azure.

Alternatives

Azure Front doors with CDN

https://docs.microsoft.com/en-us/azure/frontdoor/front-door-overview

Both Azure Front doors and Azure Application Gateways are layer 7 (HTTP/HTTPS) load balancers.

Pros

  • global load balancing, a non-regional service
  • fully managed by Azure

Going to GA May 1st, 2022.

Azure Application Gateway

https://docs.microsoft.com/en-us/azure/application-gateway/overview

  • could be used as a Application Gateway Ingress Controller add-on for AKS cluster link

  • a regional service

Proxy+WAF

A simple application with implementation for Reverse Proxy + WAF
https://auth0.com/blog/building-a-reverse-proxy-in-dot-net-core/

This is a solution per region so we won't get any benefits of global caching as we have for e.g Front Doors.
Possible solutions:

Konghq

https://konghq.com/

We didn't consider that as it costs $250 / month. For our needs there are better suitable solutions.

Cloud Load Balancer | Google Cloud

https://cloud.google.com/load-balancing

  • cross-region load balancing
  • the same frontend-serving infrastructure that powers Google

For applications in GKE, GKE Ingress controller is recommended that manages the load balancing.

For deployment, Terraform module can be used link

API gateway | Google Cloud

https://cloud.google.com/api-gateway

  • configuring the API based on open api specification
  • providing api_keys to access the API
  • API Gateway is a scale-to-zero service

For .NET application you can get OAS from link /swagger/v1/swagger.json for you application. There is a possibility to deploy an API on existing API Gateway link

Deployment https://cloud.google.com/api-gateway/docs/deployment-model

@github-actions
Copy link

Remember that ADRs are publicly available hence do not include any confidential information in the issue description!
To read more about ADR please refer to documentation.

@bcc-code bcc-code deleted a comment from github-actions bot Mar 30, 2022
@bcc-code bcc-code deleted a comment from github-actions bot Mar 30, 2022
@bcc-code bcc-code deleted a comment from github-actions bot Mar 30, 2022
@bcc-code bcc-code deleted a comment from github-actions bot Mar 30, 2022
@bcc-code bcc-code deleted a comment from github-actions bot Mar 30, 2022
@rvanoord
Copy link
Member

Are there any compelling solutions in GCP @piotrczyz?
One thing I think we should be looking for, is something that can be configured as part of a deployment pipeline, so that we easily can add new services without a lot of manual configuration.

@piotrczyz
Copy link
Member Author

As far as I can see there are possibilities using CLI for both AZ and GCP.

@piotrczyz
Copy link
Member Author

As far as I read and observed, if we consider creating services as a part of deployment pipeline then it looks like a better fit will be GCP and either API Gateway or Cloud Loud Balancer from Google Cloud. We can always use Terraform to manage our CI/CD. @rvanoord

@rvanoord
Copy link
Member

rvanoord commented Apr 1, 2022

Does Google have a good offering that would work cross-cloud @piotrczyz? Google API Gateway looks interesting, but perhaps it only supports Google services (like cloud run)?

@piotrczyz
Copy link
Member Author

It looks like Google has something to offer for hybrid connectivity, @rvanoord
image
https://cloud.google.com/load-balancing/docs/https/use-cases#load_balancing_with_hybrid_connectivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants