{"id":33146748,"url":"https://github.com/datawire/envoy-steps","last_synced_at":"2026-01-24T18:09:57.408Z","repository":{"id":45828790,"uuid":"81874810","full_name":"datawire/envoy-steps","owner":"datawire","description":"Envoy Step by Step","archived":false,"fork":false,"pushed_at":"2020-11-14T13:59:55.000Z","size":45,"stargazers_count":75,"open_issues_count":6,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T03:23:23.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datawire.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}},"created_at":"2017-02-13T21:40:41.000Z","updated_at":"2024-11-04T16:23:26.000Z","dependencies_parsed_at":"2022-09-14T00:01:19.724Z","dependency_job_id":null,"html_url":"https://github.com/datawire/envoy-steps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datawire/envoy-steps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawire%2Fenvoy-steps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawire%2Fenvoy-steps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawire%2Fenvoy-steps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawire%2Fenvoy-steps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datawire","download_url":"https://codeload.github.com/datawire/envoy-steps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawire%2Fenvoy-steps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285389437,"owners_count":27163377,"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","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-11-15T13:00:39.394Z","updated_at":"2026-01-24T18:09:57.391Z","avatar_url":"https://github.com/datawire.png","language":"Python","funding_links":[],"categories":["Tutorials \u0026 Learning"],"sub_categories":[],"readme":"Envoy Step By Step\n==================\n\nThis is a simple example of how one can use Envoy to create scalable Flask apps.\n\nThe Tools\n---------\n\nTools we'll be using:\n\n1. [minikube](https://github.com/kubernetes/minikube)\n2. [envoy](https://lyft.github.io/envoy/)\n\nYou'll need to get Minikube installed before starting. You do _not_ need to install `envoy` though! It will magically Just Happen as we build containers out.\n\nThe Process\n-----------\n\nWe're going to work with a very, very simple application: a simple Flask app that allows creating users, then reading them back.\n\nStep 0: Minikube\n================\n\nFirst we need to start Minikube. On a Mac for your first startup, you need to decide if you're going to use the VirtualBox driver for Minikube, or the `xhyve` driver. I use `xhyve`:\n\n```minikube start --vm-driver xhyve```\n\nOnce minikube is started, run\n\n```eval $(minikube docker-env)```\n\nto get hooked up to the Minikube Docker daemon (which we'll be using when we build Docker images later).\n\nTo prep everything for Minikube, run\n\n```\nbash prep.sh -\n```\n\nShould you want to clean everything up when done, use\n\n```\nbash clean.sh\n```\n\nStep 1: Basic Flask App\n=======================\n\nStart the Postgres and `usersvc` containers:\n\n```\nbash up.sh postgres\nbash up.sh usersvc\n```\n\nand then you should be able to check things out:\n\n```\ncurl $(minikube service --url usersvc)/user/health\n```\n\nshould show you something like\n\n```\n{\u2028\n  \"hostname\": \"usersvc-1941676296-zlrt2\",\n  \"msg\": \"user health check OK\",\n  \"ok\": true,\n  \"resolvedname\": \"172.17.0.10\"\u2028\n}\n```\n\nNext up we can try saving and retrieving a user:\n\n```\ncurl -X PUT \\\n     -H \"Content-Type: application/json\" \\\n     -d '{ \"fullname\": \"Alice\", \"password\": \"alicerules\" }' \\\n     $(minikube service --url usersvc)/user/alice\n```\n\nThis should give us a user record for Alice, including her UUID but not her password:\n\n```\n{\n  \"fullname\": \"Alice\",\n  \"hostname\": \"usersvc-1941676296-zlrt2\",\n  \"ok\": true,\n  \"resolvedname\": \"172.17.0.10\",\n  \"uuid\": \"44FD5687B15B4AF78753E33E6A2B033B\"\u2028\n}\n```\n\nand we should be able to read the user back (sans password again) with\n\n```\ncurl $(minikube service --url usersvc)/user/alice\n```\n\nStep 2: Enter Envoy\n===================\n\nStart the `edge-envoy` container:\n\n```\nbash up.sh edge-envoy\n```\n\nthen drop the `usersvc` container and replace it with the `usersvc2` container:\n\n```\nbash down.sh usersvc\nbash up.sh usersvc2\n```\n\nand now going through Envoy should work:\n\n```\ncurl $(minikube service --url edge-envoy)/user/health\ncurl $(minikube service --url edge-envoy)/user/alice\n```\n\nStep 3: Scaling the App\n=======================\n\nWe can scale the app pretty simply:\n\n```\nkubectl scale --replicas=3 deployment/usersvc\n```\n\nbut that will reveal that the DNS discovery we've been using so far won't work. We need to bring Envoy's Service Discovery Service into play:\n\n```\nbash up.sh usersvc-sds\nbash down.sh edge-envoy\nbash up.sh edge-envoy2\n```\n\nand once that's done, you'll be able to see requests cycling through all the `usersvc` endpoints.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawire%2Fenvoy-steps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatawire%2Fenvoy-steps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawire%2Fenvoy-steps/lists"}