Giter Site home page Giter Site logo

knrp's Introduction

Knative Reverse Proxy

Knative Reverse Proxy (knrp) for local development of Knative application with/without magic DNS.

Install

go install github.com/injustease/knrp@latest

Usage

Run Knative cluster

The easiest way is using Knative quickstart.

Fetch the Knative networking layer for <gateway>

Fetch the External IP.

# Kourier
kubectl --namespace kourier-system get service kourier

# Istio
kubectl --namespace istio-system get service istio-ingressgateway

# Contour
kubectl --namespace contour-external get service envoy

Example output Kourier (External IP is pending and it is intentional, use localhost instead), e.g. localhost:80 or simply localhost.

NAME      TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
kourier   LoadBalancer   10.96.97.137   <pending>     80:32354/TCP,443:32488/TCP   33m

Fetch the Knative service URL for <service>

Fetch the Service URL.

# kn
kn service list

# kubectl
kubectl get services.serving.knative.dev

Example output with service hello in the namespace default, e.g. http://hello.default.example.com.

# without magic DNS
NAME    URL                                       LATEST        AGE   CONDITIONS   READY   REASON
hello   http://hello.default.example.com   hello-00001   34m   3 OK / 3     True    

# with magic DNS
NAME    URL                                       LATEST        AGE   CONDITIONS   READY   REASON
hello   http://hello.default.127.0.0.1.sslip.io   hello-00001   34m   3 OK / 3     True    

Run knrp

Command knrp <gateway> <service>

knrp localhost http://hello.default.127.0.0.1.sslip.io

Output knrp.

2022/04/06 16:05:19 knrp run at port: 52070

For more information run knrp --help.

Expose to the internet with ngrok

You now expose Knative service to the internet with ngrok by using knrp address.

ngrok http 52070

knrp's People

Contributors

minizilla avatar

Watchers

 avatar  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.