Code Monkey home page Code Monkey logo

skupper-interceptor's Introduction

A simple proof-of-concept of a skupper interceptor

The following steps assume a working skupper namespace.

First deploy some kind of service. I use a simple http echo that returns whatever is POSTed to it:

kubectl create deployment echo-impl --image quay.io/gordons/http-echo --port 8080

Expose this via skupper:

skupper expose --protocol http deployment echo-impl

Now create another skupper service that will be the first stage in the chain:

skupper service create echo 8080 --mapping http

Deploy the interceptor (update the env vars if changing either of the service names above):

kubectl apply -f https://raw.githubusercontent.com/grs/skupper-interceptor/main/interceptor.yaml

Then bind this to the entry service:

skupper service bind echo deployment my-interceptor

Calls to http://echo:8080 within the cluster now go through the interceptor to the echo-impl pod. The interceptor in this example obfucates certain words (apple bananan and grape on requests, red, yellow and green on responses).

E.g.

$ kubectl run -it --image quay.io/gordons/fedora:30 test
If you don't see a command prompt, try pressing enter.
[root@test /]# curl -d $'purple grapes and green apples\n' http://echo:8080/
purple *****s and ##### *****s
[root@test /]# curl -d $'no fruit for me thanks\n' http://echo:8080/
no fruit for me thanks

skupper-interceptor's People

Contributors

grs avatar

Watchers

James Cloos 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.