Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace image with mermaid diagrams #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jongwooo
Copy link
Member

Description

This pull request includes an update to the README.md file to replace a static image with a dynamic graph rendered using Mermaid syntax. This change enhances the ease of use, version control and collaboration.

Fixes #29

AS-IS

image

TO-BE

graph BT
    GatewayClass["GatewayClass<br>foo-com-external-gateway-class"]
    Gateway["Gateway<br>default/demo-gateway-1"]

    subgraph Namespace [Namespace<br>default]
        Gateway["Gateway<br>default/demo-gateway-1"]
        HTTPRoute1["HTTPRoute<br>default/demo-httproute-1"]
        HTTPRoute2["HTTPRoute<br>default/demo-httproute-2"]
        HTTPRoute3["HTTPRoute<br>default/demo-httproute-3"]
        HTTPRoute4["HTTPRoute<br>ns2/demo-httproute-4"]
        Service["Service<br>default/demo-svc"]
    end

    Gateway -->|GatewayClass| GatewayClass
    
    HTTPRoute1 -->|ParentRef| Gateway
    HTTPRoute2 -->|ParentRef| Gateway
    HTTPRoute3 -->|ParentRef| Gateway
    HTTPRoute4 -->|ParentRef| Gateway

    HTTPRoute1 -->|BackendRef| Service
    HTTPRoute2 -->|BackendRef| Service
    HTTPRoute3 -->|BackendRef| Service
    HTTPRoute4 -->|BackendRef| Service

Loading

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jongwooo
Once this PR has been reviewed and has the lgtm label, please assign mlavacca for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 10, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 10, 2025
@guicassolato
Copy link

I understand this would make the example provided (rendered as a Mermaid diagram would) to diverge significantly from the expected output of gwctl … -o graph (Graphviz DOT language) and therefore how renders for the latter would represent the diagram. I wonder if this couldn't be confusing to users.

@jongwooo
Copy link
Member Author

Hi @guicassolato, Thank you for your kind review!

I completely understand your concern about the potential divergence between the Mermaid diagram and the expected output of gwctl … -o graph (Graphviz DOT language). My intention was to make the diagram more dynamic and easier to maintain while keeping it as close as possible to the original static image.

However, I noticed that Mermaid currently seems to have a bug in rendering the Namespace subgraph correctly. Specifically, the arrow direction pointing to the Namespace subgraph is not accurately represented, which appears to be an issue with Mermaid's rendering engine.

To illustrate the issue, here is the current Mermaid graph with the problematic rendering of the Namespace subgraph:

graph TD
    GatewayClass["GatewayClass<br>foo-com-external-gateway-class"]
    Gateway["Gateway<br>default/demo-gateway-1"]
    Namespace["Namespace<br>default"]
    Service["Service<br>default/demo-svc"]
    HTTPRoute1["HTTPRoute<br>default/demo-httproute-1"]
    HTTPRoute2["HTTPRoute<br>default/demo-httproute-2"]
    HTTPRoute3["HTTPRoute<br>default/demo-httproute-3"]
    HTTPRoute4["HTTPRoute<br>ns2/demo-httproute-4"]

    GatewayClass --> |GatewayClass| Gateway
    Gateway -.- |Namespace| Namespace
    Namespace -.- |Namespace| HTTPRoute1
    Namespace -.- |Namespace| HTTPRoute2
    Namespace -.- |Namespace| HTTPRoute3
    Namespace -.- |Namespace| HTTPRoute4
    HTTPRoute1 --> |BackendRef| Service
    HTTPRoute2 --> |BackendRef| Service
    HTTPRoute3 --> |BackendRef| Service
    HTTPRoute4 --> |BackendRef| Service
    HTTPRoute1 --> |ParentRef| Gateway
    HTTPRoute2 --> |ParentRef| Gateway
    HTTPRoute3 --> |ParentRef| Gateway
    HTTPRoute4 --> |ParentRef| Gateway
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider using mermaid diagrams instead of image
3 participants