Git Product home page Git Product logo

image-hub's Introduction

Layer5 Image Hub

Go Report Card GitHub GitHub issues by-label Website Twitter Follow Slack CII Best Practices

If you’re using the Image Hub or if you like other Layer5 projects, please β˜… star this repository to show your support! 🀩

Image Hub

Image Hub is a sample application written to run on Consul for exploring WebAssembly modules used as Envoy filters. This demo application has been enabled by experimental works of Nic Jackson of HashiCorp, and Kanishkar J, Lee Calcote, and other contributors of Layer5.

Deployment Instructions

Image Hub supports Envoy-based data planes. Deployment instructions for each supported service mesh are below.

Using Istio (pending PR #196+release; clone and do make run for now):

  1. Use Meshery to deploy istio and the Image Hub sample application (Management > Istio > Manage Sample Application Lifecycle > Image-Hub ) onto the Istio service mesh.

  2. To map imagehub.meshery.io to the appropriate IP, run the following command to add the appropriate entry in the "\etc\hosts" file:

    echo $(kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[0].status.addresses[?\(@.type==\"InternalIP\"\)].address})'    'imagehub.meshery.io | sudo tee -a /etc/hosts
    
  3. To get the environment port, run the following command:

    echo $(kubectl get svc istio-ingressgateway -n istio-system -o jsonpath='{.spec.ports[1].nodePort}')
    
  4. Access the web UI using:

    http://imagehub.meshery.io:<environment port>
    

Using Consul:

  1. Deploy the latest Consul:

    helm repo add hashicorp https://helm.releases.hashicorp.com # Adds helm hashicorp repo
    helm install consul hashicorp/consul -f config/consul-values.yaml # Setup custom Consul with support for WASM
  2. Use Meshery to deploy the Image Hub sample application onto the Consul service mesh.

  3. Find the port assigned to the ingess service:

    kubectl get svc ingess
    NAME     TYPE       CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
    ingess   NodePort   10.97.34.25   <none>        80:31118/TCP   27m
    
  4. Open http://localhost:31118 (where 31118 is your environment's port number).

Use Image Hub

  1. Upon visiting the image-hub homepage, we would need to signup for an account! Go ahead and click the "Sign Up" button in the top right.
  2. Enter the login details, and select a plan; Personal gives you 10 pulls per minute, Team gives you 100 pulls per minute, and Enterprise will give you 1000 pulls per minute.
  3. After signing up, you should be redirected to the login page, where you can login and start using the sample app.
  4. On the main page, open up the network network tab, and reload the page. This will allow you to see the request-response of the app.
  5. Go ahead and click the download button a couple of times. You'll notice that there is nothing actually limiting you from crossing the number of pulls according to the plan you chose!
  6. Alternatively you could test the above by navigating to http://imagehub.meshery.io:/pull, and then looking at the resquest-responses.

Deploying the Rate Limiter WASM Filter for Envoy

  1. Go back to Management > Istio and under "Apply Service Mesh Configuration" make sure to apply "Automatic Sidecar Injection"
  2. Open up a terminal, and run kubectl get pods to get a list of running pods. You should be able to see 2 pods, web and api. Now run the command kubectl delete pods <exact web pod name> <exact api pod name>. This will cause kubernetes to respawn them with the updated configuration.
  3. Go back to Management > Istio and under "Apply Service Mesh Configuration", select the Envoy Filter for Image Hub option, and wait for a few seconds.

Use Image hub with a WASM filter

  1. Test your ability to "pull" an image (images are not in fact pulled, but an HTTP request is sent to the backend api). You would not be able to pull an image, and the response would say "unauthorized".
  2. Sign up a new user and select a subscription plan.
  3. Login as that user.
  4. Test your ability to "pull" an image. You should be able to pull an image.
  5. Open Meshery's performance management page (http://localhost:9081/performance)
  6. Configure a performance test against http://x.x.x.x:31118/api/pull (where x.x.x.x is your machine's host IP address, not "localhost")
  7. Enter { "authorization" : "<your user's token>" }
  8. Run the performance test. See that your subscription plan limit is enforced accordingly.
  9. Change your subscription plan and retest.

Architecture

Consul Service Mesh Architecture w/WebAssembly

Service Mesh Architecture - Consul

Image Hub deployed on Consul

Meshery and WASM

Presentations

DockerCon'2020

Β 

Join the service mesh community!

Our projects are community-built and welcome collaboration. πŸ‘ Be sure to see the Layer5 Community Welcome Guide for a tour of resources available to you and jump into our Slack!

Layer5 Service Mesh Community

Layer5 Service Mesh Community

βœ”οΈ Join any or all of the weekly meetings on the community calendar.
βœ”οΈ Watch community meeting recordings.
βœ”οΈ Access the Community Drive by completing a community Member Form.

Not sure where to start? Grab an open issue with the help-wanted label.

Β 

About Layer5

Community First

The Layer5 community represents the largest collection of service mesh projects and their maintainers in the world.

Open Source First

We build projects to provide learning environments, deployment and operational best practices, performance benchmarks, create documentation, share networking opportunities, and more. Our shared commitment to the open source spirit pushes Layer5 projects forward.

License

This repository and site are available as open source under the terms of the Apache 2.0 License.

image-hub's People

Contributors

pranav-bhatt avatar leecalcote avatar kanishkarj avatar dependabot[bot] avatar naturalett avatar kumarabd avatar imgbotapp avatar shivaylamba avatar vineet-sharma29 avatar ashiscs avatar iambami avatar geraldmaboshe avatar josephmidura avatar kushthedude avatar pluckyprecious avatar crustyy 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.