{"id":15350138,"url":"https://github.com/mars/tinyrobot-science-mesh-web-ui","last_synced_at":"2025-04-04T08:13:39.198Z","repository":{"id":139298543,"uuid":"165332334","full_name":"mars/tinyrobot-science-mesh-web-ui","owner":"mars","description":"🚧🔬 experiment using Kong service mesh in a Heroku app","archived":false,"fork":false,"pushed_at":"2019-01-12T02:49:48.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T19:18:20.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-12T01:16:26.000Z","updated_at":"2019-01-12T17:33:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"56af94e4-5a15-421f-bc88-46e68e26761a","html_url":"https://github.com/mars/tinyrobot-science-mesh-web-ui","commit_stats":{"total_commits":58,"total_committers":5,"mean_commits":11.6,"dds":0.5172413793103448,"last_synced_commit":"b66603ff77c1a7c1f749f2903bd051cc3cf4ca62"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Ftinyrobot-science-mesh-web-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Ftinyrobot-science-mesh-web-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Ftinyrobot-science-mesh-web-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Ftinyrobot-science-mesh-web-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mars","download_url":"https://codeload.github.com/mars/tinyrobot-science-mesh-web-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142075,"owners_count":20890653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T11:57:41.263Z","updated_at":"2025-04-04T08:13:38.930Z","avatar_url":"https://github.com/mars.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  🚧🔬 tinyrobot.science \"Kong 1.0 Mesh\" experiment\n\n*Based on [this microservices example app](https://github.com/mars/tinyrobot-science-web-ui).*\n\nLet's discover how Kong's new sidecar deployment style integrates with Heroku.\n\n## Results\n\nKong's actual mesh networking (service-to-service, mutual TLS) features are [facilitated by changing `iptables`](https://docs.konghq.com/1.0.x/streams-and-service-mesh/#step-7-configure-transparent-proxying-rules) configuration on the hosts, which is not possible on Heroku.\n\nEven without the true mesh networking, deploying Kong sidecar-style does still provide some benefits:\n\n- less latency than a separate Kong proxy app (the proxy-backend connection is on localhost)\n- Kong cluster inherently scales with the app's dyno scaling\n\n## Open questions\n\nCan a single Kong controller operate many apps worth of Kong sidecars?\n  - Do backend `PORT` values conflict?\n  - Does the [`KONG_ORIGINS` config](https://docs.konghq.com/1.0.x/streams-and-service-mesh/#the-origins-configuration-option) solve this? (Setting hostnames into config vars is gross 😣)\n\n## Deployment\n\nFirst, [deploy a Kong app](https://github.com/heroku/heroku-kong) as the mesh controller.\n\nThen, deploy this app:\n\n```bash\nheroku create tinyrobot-science-mesh-web-ui\nheroku buildpacks:add heroku/nodejs\nheroku buildpacks:add heroku-community/kong\nheroku buildpacks:add https://github.com/danp/heroku-buildpack-runit\n\n# Attach the ID of the mesh controller's Postgres add-on.\nheroku addons:attach postgresql-cylindrical-98791\n\ngit push heroku master\n```\n\nThen, create the mesh service \u0026 route:\n\n(Note: port 5000 is the local listener set in bin/start-app)\n\n```bash\n## Create mesh service\ncurl -X \"PUT\" \"https://tinyrobot-science-mesh-control.herokuapp.com/kong-admin/services/web-ui\" \\\n     -H 'apikey: xxxxx' \\\n     -H 'Content-Type: application/json; charset=utf-8' \\\n     -d $'{\n  \"url\": \"http://127.0.0.1:5000\"\n}'\n\n## Create mesh route\ncurl -X \"POST\" \"https://tinyrobot-science-mesh-control.herokuapp.com/kong-admin/services/web-ui/routes\" \\\n     -H 'apikey: xxxxx' \\\n     -H 'Content-Type: application/json; charset=utf-8' \\\n     -d $'{\n  \"name\": \"web-ui\",\n  \"hosts\": [\n    \"tinyrobot-science-mesh-web-ui.herokuapp.com\"\n  ],\n  \"protocols\": [\n    \"https\"\n  ]\n}'\n\n## Add the current app name as the origin for the web-ui services\nheroku config:set KONG_ORIGINS=https://tinyrobot-science-mesh-web-ui.herokuapp.com:443=http://localhost:5000\n```\n\n✨ Visit the app's URL `https://tinyrobot-science-mesh-web-ui.herokuapp.com/` in a web browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmars%2Ftinyrobot-science-mesh-web-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmars%2Ftinyrobot-science-mesh-web-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmars%2Ftinyrobot-science-mesh-web-ui/lists"}