Skip to content

Latest commit

 

History

History
149 lines (102 loc) · 5.96 KB

README.md

File metadata and controls

149 lines (102 loc) · 5.96 KB

IstioLab

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.

Features

  • 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.

Getting Started

Prerequisites

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.

Optional (For Modifying the App)

If you plan to modify the custom application, you will also need:

  • Go - For application development.
  • Kustomize - For customizing Kubernetes resources.

Project Structure

  • 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.

Installation and Usage

1. Create the Cluster

  • 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
    

2. Run a Test

  • 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, or D).
  • Example:
    task test-20ms-20-A
    This runs Scenario A with a 20ms delay between each request, totaling 20 requests.
  • Looping the Test:
    while true; do task test-20ms-20-A && sleep 30; done

3. View Logs

  • 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

4. Delete the Cluster

  • Tear down the cluster and clean up resources:
    task delete

Architecture

Simple Architecture

Figure 1: Basic architecture diagram showing the deployments connected through the Istio Gateway.

Data Flow

Figure 2: Data flow visualized in Kiali.

Scenarios

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 Descriptions

  • Scenario A (/scenarioA):

    • Flow: ProxyApp AApp 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.
  • Scenario B (/scenarioB):

    • Flow: ProxyApp AApp B (with loopback).
    • Description: Similar to Scenario A, but App B has a feedback loop, sending a response back to itself.
  • Scenario C (/scenarioC):

    • Flow: ProxyApp AApp BApp C.
    • Description: App A sends traffic to App B, which then forwards the traffic to App C, creating a chain of requests.
  • Scenario D (/scenarioD):

    • Flow: ProxyApp AApp C.
    • Description: App A directly sends traffic to App C, bypassing App B.

Visual Representation

Scenarios

Figure 3: Visual representation of the different scenarios.

Monitoring and Observability

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.

Contributing

We welcome contributions from the community! If you'd like to improve the project or add new features:

  1. Fork the Repository: Click the "Fork" button at the top of the repository page to create your own copy.
  2. Create a New Branch: For your feature or bug fix:
    git checkout -b feature-name
  3. Make Changes: Implement your feature or fix, and ensure it's well-tested.
  4. 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.


Further Reading

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!