Gotway
☸️ Cloud native API Gateway powered with in-redis cache
Install / Use
/learn @gotway/GotwayREADME
<p align="center">
<img src="https://gotway.github.io/gotway/assets/gotway.png" alt="mariadb" width="250"/>
</p>
<p align="center">
<a href="https://github.com/gotway/gotway/actions/workflows/ci.yml"><img src="https://github.com/gotway/gotway/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/gotway/gotway/actions/workflows/helm.yml"><img src="https://github.com/gotway/gotway/actions/workflows/helm.yml/badge.svg" alt="Helm"></a>
<a href="https://github.com/gotway/gotway/actions/workflows/release.yml"><img src="https://github.com/gotway/gotway/actions/workflows/release.yml/badge.svg" alt="Release"></a>
<a href="https://goreportcard.com/report/github.com/gotway/gotway"><img src="https://goreportcard.com/badge/github.com/gotway/gotway" alt="Go Report Card"></a>
<a href="https://pkg.go.dev/github.com/gotway/gotway"><img src="https://pkg.go.dev/badge/github.com/gotway/gotway.svg" alt="Go Reference"></a>
<a href="https://artifacthub.io/packages/helm/gotway/gotway"><img src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/gotway" alt="Artifact Hub"></a>
</p>
☸️ gotway
Cloud native API Gateway powered with in-redis cache.
- API composition: expose your services to the internet using a single endpoint
- Cloud native: configure routing and cache using Kubernetes CRDs
- In-memory cache using redis
- Cache invalidation using tags
- Health checking
- Management REST API
- ~6MB Docker image available for multiple architectures
- Helm chart
Installation
helm repo add mmontes https://mmontes11.github.io/charts
helm repo add gotway https://gotway.github.io/gotway
helm install redis mmontes/redis
helm install gotway gotway/gotway
Quickstart
We will need microservices to route to in order to test Gotway, you can deploy some by running:
helm upgrade --install gotway gotway/gotway --set examples.enabled=true
Let's register the catalog service into Gotway by creating an IngressHTTP CRD:
kubectl apply -f ./manifests/examples/catalog.yml
apiVersion: gotway.io/v1alpha1
kind: IngressHTTP
metadata:
name: catalog
spec:
match:
host: catalog.gotway.duckdns.org:9111
service:
name: catalog
url: http://gotway-catalog
healthPath: /health
cache:
ttl: 30
statuses:
- 200
- 404
tags:
- "catalog"
- "products"
We are now able to route requests through Gotway:
curl -k --request GET 'https://catalog.gotway.duckdns.org:9111/products' | jq
{
"products": [
{
"id": 911902081,
"name": "sneakers",
"price": 69000,
"color": "white",
"size": "42"
}
],
"totalCount": 1
}
This response has a TTL of 30 seconds, let's invalidate the cache for the catalog service by providing one of its tags:
curl -k --request DELETE 'https://gotway.duckdns.org:9111/api/cache' \
--header 'Content-Type: application/json' \
--data-raw '{
"tags": ["catalog"]
}'
