Giter Club home page Giter Club logo

k8s-gotway's Introduction

mariadb

CI Helm Release Go Report Card Go Reference Artifact Hub

☸️ 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"]
}'

Management REST API

Run in Postman

k8s-gotway's People

Contributors

mmontes11 avatar

Stargazers

 avatar

Watchers

 avatar

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.