If you’re using the Image Hub or if you like other Layer5 projects, please ★ star this repository to show your support! 🤩
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.
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):
-
Use Meshery to deploy istio and the Image Hub sample application (Management > Istio > Manage Sample Application Lifecycle > Image-Hub ) onto the Istio service mesh.
-
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
-
To get the environment port, run the following command:
echo $(kubectl get svc istio-ingressgateway -n istio-system -o jsonpath='{.spec.ports[1].nodePort}')
-
Access the web UI using:
http://imagehub.meshery.io:<environment port>
-
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
-
Use Meshery to deploy the Image Hub sample application onto the Consul service mesh.
-
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
-
Open http://localhost:31118 (where 31118 is your environment's port number).
- 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.
- 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.
- After signing up, you should be redirected to the login page, where you can log in and start using the sample app.
- On the main page, open up the network tab, and reload the page. This will allow you to see the request-response of the app.
- 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!
- Alternatively, you could test the above by navigating to http://imagehub.meshery.io:/pull and then looking at the request-responses.
- Go back to Management > Istio and under "Apply Service Mesh Configuration" make sure to apply "Automatic Sidecar Injection"
- 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
andapi
. Now run the commandkubectl delete pods <exact web pod name> <exact api pod name>
. This will cause kubernetes to respawn them with the updated configuration. - 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.
- 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". - Sign up a new user and select a subscription plan.
- Log in as that user.
- Test your ability to "pull" an image. You should be able to pull an image.
- Open Meshery's performance management page (http://localhost:9081/performance)
- 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")
- Enter
{ "authorization" : "<your user's token>" }
- Run the performance test. See that your subscription plan limit is enforced accordingly.
- Change your subscription plan and retest.
- DockerCon 2020 | deck | (video
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!
✔️ 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.
✔️ Discuss in the Community Forum.
Not sure where to start? Grab an open issue with the help-wanted label.
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.