Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache is the structure which can be used to cache the generated topology graph in the applications plugin.
type Config ¶ added in v0.8.0
type Config struct { Type string `json:"type"` Shape string `json:"shape"` Color string `json:"color"` }
Config is the structure of the topology graph configuration. It contains a type which can then be used in the "topology.type" property in an application. It also contains a user color and shape which defines how the application is rendered in the topology graph.
type Edge ¶
type Edge struct {
Data EdgeData `json:"data"`
}
Edge is the structure for a edge in the topology graph.
type EdgeData ¶
type EdgeData struct { ID string `json:"id"` Source string `json:"source"` SourceCluster string `json:"-"` SourceNamespace string `json:"-"` SourceName string `json:"-"` Target string `json:"target"` TargetCluster string `json:"-"` TargetNamespace string `json:"-"` TargetName string `json:"-"` Description string `json:"description"` Dashboards []dashboardv1.Reference `json:"dashboards"` }
EdgeData is the data for a edge. Each edge must contain a unique id a source and a target. Where the source and target is a reference to the id of a node. Each edge also contains the cluster, namespace and name of the source and target and an optional description, which can be used to describe the relationship between the source and target.
type Node ¶
type Node struct {
Data NodeData `json:"data"`
}
Node is the structure for a node in the topology graph.
type NodeData ¶
type NodeData struct { ID string `json:"id"` Type string `json:"type"` Label string `json:"label"` Parent string `json:"parent"` applicationv1.ApplicationSpec }
NodeData is the data for a node. Each node must contain a unique id, type (application, namespace, cluster) a label and a parent. Each application node has a namespace nodes as parent and each namespace has a cluster as parent.
type Topology ¶
Topology is the structure of the topology graph. The topology contains a list of nodes (applications, namespaces and clusters) and a list of edges, which are defined by the dependencies field in the Applications CR.
func Generate ¶
Generate is used to generate the topology chart for the users selected clusters and namespace. To generate this part of the topology graph we are going through all given clusters and namespace and add all the edges which are containing the given cluster/namespace as source or target. After that we are looping through all the edges and we are adding the source and target nodes. We are also creating an additional slice for the cluster and namespace nodes, which are then merged with the nodes slice. This is necessary, because we do not save the clusters and namespaces as nodes in the cached topology.
func Get ¶
Get returnes the topology graph for all the configured clusters. To generate the topology chart we have to loop through all clusters and get all applications for all clusters. Then we are going through all the applications and and add them as node in the topology grahp. The defined dependencies for all applications are added as edges in the topology.