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

topology command: persist in local disk #104

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

eguzki
Copy link
Collaborator

@eguzki eguzki commented Dec 18, 2024

What

topology command: persist in local disk in DOT format and SVG format

❯ bin/kuadrantctl topology -h
Read kuadrant topology

Usage:
  kuadrantctl topology [flags]

Flags:
  -h, --help               help for topology
  -n, --namespace string   Topology's namespace (default "kuadrant-system")
  -o, --output string      Output file (default "(required)")

Global Flags:
  -v, --verbose   verbose output

Verification steps

  • Install kuadrant
helm repo add kuadrant https://kuadrant.io/helm-charts/ --force-update
helm install kuadrant kuadrant/kuadrant-operator --namespace kuadrant-system --create-namespace
  • Deploy kuadrant
kubectl -n kuadrant-system apply -f - <<EOF
apiVersion: kuadrant.io/v1beta1
kind: Kuadrant
metadata:
  name: kuadrant
spec: {}
EOF
  • Read topology
make install
bin/kuadrantctl topology -o ~/tmp/topology -v

Output

2024-12-19T10:55:52+01:00	DEBUG	reading topology	{"object": {"name":"topology","namespace":"kuadrant-system"}, "error": null}
2024-12-19T10:55:52+01:00	DEBUG	write topology in DOT format to file	{"file": "/home/eguzki/tmp/topology.dot", "error": null}
2024-12-19T10:55:52+01:00	DEBUG	parse DOT graph	{"graph empty": false, "error": null}
2024-12-19T10:55:52+01:00	DEBUG	info graph	{"graph nodenum": 14, "error": null}
2024-12-19T10:55:52+01:00	DEBUG	render graph to SVG	{"buf len": 10743, "error": null}
2024-12-19T10:55:52+01:00	DEBUG	write topology in SVG format to file	{"file": "/home/eguzki/tmp/topology", "error": null}
  • Check DOT format:
cat ~/tmp/topology.dot
digraph  {
	
	n4[label="Authorino\nkuadrant-system/authorino",shape="ellipse"];
	n2[label="ConfigMap\nkuadrant-system/topology",shape="ellipse"];
	n6[fillcolor="#e5e5e5",label="Gateway\ngateway-system/kuadrant-ingressgateway",shape="box",style="filled"];
	n8[fillcolor="#e5e5e5",label="Listener\ngateway-system/kuadrant-ingressgateway#http",shape="box",style="filled"];
	n5[fillcolor="#e5e5e5",label="GatewayClass\nenvoygateway",shape="box",style="filled"];
	n7[fillcolor="#e5e5e5",label="HTTPRoute\ndefault/toystore",shape="box",style="filled"];
	n9[fillcolor="#e5e5e5",label="HTTPRouteRule\ndefault/toystore#rule-1",shape="box",style="filled"];
	n10[fillcolor="#e5e5e5",label="HTTPRouteRule\ndefault/toystore#rule-2",shape="box",style="filled"];
	n1[label="Kuadrant\nkuadrant-system/kuadrant",shape="ellipse"];
	n3[label="Limitador\nkuadrant-system/limitador",shape="ellipse"];
	n6->n8[comment="Gateway -> Listener"];
	n8->n7[comment="Listener -> HTTPRoute"];
	n5->n6[comment="GatewayClass -> Gateway"];
	n7->n9[comment="HTTPRoute -> HTTPRouteRule"];
	n7->n10[comment="HTTPRoute -> HTTPRouteRule"];
	n1->n5[comment="Kuadrant -> GatewayClass"];
	n1->n3[comment="Kuadrant -> Limitador"];
	n1->n4[comment="Kuadrant -> Authorino"];
	
}

@eguzki eguzki requested a review from trepel December 18, 2024 22:33
@eguzki eguzki linked an issue Dec 18, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 98 lines in your changes missing coverage. Please review.

Project coverage is 54.57%. Comparing base (7296e1b) to head (0018dfc).
Report is 65 commits behind head on main.

Files with missing lines Patch % Lines
cmd/topology.go 0.00% 93 Missing ⚠️
cmd/root.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            main     #104       +/-   ##
==========================================
+ Coverage   0.38%   54.57%   +54.19%     
==========================================
  Files         17       17               
  Lines        783      885      +102     
==========================================
+ Hits           3      483      +480     
+ Misses       780      330      -450     
- Partials       0       72       +72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
@eguzki eguzki force-pushed the 103-topology-scaffolding-persisting-in-local-disk-the-existing-topology branch from 8fd8966 to 07b4866 Compare December 19, 2024 09:05
@eguzki eguzki force-pushed the 103-topology-scaffolding-persisting-in-local-disk-the-existing-topology branch from bf39b77 to fd21d07 Compare December 19, 2024 09:57
eguzki and others added 6 commits December 19, 2024 13:58
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
…lt-all-to-visualize-svg

Topology command:  open svg graph in the user’s preferred application
Copy link

@trepel trepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

topology scaffolding persisting in local disk the existing topology
3 participants