Resource Topology
The resource topology graph of VelaUX can automatically show the resource tree of an application for any workloads including Helm charts and cloud resources.
Mechanism
By default, the connections in the resource graph rely on the ownerReference mechanism, while it's also configurable for CRDs which don't have specific ownerReferences. The controller will search all child resources for one node according to these rules.
These rules can also reduce redundant resources for better performance. For example, one of the built-in rules has defined that a Deployment will only have ReplicaSet as its child, so when we draw the resource graph, it will only display resources whose type is ReplicaSet along with ownerReference info.
Add more rules
The built-in rules is limited, you can add a customized rule by create a ConfigMap like this:
apiVersion: v1
kind: ConfigMap
metadata:
name: clone-set-relation
namespace: vela-system
labels:
"rules.oam.dev/resources": "true"
data:
rules: |-
- parentResourceType:
group: apps.kruise.io
kind: CloneSet
childrenResourceType:
- apiVersion: v1
kind: Pod
- The ConfigMap should have the special label
"rules.oam.dev/resources": "true"
the data keyrules
defined a list of relationship rules. - One relationship rule define what children type a parent can have.
In the example above, the parent type is Cloneset
in group apps.kruise.io
, his child resource type is v1/Pod
All customized rules specified in these configmaps would be merged with built-in rules and take effect in searching child resources.