Coder Social home page Coder Social logo

swisstxt / http-cache-controller Goto Github PK

View Code? Open in Web Editor NEW
3.0 8.0 1.0 76 KB

a kubernetes http cache controller

License: The Unlicense

Dockerfile 2.99% C# 97.01%
cache dotnet k8s k8s-cache k8s-controller kubernetes kubernetes-controller nginx proxy reverse-proxy

http-cache-controller's Introduction

k8s http-cache-controller

a simple http cache layer which routes traffic trough an nginx reverse proxy with caching

Installation

kubectl apply -f https://raw.githubusercontent.com/swisstxt/http-cache-controller/master/service-account.yaml
kubectl apply -f https://raw.githubusercontent.com/swisstxt/http-cache-controller/master/controller-deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/swisstxt/http-cache-controller/master/cache-deployment.yaml

Usage

annotate your service with the following annotations:

metadata:
  annotations:
    swisstxt.ch/http-cache-enabled: "true"

update your ingress to use the cached service

before:

spec:
  rules:
  - host: mydomain.com
    http:
      paths:
      - backend:
          service:
            name: myservicename
            port:
              name: http

after:

spec:
  rules:
  - host: mydomain.com
    http:
      paths:
      - backend:
          service:
            name: myservicename-cached
            port:
              name: http

HAPPY CACHING!

http-cache-controller's People

Contributors

asnapper avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

asnapper

http-cache-controller's Issues

allow selecting ports which need to be cached via annotation

currently all ports are mapped to the caching layer when annotating a service. it should be possible, via a second annotation, to select which ports on a service need to go trough the cache layer

metadata:
  annoations:
    swisstxt.ch/http-cache-enabled: "true"
    swisstxt.ch/http-cache-ports: "http"

or comma separated with multiple ports:

metadata:
  annoations:
    swisstxt.ch/http-cache-enabled: "true"
    swisstxt.ch/http-cache-ports: "http,prometheus"

make proxy ports persistent

adding a new cached service, might change mapped ports in the config map

there is also the possibility of mapping ports several times

investigation needed

get rid of wave-pusher dependency

currently the nginx cache instance depends on wave pusher to update it's configuration / reload the configuration

consider a lightweight alternative

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.