--- title: Resource Relationships --- `Resource Relationships` mainly specify the relationship between two types of resources. Its main function is to help KubeVela establish the topological relationship of the resources managed by a KubeVela application. For example, the system has a built-in relationship rule: The sub-resources under the [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) can only be [ReplicaSet ](https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/), and the child resource of ReplicaSet can only be [Pod](https://kubernetes.io/docs/concepts/workloads/pods/ ). When a KubeVela application with Deployment as the workload is created, then view the topology graph of the application on VelaUX, KubeVela will first list all ReplicaSets in the same namespace with the Deployment, and filter out the results whose OwnerReference don't point to the Deployment, and then find the Pod under the ReplicaSet with the same way. This can help to establish the topology hierarchy of the managed resources under the application. In general, these `Resource Relationships` are mainly used in the following scenarios: - Help to display the topology graph of an application on VelaUX. The following is an example of topology graph: ![image](../resources/tree.png) - When using `vela port-forward`, `vela logs`, `vela exec` and `vela status --endpoint` via cli or check the log or access port of an application on VelaUX, it helps KubeVela to discover the pods or services of an application. ## Add more rules The built-in `Resource Relationships` in the system are limited. If a Kubernetes CustomResourceDefinition is added to your cluster, you can add new relationship rules to the system by creating a Kubernetes `configmap` to your cluster. Then we will introduce the details with an example. You can first enable the [kruise](https://github.com/kubevela/catalog/tree/master/experimental/addons/kruise) addon which is an experimental addon by running follow command: ```shell vela addon registry add experimental --type=helm --endpoint=https://addons.kubevela.net/experimental/ vela addon enable kruise ``` After enable succeed you will see the `cloneset` componentDefinition whose workload's type is `clonesets.apps.kruise.io`. The cloneset controller will create pods for application. ```shell $ vela componets NAME DEFINITION DESCRIPTION cloneset autodetects.core.oam.dev Describes long-running, scalable, containerized services that have a stable network endpoint to receive external network traffic from customers. If workload type is skipped for any service defined in Appfile, it will be defaulted to `webservice` type. ``` Then, create a `cloneset` application: ```yaml cat <