{"id":21428083,"url":"https://github.com/redhat-developer-demos/istio-httpbin","last_synced_at":"2025-06-27T06:33:57.968Z","repository":{"id":53869122,"uuid":"100023622","full_name":"redhat-developer-demos/istio-httpbin","owner":"redhat-developer-demos","description":"Istio demo to demo that istio prefix will fail the routes/policies","archived":false,"fork":false,"pushed_at":"2017-08-11T11:53:34.000Z","size":55,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-22T22:11:26.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/redhat-developer-demos.png","metadata":{"files":{"readme":"README.adoc","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-08-11T11:09:15.000Z","updated_at":"2023-03-18T14:04:11.000Z","dependencies_parsed_at":"2022-08-30T23:41:26.396Z","dependency_job_id":null,"html_url":"https://github.com/redhat-developer-demos/istio-httpbin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Fistio-httpbin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Fistio-httpbin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Fistio-httpbin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Fistio-httpbin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-developer-demos","download_url":"https://codeload.github.com/redhat-developer-demos/istio-httpbin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235246412,"owners_count":18959225,"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-11-22T22:10:18.064Z","updated_at":"2025-01-23T07:48:10.527Z","avatar_url":"https://github.com/redhat-developer-demos.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":":toc: auto\n:linkattrs:\n\n[[istio-httpbin]]\n= Istio HttpBin\n\nA small project to demonstrate how prefixing `istio` to the application/service name is causing\nthe https://istio.io/docs/reference/config/traffic-rules/destination-policies.html[Isito Destination policies] to fail\n\n[[pre-requisites]]\n= Pre-requisites\n\n* Kubernetes cluster is up and running\n* Istio is deployed into the kubernetes cluster\n\n[[build-and-deploy]]\n==  Building and Deploying\n\n[[build]]\n=== Build\n[code,sh]\n----\n./mvnw clean install\n----\n\n[[deploy]]\n=== Deploy\n\nThe build above should create the required kubernetes manifests that allows to deploy the service in Istio Service Mesh.\nAll the files will be located in the *target* directory of the project\n\n[code,sh]\n----\n\nkubectl apply -f /target/istio/isito-httpbin.yaml \u003c1\u003e\nkubectl apply -f target/istio/httpbin-ingress.yaml \u003c2\u003e\nkubectl apply -f target/istio/httpbin-svc.yaml \u003c3\u003e\nistioctl create  -f target/istio/isito-httpbin.yaml \u003c4\u003e\n\n----\n\n\u003c1\u003e Deploy the istio-httpbin in to kubernetes cluster and create the _istio-httpbin_ service\n\u003c2\u003e Create istio-httpbin related Kubernetes ingress resources\n\u003c3\u003e Create the Kubernetes egress resource to access httpbin.org from within Isito Service Mesh\n\u003c4\u003e Create the Istio `route-rule` and `destinaiton-policy`\n\n[[test]]\n== Testing\n\nSince the destination policy has defined the Circuit Breaker, the application should return the client\nwith errors post 2 requests which means 90% failure for concurrent requests of 20 users.\n\nThe application url can be found using the command `echo $(minikube ip):$(kubectl get svc istio-ingress -o jsonpath='{.spec.ports[0].nodePort}')/httbin/delay`\n\nTo test application with concurrency you can using tools like http://gatling.io/[Gatling], the following load test script\ncould be used with gatling\n\n[code,scala]\n----\n\nimport scala.concurrent.duration._\n\nimport io.gatling.core.Predef._\nimport io.gatling.http.Predef._\nimport io.gatling.jdbc.Predef._\n\nclass HttpBinServiceSimulation extends Simulation {\n\n\tval httpProtocol = http\n\t\t.baseURL(\"http://192.168.99.100:30420\") \u003c1\u003e\n\t\t.inferHtmlResources()\n\t\t.acceptHeader(\"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\")\n\t\t.acceptEncodingHeader(\"gzip, deflate\")\n\t\t.acceptLanguageHeader(\"en-US,en;q=0.5\")\n\t\t.userAgentHeader(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Firefox/52.0\")\n\n\tval headers_0 = Map(\"Upgrade-Insecure-Requests\" -\u003e \"1\")\n\n    val uri1 = \"http://192.168.99.100:30420/httpbin/delay\" \u003c1\u003e\n\n\tval scn = scenario(\"HttpBinServiceSimulation\")\n\t\t.exec(http(\"request_0\")\n\t\t\t.get(\"/httpbin/delay\")\n\t\t\t.headers(headers_0))\n\n\tsetUp(scn.inject(atOnceUsers(20))).protocols(httpProtocol)\n}\n\n----\n\n\u003c1\u003e replace it with Kubernetes cluster IP and isito-ingress node port\n\n=== Executing Test Simulations\n\nBy default the gatling tests are disabled, they can be enabled passing `-Dskip.gatlingTest=false`\nsystem property to the maven command as shown below,\n\n[code,sh]\n----\n./mvnw -Dskip.gatlingTests=false gatling:integration-test\n----\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer-demos%2Fistio-httpbin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-developer-demos%2Fistio-httpbin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer-demos%2Fistio-httpbin/lists"}