IstioLab is a streamlined environment designed to help you understand and experiment with Istio. By providing pre-built tools and configurable microservices, IstioLab ensures that Istio is the primary variable in your Kubernetes environment, allowing for focused learning and experimentation in a controlled setting.
- One-Command Setup: Quickly set up a Kubernetes cluster using Kind with a single command.
- Integrated Tools: Automatic configuration of Istio, Kiali, Grafana, k6, and a custom application.
- Pre-Built Scenarios: Mimic real-world pod-to-pod communication with predefined scenarios.
- Easy Teardown: Clean up your environment effortlessly to reset and start fresh.
Before you start, ensure the following tools are installed:
- Kind - For managing Kubernetes clusters.
- Docker - For container management.
- Task - For task automation.
- Helm - For managing Kubernetes applications.
If you plan to modify the custom application, you will also need:
- app: Contains the Go code and Kubernetes manifests for the microservices.
- istio: Holds all Istio-related configurations and files.
- k6: Includes the k6
script.js
and Kubernetes manifest to run load tests. - kind: Contains the Kind cluster configuration files.
- monitoring: Includes Grafana Kubernetes manifests and Grafonnet files to define dashboards.
- Run the following command to set up the cluster:
task create
- First-Time Setup: Update your
/etc/hosts
file as prompted at the end of the task. Add:127.0.0.1 proxy.local kiali.local grafana.local
- Use the command
task test-{delay}-{count}-{scenario}
to run a test, where:{delay}
: Go duration (e.g.,20ms
,1s
,1h
).{count}
: Number of requests (integer).{scenario}
: Scenario identifier (A
,B
,C
, orD
).
- Example:
This runs Scenario A with a 20ms delay between each request, totaling 20 requests.
task test-20ms-20-A
- Looping the Test:
while true; do task test-20ms-20-A && sleep 30; done
- Run
task logs-{deployment}
to view logs from a specific deployment.{deployment}
: Name of the deployment (e.g.,app-a
,app-b
).
- Example:
task logs-app-a
- Tear down the cluster and clean up resources:
task delete
Figure 1: Basic architecture diagram showing the deployments connected through the Istio Gateway.
Figure 2: Data flow visualized in Kiali.
The scenarios are designed to mimic real-world pod-to-pod communication within a Kubernetes cluster. Each scenario starts at the proxy, moves on to app-a
, and then, depending on the scenario, proceeds to other services. The end service in the communication chain runs a highly intensive computation for 5 seconds by default.
-
Scenario A (
/scenarioA
):- Flow:
Proxy
→App A
→App B
. - Description: App A sends traffic to App B in a simple, one-directional flow.
- Details: App B performs intensive computation for 5 seconds upon receiving a request from App A.
- Flow:
-
Scenario B (
/scenarioB
):- Flow:
Proxy
→App A
→App B
(with loopback). - Description: Similar to Scenario A, but App B has a feedback loop, sending a response back to itself.
- Flow:
-
Scenario C (
/scenarioC
):- Flow:
Proxy
→App A
→App B
→App C
. - Description: App A sends traffic to App B, which then forwards the traffic to App C, creating a chain of requests.
- Flow:
-
Scenario D (
/scenarioD
):- Flow:
Proxy
→App A
→App C
. - Description: App A directly sends traffic to App C, bypassing App B.
- Flow:
Figure 3: Visual representation of the different scenarios.
IstioLab comes with integrated monitoring tools to help you visualize and analyze the traffic within your cluster.
- Kiali: Access at
http://kiali.local/
to visualize the service mesh topology and traffic flow. - Grafana: Access at
http://grafana.local/
to view performance metrics and dashboards.
Note: Ensure your
/etc/hosts
file is updated as mentioned in the Prerequisites to access these tools via the local URLs.
We welcome contributions from the community! If you'd like to improve the project or add new features:
- Fork the Repository: Click the "Fork" button at the top of the repository page to create your own copy.
- Create a New Branch: For your feature or bug fix:
git checkout -b feature-name
- Make Changes: Implement your feature or fix, and ensure it's well-tested.
- Submit a Pull Request: Open a pull request to the main repository, describing your changes and the rationale behind them.
Feel free to open issues or feature requests to discuss ideas or report bugs.
For deeper insights into Istio and related topics, check out Isar Nasimov's Blog, where topics like Istio, Kubernetes, and more are covered in detail. Be sure to explore the Istio-related posts for additional tips and best practices!